GEV Server (CVGevServer.dll) 14.1
Logical Interface Functions

Functions

GEVIFACELIST CreateInterfaceList ()
 Creates the ref-counted GEVIFACELIST object. More...
 
size_t ILCount (GEVIFACELIST List)
 Gets the number of available network interfaces in the given List. More...
 
cvbres_t ILIPv4Address (GEVIFACELIST List, size_t Index, gsipv4 &IPv4)
 Gets the IP address of the logical interface at the given Index. More...
 
cvbres_t ILIPv4SubnetMask (GEVIFACELIST List, size_t Index, gsipv4 &SubnetMask)
 Gets the subnet mask of the logical interface at the given Index. More...
 
cvbres_t ILMACAddress (GEVIFACELIST List, size_t Index, ILMAC &MACAddress)
 Gets the MAC address of the logical interface at the given Index. More...
 
cvbbool_t IsInterfaceList (GEVIFACELIST List)
 Tries to check whether the given List is a valid GEVIFACELIST object. More...
 

Detailed Description

Function Documentation

◆ CreateInterfaceList()

GEVIFACELIST CreateInterfaceList ( )

Creates the ref-counted GEVIFACELIST object.

It contains all available (logical) network interfaces which are usable by the GEV Server to bind to.

Attention
Call the ReleaseObject function on the returned handle if it is not needed anymore.
Returns
GEVIFACELIST holding all available network interfaces; nullptr on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
ILCount, ILIPv4Address, ILIPv4SubnetMask, ILMACAddress, GSStartIPv4
See the Logical Interfaces section in the Theory of Operation chapter for more information.
Sample code in Visual C++:
This is an example which prints out the available logical interfaces IPs on this machine.
#include <iostream>
#include <vector>
#include <iCVGEVServer.h>
void PrintLastError()
{
size_t bufferSize = 0;
GSGetLastErrorString(nullptr, bufferSize);
if(bufferSize == 0)
return; // nothing to print
std::vector buffer(bufferSize);
GSGetLastErrorString(&buffer[0], bufferSize);
std::cout << &buffer[0] << std::endl;
}
void PrintIP(gsipv4 ip)
{
size_t vufferSize = 0;
cvbres_t result = GSIPv4ToString(ip, nullptr, bufferSize);
if(result < 0)
{
PrintLastError();
return;
}
if(bufferSize == 0)
return; // nothing to print
std::vector buffer(bufferSize);
GSIPv4ToString(ip, &buffer[0], bufferSize);
std::cout << &buffer[0] << std::endl;
}
void main()
{
if(hList == nullptr)
{
PrintLastError();
return;
}
size_t ifaceCount = ILCount(hList);
for(size_t i = 0; i < ifaceCount; i++)
{
gsipv4 ip = 0;
cvbres_t result = ILIPv4Address(hList, i, ip);
if(result < 0)
PrintLastError();
else
PrintIP(ip);
}
ReleaseObject(hList);
}
cvbres_t GSGetLastErrorString(char *Error, size_t &Length)
Gets the last string describing the reason of the last error.
Definition: GevServerExports.cpp:1401
size_t ILCount(GEVIFACELIST List)
Gets the number of available network interfaces in the given List.
Definition: GevServerExports.cpp:928
cvbres_t ILIPv4Address(GEVIFACELIST List, size_t Index, gsipv4 &IPv4)
Gets the IP address of the logical interface at the given Index.
Definition: GevServerExports.cpp:984
GEVIFACELIST CreateInterfaceList()
Creates the ref-counted GEVIFACELIST object.
Definition: GevServerExports.cpp:859
cvbres_t GSIPv4ToString(gsipv4 IPv4, char *IPString, size_t &Length)
Converts the given IPv4 (or subnet mask) into a string representation.
Definition: GevServerExports.cpp:1180
void * GEVIFACELIST
Handle of a logical interface list object.
Definition: iCVGevServer.h:30

◆ ILCount()

size_t ILCount ( GEVIFACELIST  List)

Gets the number of available network interfaces in the given List.

Parameters
[in]ListList object handle to query.
Returns
Number of interfaces; size_t(-1) on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateInterfaceList, ILIPv4Address, ILIPv4SubnetMask, ILMACAddress
Examples:
Visual C++ - VC GevServer Example
Sample in Visual C++:
For an example see the CreateInterfaceList function.

◆ ILIPv4Address()

cvbres_t ILIPv4Address ( GEVIFACELIST  List,
size_t  Index,
gsipv4 &  IPv4 
)

Gets the IP address of the logical interface at the given Index.

The number of available logical interfaces can be obtained by calling ILCount.

Parameters
[in]ListList object handle to query.
[in]IndexZero-based index of list entry to access.
[out]IPv4IP address of the given Index.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateInterfaceList, ILIPv4SubnetMask, ILMACAddress, GSStartIPv4, GSIPv4ToString
Examples:
Visual C++ - VC GevServer Example
Sample in Visual C++:
For an example see the CreateInterfaceList function.

◆ ILIPv4SubnetMask()

cvbres_t ILIPv4SubnetMask ( GEVIFACELIST  List,
size_t  Index,
gsipv4 &  SubnetMask 
)

Gets the subnet mask of the logical interface at the given Index.

The number of available logical interfaces can be obtained by calling ILCount.

Parameters
[in]ListList object handle to query.
[in]IndexZero-based index of list entry to access.
[out]SubnetMaskSubnet mask of the given Index.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateInterfaceList, ILIPv4Address, ILMACAddress, GSStartIPv4, GSIPv4ToString
Examples:
Visual C++ - VC GevServer Example
Sample in Visual C++:
For an example see the CreateInterfaceList function.

◆ ILMACAddress()

cvbres_t ILMACAddress ( GEVIFACELIST  List,
size_t  Index,
ILMAC &  MACAddress 
)

Gets the MAC address of the logical interface at the given Index.

The number of available logical interfaces can be obtained by calling ILCount.

Parameters
[in]ListList object handle to query.
[in]IndexZero-based index of list entry to access.
[out]MACAddressReferenced to 6 byte array to be filled with MAC address.
Returns
Smaller than zero on error (Use GSGetLastErrorString function for a human readable error description).
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateInterfaceList, ILIPv4Address, ILIPv4SubnetMask, ILMACAddress, GSStartIPv4, GSMACToString
Examples:
Visual C++ - VC GevServer Example
Sample in Visual C++:
For an example see the CreateInterfaceList function.

◆ IsInterfaceList()

cvbbool_t IsInterfaceList ( GEVIFACELIST  List)

Tries to check whether the given List is a valid GEVIFACELIST object.

Attention
It is only safe to call this function on valid List handles or nullptr.
Parameters
[in]ListHandle to check.
Returns
TRUE if the given List is valid, FALSE otherwise.
Supported platforms:
Win32
Win64
Linux
Related Topics:
CreateInterfaceList