DDraceNetwork Docs
Network-General
Collaboration diagram for Network-General:

Modules

 Network-UDP
 
 Network-TCP
 
 Network-Unix-Sockets
 

Classes

struct  NETADDR
 

Typedefs

typedef int UNIXSOCKET
 
typedef struct sockaddr_un UNIXSOCKETADDR
 
typedef struct NETSOCKET_INTERNALNETSOCKET
 
typedef struct NETADDR NETADDR
 

Functions

void net_init ()
 
int net_addr_comp (const NETADDR *a, const NETADDR *b)
 
int net_addr_comp_noport (const NETADDR *a, const NETADDR *b)
 
bool net_addr_str (const NETADDR *addr, char *string, int max_length, int add_port)
 

Detailed Description

Typedef Documentation

◆ NETADDR

typedef struct NETADDR NETADDR

◆ NETSOCKET

typedef struct NETSOCKET_INTERNAL* NETSOCKET

◆ UNIXSOCKET

typedef int UNIXSOCKET

◆ UNIXSOCKETADDR

typedef struct sockaddr_un UNIXSOCKETADDR

Function Documentation

◆ net_addr_comp()

int net_addr_comp ( const NETADDR a,
const NETADDR b 
)

Compares two network addresses.

Parameters
aAddress to compare
bAddress to compare to.
Returns
< 0 - Address a is less than address b
0 - Address a is equal to address b
> 0 - Address a is greater than address b

◆ net_addr_comp_noport()

int net_addr_comp_noport ( const NETADDR a,
const NETADDR b 
)

Compares two network addresses ignoring port.

Parameters
aAddress to compare
bAddress to compare to.
Returns
< 0 - Address a is less than address b
0 - Address a is equal to address b
> 0 - Address a is greater than address b

◆ net_addr_str()

bool net_addr_str ( const NETADDR addr,
char *  string,
int  max_length,
int  add_port 
)

Turns a network address into a representative string.

Parameters
addrAddress to turn into a string.
stringBuffer to fill with the string.
max_lengthMaximum size of the string.
add_portadd port to string or not
Returns
true on success
Remarks
The string will always be zero terminated

◆ net_init()

void net_init ( )

Initiates network functionality.

Remarks
You must call this function before using any other network functions.