Changeset 7330 for code/branches/ipv6/src/external/enet/include
- Timestamp:
- Sep 3, 2010, 12:28:21 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ipv6/src/external/enet/include/enet/enet.h
r7328 r7330 51 51 ENET_SOCKOPT_RCVBUF = 3, 52 52 ENET_SOCKOPT_SNDBUF = 4, 53 ENET_SOCKOPT_REUSEADDR = 5 53 ENET_SOCKOPT_REUSEADDR = 5, 54 ENET_SOCKOPT_V6ONLY = 6 54 55 } ENetSocketOption; 55 56 56 enum 57 { 58 ENET_HOST_ANY = 0, /**< specifies the default server host */ 59 ENET_HOST_BROADCAST = 0xFFFFFFFF, /**< specifies a subnet-wide broadcast */ 60 61 ENET_PORT_ANY = 0 /**< specifies that a port should be automatically chosen */ 62 }; 57 typedef struct _ENetHostAddress 58 { 59 enet_uint8 addr[16]; 60 } ENetHostAddress; 61 62 extern const ENetHostAddress ENET_HOST_ANY; /**< specifies the default server host */ 63 extern const ENetHostAddress ENET_HOST_BROADCAST; /**< specifies a IPv4 subnet-wide broadcast */ 64 #define ENET_PORT_ANY 0 /**< specifies that a port should be automatically chosen */ 63 65 64 66 /** … … 74 76 typedef struct _ENetAddress 75 77 { 76 enet_uint32 host; 78 ENetHostAddress host; 79 enet_uint32 scopeID; //FIXME: this is of different size on Windows 77 80 enet_uint16 port; 78 81 } ENetAddress; … … 489 492 ENET_API int enet_address_get_host (const ENetAddress * address, char * hostName, size_t nameLength); 490 493 494 /** Maps an IPv4 Address to an IPv6 address. 495 @param address IPv4 address in network byte order 496 @returns the IPv4-mapped IPv6 address in network byte order 497 */ 498 static inline ENetHostAddress enet_address_map4 (enet_uint32 address) 499 { 500 ENetHostAddress addr = ENET_HOST_ANY; 501 ((enet_uint16 *)addr.addr)[5] = 0xffff; 502 ((enet_uint32 *)addr.addr)[3] = address; 503 return addr; 504 } 505 491 506 /** @} */ 492 507
Note: See TracChangeset
for help on using the changeset viewer.