X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=lhnet.h;h=6d1d1f3f22c08f661d3c4ef40dc8da454f682e3a;hp=701045e3aa384372275c79de522ef89a0fc85ac3;hb=9becec9419d9a20c7d373b14e1106d5f0ce78494;hpb=3601d63f7b0038c6e2009ecf0857ad9d1a8d5252 diff --git a/lhnet.h b/lhnet.h index 701045e3..6d1d1f3f 100644 --- a/lhnet.h +++ b/lhnet.h @@ -1,15 +1,18 @@ -// Written by Forest Hale 2003-06-15 and placed into public domain. +// Written by Ashley Rose Hale (LadyHavoc) 2003-06-15 and placed into public domain. #ifndef LHNET_H #define LHNET_H +#include +#include "com_list.h" + typedef enum lhnetaddresstype_e { LHNETADDRESSTYPE_NONE, LHNETADDRESSTYPE_LOOP, LHNETADDRESSTYPE_INET4, - LHNETADDRESSTYPE_INET6, + LHNETADDRESSTYPE_INET6 } lhnetaddresstype_t; @@ -25,7 +28,7 @@ int LHNETADDRESS_FromPort(lhnetaddress_t *address, lhnetaddresstype_t addresstyp int LHNETADDRESS_FromString(lhnetaddress_t *address, const char *string, int defaultport); int LHNETADDRESS_ToString(const lhnetaddress_t *address, char *string, int stringbuffersize, int includeport); int LHNETADDRESS_GetAddressType(const lhnetaddress_t *address); -const char *LHNETADDRESS_GetInterfaceName(const lhnetaddress_t *address); +const char *LHNETADDRESS_GetInterfaceName(const lhnetaddress_t *address, char *ifname, size_t ifnamelength); int LHNETADDRESS_GetPort(const lhnetaddress_t *address); int LHNETADDRESS_SetPort(lhnetaddress_t *address, int port); int LHNETADDRESS_Compare(const lhnetaddress_t *address1, const lhnetaddress_t *address2); @@ -34,12 +37,13 @@ typedef struct lhnetsocket_s { lhnetaddress_t address; int inetsocket; - struct lhnetsocket_s *next, *prev; + llist_t list; } lhnetsocket_t; void LHNET_Init(void); void LHNET_Shutdown(void); +int LHNET_DefaultDSCP(int dscp); // < 0: query; >= 0: set (returns previous value) void LHNET_SleepUntilPacket_Microseconds(int microseconds); lhnetsocket_t *LHNET_OpenSocket_Connectionless(lhnetaddress_t *address); void LHNET_CloseSocket(lhnetsocket_t *lhnetsocket);