Changeset 7377 for code/branches/ipv6/src/external/enet/include
- Timestamp:
- Sep 8, 2010, 4:08:09 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ipv6/src/external/enet/include/enet/enet.h
r7330 r7377 51 51 ENET_SOCKOPT_RCVBUF = 3, 52 52 ENET_SOCKOPT_SNDBUF = 4, 53 ENET_SOCKOPT_REUSEADDR = 5, 54 ENET_SOCKOPT_V6ONLY = 6 53 ENET_SOCKOPT_REUSEADDR = 5 55 54 } ENetSocketOption; 56 55 … … 60 59 } ENetHostAddress; 61 60 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 */ 61 extern const ENetHostAddress ENET_HOST_ANY; /**< specifies the default server host */ 62 extern const ENetHostAddress ENET_IPV4MAPPED_PREFIX; /**< specifies the IPv4-mapped IPv6 prefix */ 63 extern const ENetHostAddress ENET_HOST_BROADCAST; /**< specifies a IPv4 subnet-wide broadcast */ 64 #define ENET_IPV4MAPPED_PREFIX_LEN 12 /**< specifies the length of the IPv4-mapped IPv6 prefix */ 65 #define ENET_PORT_ANY 0 /**< specifies that a port should be automatically chosen */ 65 66 66 67 /** … … 80 81 enet_uint16 port; 81 82 } ENetAddress; 83 84 /** 85 * The address family type. 86 */ 87 typedef enum _ENetAddressFamily 88 { 89 ENET_NO_ADDRESS_FAMILY = 0, 90 ENET_IPV4 = 1, 91 ENET_IPV6 = 2 92 } ENetAddressFamily; 82 93 83 94 /** … … 325 336 typedef struct _ENetHost 326 337 { 327 ENetSocket socket; 338 ENetSocket socket4; 339 ENetSocket socket6; 328 340 ENetAddress address; /**< Internet address of the host */ 329 341 enet_uint32 incomingBandwidth; /**< downstream bandwidth of the host */ … … 445 457 @{ 446 458 */ 447 ENET_API ENetSocket enet_socket_create (ENetSocketType );448 ENET_API int enet_socket_bind (ENetSocket, const ENetAddress * );459 ENET_API ENetSocket enet_socket_create (ENetSocketType, ENetAddressFamily); 460 ENET_API int enet_socket_bind (ENetSocket, const ENetAddress *, ENetAddressFamily); 449 461 ENET_API int enet_socket_listen (ENetSocket, int); 450 ENET_API ENetSocket enet_socket_accept (ENetSocket, ENetAddress * );451 ENET_API int enet_socket_connect (ENetSocket, const ENetAddress * );452 ENET_API int enet_socket_send (ENetSocket, const ENetAddress *, const ENetBuffer *, size_t );453 ENET_API int enet_socket_receive (ENetSocket, ENetAddress *, ENetBuffer *, size_t );454 ENET_API int enet_socket_wait (ENetSocket, enet_uint32 *, enet_uint32);462 ENET_API ENetSocket enet_socket_accept (ENetSocket, ENetAddress *, ENetAddressFamily); 463 ENET_API int enet_socket_connect (ENetSocket, const ENetAddress *, ENetAddressFamily); 464 ENET_API int enet_socket_send (ENetSocket, const ENetAddress *, const ENetBuffer *, size_t, ENetAddressFamily); 465 ENET_API int enet_socket_receive (ENetSocket, ENetAddress *, ENetBuffer *, size_t, ENetAddressFamily); 466 ENET_API int enet_socket_wait (ENetSocket, ENetSocket, enet_uint32 *, enet_uint32); 455 467 ENET_API int enet_socket_set_option (ENetSocket, ENetSocketOption, int); 456 468 ENET_API void enet_socket_destroy (ENetSocket); … … 496 508 @returns the IPv4-mapped IPv6 address in network byte order 497 509 */ 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 } 510 ENET_API ENetHostAddress enet_address_map4 (enet_uint32 address); 511 512 /** Returns the Address family of an (IPv4-mapped) IPv6 address. 513 @param address IPv6 address 514 @returns address family 515 */ 516 ENET_API ENetAddressFamily enet_get_address_family (const ENetAddress * address); 505 517 506 518 /** @} */
Note: See TracChangeset
for help on using the changeset viewer.