aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon/qcommon.h
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-04-04 23:22:22 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-04-04 23:22:22 +0000
commitf4c60f773c1bae0e356090e812d9a619c1cfda85 (patch)
tree7125468e574841a6f996e4bd4bb85602b9195f0d /code/qcommon/qcommon.h
parent774e6430a3655619d690e4eb47fa04a32c4c6bd3 (diff)
downloadioquake3-aero-f4c60f773c1bae0e356090e812d9a619c1cfda85.tar.gz
ioquake3-aero-f4c60f773c1bae0e356090e812d9a619c1cfda85.zip
Basic IPv6 support. Some inspiration from the patches by Lubos Dolezel and JF Tremblay at https://bugzilla.icculus.org/show_bug.cgi?id=2355.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1290 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon/qcommon.h')
-rw-r--r--code/qcommon/qcommon.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h
index 877b655..a50da79 100644
--- a/code/qcommon/qcommon.h
+++ b/code/qcommon/qcommon.h
@@ -136,7 +136,9 @@ typedef enum {
NA_BAD, // an address lookup failed
NA_LOOPBACK,
NA_BROADCAST,
- NA_IP
+ NA_IP,
+ NA_IP6,
+ NA_UNSPEC
} netadrtype_t;
typedef enum {
@@ -144,10 +146,12 @@ typedef enum {
NS_SERVER
} netsrc_t;
+#define NET_ADDRSTRMAXLEN 48 // maximum length of an IPv6 address string including trailing '\0'
typedef struct {
netadrtype_t type;
byte ip[4];
+ byte ip6[16];
unsigned short port;
} netadr_t;
@@ -165,7 +169,8 @@ qboolean NET_CompareAdr (netadr_t a, netadr_t b);
qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b);
qboolean NET_IsLocalAddress (netadr_t adr);
const char *NET_AdrToString (netadr_t a);
-qboolean NET_StringToAdr ( const char *s, netadr_t *a);
+const char *NET_AdrToStringwPort (netadr_t a);
+qboolean NET_StringToAdr ( const char *s, netadr_t *a, netadrtype_t family);
qboolean NET_GetLoopPacket (netsrc_t sock, netadr_t *net_from, msg_t *net_message);
void NET_Sleep(int msec);
@@ -1015,7 +1020,7 @@ void Sys_SetErrorText( const char *text );
void Sys_SendPacket( int length, const void *data, netadr_t to );
qboolean Sys_GetPacket( netadr_t *net_from, msg_t *net_message );
-qboolean Sys_StringToAdr( const char *s, netadr_t *a );
+qboolean Sys_StringToAdr( const char *s, netadr_t *a, netadrtype_t family );
//Does NOT parse port numbers, only base addresses.
qboolean Sys_IsLANAddress (netadr_t adr);