All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
net_udp.c File Reference


#define ADDR_SIZE   4
#define MAXHOSTNAMELEN   512
#define SA_LEN(sa)   (sizeof(struct sockaddr_in))
#define SS_LEN(ss)   (sizeof(struct sockaddr_in))


typedef union address AF_address_t
typedef unsigned int socklen_t


int UDP_AddrCompare (netadr_t *addr1, netadr_t *addr2)
 Compare two network addresses. More...
const char * UDP_AddrToString (netadr_t *addr)
 Convert an address to a string. More...
int UDP_Broadcast (int socket, byte *buf, int len)
 Broadcast a packet via the specified socket. More...
int UDP_CheckNewConnections (void)
 Check for incoming packets on the accept socket. More...
int UDP_CloseSocket (int socket)
 Close a socket. More...
int UDP_Connect (int socket, netadr_t *addr)
 Does very little. More...
int UDP_GetAddrFromName (const char *name, netadr_t *addr)
 Convert a human readable address to a quake address. More...
int UDP_GetNameFromAddr (netadr_t *addr, char *name)
 Convert an address to a hostname. More...
int UDP_GetSocketAddr (int socket, netadr_t *na)
 Retrieve the address to which the socket is bound. More...
int UDP_GetSocketPort (netadr_t *addr)
 Get the port number from the socket address. More...
int UDP_Init (void)
 Initialize the UDP network interface. More...
void UDP_Listen (qboolean state)
 Open or close the accept socket. More...
int UDP_OpenSocket (int port)
 Open a single socket on the specified port. More...
int UDP_Read (int socket, byte *buf, int len, netadr_t *from)
 Read a packet from the specified socket. More...
int UDP_SetSocketPort (netadr_t *addr, int port)
 Set the port number of the socket address. More...
void UDP_Shutdown (void)
 Shutdown the UDP network interface. More...
int UDP_Write (int socket, byte *buf, int len, netadr_t *to)
 Send a packet via the specified socket to the specified address. More...


uint32_t * default_iface
uint32_t * ifaces
uint32_t * last_iface

Macro Definition Documentation

#define ADDR_SIZE   4
#define MAXHOSTNAMELEN   512
#define SA_LEN (   sa)    (sizeof(struct sockaddr_in))
#define SS_LEN (   ss)    (sizeof(struct sockaddr_in))

Typedef Documentation

typedef union address AF_address_t
typedef unsigned int socklen_t

Variable Documentation

uint32_t* default_iface
uint32_t* ifaces
uint32_t* last_iface