3#include "../global.hpp"
5#include "../network_connection.hpp"
6#include "gevserver.hpp"
8#include "../_cexports/c_img.h"
15 inline HandleGuard<CExports::GEVIFACELIST>::HandleGuard(
void *handle) noexcept
16 : HandleGuard<CExports::GEVIFACELIST>(handle, [](
void *handle) { CVB_CALL_CAPI(
ReleaseObject(handle)); })
26 struct LogicalNetworkInterface
28 typedef Cvb::NetworkConnection::IPAddress IPAddressType;
29 typedef Cvb::NetworkConnection::IPAddress IPv4MaskType;
30 typedef Cvb::NetworkConnection::IPAddressUInt IPAddressTypeUInt;
40 HandleGuard<CExports::GEVIFACELIST> guard(CVB_CALL_CAPI(CreateInterfaceList()));
44 auto numInterfaces = CVB_CALL_CAPI(ILCount(guard.Handle()));
49 CExports::gsipv4 ip = 0;
50 if (CVB_CALL_CAPI(ILIPv4Address(guard.Handle(), i, ip)))
53 CExports::gsipv4 subnetMask = 0;
54 if (CVB_CALL_CAPI(ILIPv4SubnetMask(guard.Handle(), i, subnetMask)))
69 LogicalNetworkInterface(
const IPAddressTypeUInt &ipUInt,
const IPv4MaskType &ipv4Mask)
70 : ipAddressUInt_{ipUInt}
88 ipAddress_ = ipAddress;
97 return ipAddressUInt_;
105 ipAddressUInt_ = ipAddressUInt;
122 ipv4Mask_ = ipv4Mask;
125 IPAddressType ipAddress_;
126 IPAddressTypeUInt ipAddressUInt_ = 0;
127 IPv4MaskType ipv4Mask_;
26 struct LogicalNetworkInterface {
…};
cvbbool_t ReleaseObject(OBJ &Object)
Namespace for GevServer based device configuration.
Definition decl_int_swiss_knife_node.hpp:11
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
An IP network interface the GevServer can be bound to.
Definition logical_network_interface.hpp:27
void IPv4Mask(const IPAddressType &ipv4Mask)
Sets the subnet mask of the Address.
Definition logical_network_interface.hpp:120
static std::vector< LogicalNetworkInterface > GetAllAvailable()
Gets all available network interfaces usable by the GevServer.
Definition logical_network_interface.hpp:38
void SetIPAddress(const IPAddressType &ipAddress)
Sets the address of the interface as string and converted uint.
Definition logical_network_interface.hpp:86
void SetIPAddressUInt(const IPAddressTypeUInt &ipAddressUInt)
Sets the address of the interface as unsigned integer and converted string ip address.
Definition logical_network_interface.hpp:103
IPAddressTypeUInt IPAddressUInt() const
Gets the address of the interface as unsigned integer.
Definition logical_network_interface.hpp:95
IPAddressType IPAddress() const
Gets the address of the interface.
Definition logical_network_interface.hpp:78
IPAddressType IPv4Mask() const
Gets the subnet mask of the Address.
Definition logical_network_interface.hpp:112
static IPAddress ToIPAddress(const IPAddressUInt &ipAddressInt)
Creates an IPAddress from the given uint ip .
Definition network_connection.hpp:46
static IPAddressUInt ToIPAddressUInt(const IPAddress &ip)
Creates an uint ip . from the given IPAddress
Definition network_connection.hpp:68