Generic network interface

Interface to get ip addresses of local network interfaces

File information

Filecommon/interface/network.h

Classes INetwork
LocalAddr
LocalAddresses

Classes

INetwork

class INetwork {
public:
    static LocalAddresses * GetLocalAddresses()
};

Overview

Base class for searching local ip addresses.

Public functions

GetLocalAddresses
Platform dependent method that will look for local interfaces and get the corresponding ip addresses.

LocalAddr

class LocalAddr {
public:
    bool iPv6;
    char * addr;
    LocalAddr(char * addr, bool iPv6) { 
        this->addr = addr; 
        this->iPv6 = iPv6; 
    };
    ~LocalAddr() { if(addr) free(addr); };
};

Overview

Helper class that contains a local ip address and a boolean to indicate if this is an IPv6 address.

LocalAddresses

class LocalAddresses {
public:
    istd::list  localAddresses;
    ~LocalAddresses() {
        while(this->localAddresses.front()) {
            delete this->localAddresses.front();
        }
    }
};

Overview

Helper class that contains a list of LocalAddr returned by the GetLocalAddresses method.