enet.h File Reference
ENet public header file. More...
Go to the source code of this file.
Classes | |
| struct | _ENetAcknowledgement |
| struct | _ENetAddress |
| Portable internet address structure. More... | |
| struct | _ENetChannel |
| struct | _ENetCompressor |
| An ENet packet compressor for compressing UDP packets before socket sends or receives. More... | |
| struct | _ENetEvent |
| An ENet event as returned by enet_host_service(). More... | |
| struct | _ENetHost |
| An ENet host for communicating with peers. More... | |
| struct | _ENetHostAddress |
| struct | _ENetIncomingCommand |
| struct | _ENetOutgoingCommand |
| struct | _ENetPacket |
| ENet packet structure. More... | |
| struct | _ENetPeer |
| An ENet peer which data packets may be sent or received from. More... | |
Defines | |
| #define | ENET_BUFFER_MAXIMUM (1 + 2 * ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS) |
| #define | ENET_HOST_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } |
| specifies the default server host (macro for variable initialization) | |
| #define | ENET_HOST_BROADCAST_INIT { { 0,0,0,0,0,0,0,0,0,0,0xff,0xff,0xff,0xff,0xff,0xff } } |
| specifies a IPv4 subnet-wide broadcast (macro for variable initialization) | |
| #define | ENET_IPV4MAPPED_PREFIX_INIT { { 0,0,0,0,0,0,0,0,0,0,0xff,0xff,0,0,0,0 } } |
| specifies the IPv4-mapped IPv6 prefix (macro for variable initialization) | |
| #define | ENET_VERSION ENET_VERSION_CREATE(ENET_VERSION_MAJOR, ENET_VERSION_MINOR, ENET_VERSION_PATCH) |
| #define | ENET_VERSION_CREATE(major, minor, patch) (((major)<<16) | ((minor)<<8) | (patch)) |
| #define | ENET_VERSION_MAJOR 1 |
| #define | ENET_VERSION_MINOR 3 |
| #define | ENET_VERSION_PATCH 1 |
Typedefs | |
| typedef size_t | bufferCount |
| typedef struct _ENetAcknowledgement | ENetAcknowledgement |
| typedef struct _ENetAddress | ENetAddress |
| Portable internet address structure. | |
| typedef enum _ENetAddressFamily | ENetAddressFamily |
| The address family type. | |
| typedef struct _ENetChannel | ENetChannel |
| typedef struct _ENetCompressor | ENetCompressor |
| An ENet packet compressor for compressing UDP packets before socket sends or receives. | |
| typedef struct _ENetEvent | ENetEvent |
| An ENet event as returned by enet_host_service(). | |
| typedef enum _ENetEventType | ENetEventType |
| An ENet event type, as specified in ENetEvent. | |
| typedef struct _ENetHost | ENetHost |
| An ENet host for communicating with peers. | |
| typedef struct _ENetHostAddress | ENetHostAddress |
| typedef struct _ENetIncomingCommand | ENetIncomingCommand |
| typedef struct _ENetOutgoingCommand | ENetOutgoingCommand |
| typedef struct _ENetPacket | ENetPacket |
| ENet packet structure. | |
| typedef enum _ENetPacketFlag | ENetPacketFlag |
| Packet flag bit constants. | |
| typedef struct _ENetPeer | ENetPeer |
| An ENet peer which data packets may be sent or received from. | |
| typedef enum _ENetPeerState | ENetPeerState |
| typedef enum _ENetSocketOption | ENetSocketOption |
| typedef enum _ENetSocketType | ENetSocketType |
| typedef enum _ENetSocketWait | ENetSocketWait |
| typedef enet_uint32 | ENetVersion |
Enumerations | |
| enum | { ENET_IPV4MAPPED_PREFIX_LEN = 12, ENET_PORT_ANY = 0 } |
| enum | { ENET_HOST_RECEIVE_BUFFER_SIZE = 256 * 1024, ENET_HOST_SEND_BUFFER_SIZE = 256 * 1024, ENET_HOST_BANDWIDTH_THROTTLE_INTERVAL = 1000, ENET_HOST_DEFAULT_MTU = 1400, ENET_PEER_DEFAULT_ROUND_TRIP_TIME = 500, ENET_PEER_DEFAULT_PACKET_THROTTLE = 32, ENET_PEER_PACKET_THROTTLE_SCALE = 32, ENET_PEER_PACKET_THROTTLE_COUNTER = 7, ENET_PEER_PACKET_THROTTLE_ACCELERATION = 2, ENET_PEER_PACKET_THROTTLE_DECELERATION = 2, ENET_PEER_PACKET_THROTTLE_INTERVAL = 5000, ENET_PEER_PACKET_LOSS_SCALE = (1 << 16), ENET_PEER_PACKET_LOSS_INTERVAL = 10000, ENET_PEER_WINDOW_SIZE_SCALE = 64 * 1024, ENET_PEER_TIMEOUT_LIMIT = 32, ENET_PEER_TIMEOUT_MINIMUM = 5000, ENET_PEER_TIMEOUT_MAXIMUM = 30000, ENET_PEER_PING_INTERVAL = 500, ENET_PEER_UNSEQUENCED_WINDOWS = 64, ENET_PEER_UNSEQUENCED_WINDOW_SIZE = 1024, ENET_PEER_FREE_UNSEQUENCED_WINDOWS = 32, ENET_PEER_RELIABLE_WINDOWS = 16, ENET_PEER_RELIABLE_WINDOW_SIZE = 0x1000, ENET_PEER_FREE_RELIABLE_WINDOWS = 8 } |
| enum | _ENetAddressFamily { ENET_NO_ADDRESS_FAMILY = 0, ENET_IPV4 = (1 << 0), ENET_IPV6 = (1 << 1) } |
The address family type. More... | |
| enum | _ENetEventType { ENET_EVENT_TYPE_NONE = 0, ENET_EVENT_TYPE_CONNECT = 1, ENET_EVENT_TYPE_DISCONNECT = 2, ENET_EVENT_TYPE_RECEIVE = 3 } |
An ENet event type, as specified in ENetEvent. More... | |
| enum | _ENetPacketFlag { ENET_PACKET_FLAG_RELIABLE = (1 << 0), ENET_PACKET_FLAG_UNSEQUENCED = (1 << 1), ENET_PACKET_FLAG_NO_ALLOCATE = (1 << 2) } |
Packet flag bit constants. More... | |
| enum | _ENetPeerState { ENET_PEER_STATE_DISCONNECTED = 0, ENET_PEER_STATE_CONNECTING = 1, ENET_PEER_STATE_ACKNOWLEDGING_CONNECT = 2, ENET_PEER_STATE_CONNECTION_PENDING = 3, ENET_PEER_STATE_CONNECTION_SUCCEEDED = 4, ENET_PEER_STATE_CONNECTED = 5, ENET_PEER_STATE_DISCONNECT_LATER = 6, ENET_PEER_STATE_DISCONNECTING = 7, ENET_PEER_STATE_ACKNOWLEDGING_DISCONNECT = 8, ENET_PEER_STATE_ZOMBIE = 9 } |
| enum | _ENetSocketOption { ENET_SOCKOPT_NONBLOCK = 1, ENET_SOCKOPT_BROADCAST = 2, ENET_SOCKOPT_RCVBUF = 3, ENET_SOCKOPT_SNDBUF = 4, ENET_SOCKOPT_REUSEADDR = 5 } |
| enum | _ENetSocketType { ENET_SOCKET_TYPE_STREAM = 1, ENET_SOCKET_TYPE_DATAGRAM = 2 } |
| enum | _ENetSocketWait { ENET_SOCKET_WAIT_NONE = 0, ENET_SOCKET_WAIT_SEND = (1 << 0), ENET_SOCKET_WAIT_RECEIVE = (1 << 1) } |
Functions | |
| ENET_API int | enet_address_get_host (const ENetAddress *address, char *hostName, size_t nameLength) |
| Attempts to do a reverse lookup of the host field in the address parameter. | |
| ENET_API int | enet_address_get_host_ip (const ENetAddress *address, char *hostName, size_t nameLength) |
| Gives the printable form of the ip address specified in the address parameter. | |
| ENET_API ENetHostAddress | enet_address_map4 (enet_uint32 address) |
| Maps an IPv4 Address to an IPv6 address. | |
| ENET_API int | enet_address_set_host (ENetAddress *address, const char *hostName) |
| Attempts to resolve the host named by the parameter hostName and sets the host field in the address parameter if successful. | |
| enet_uint32 | enet_crc32 (const ENetBuffer *, size_t) |
| ENET_API void | enet_deinitialize (void) |
| Shuts down ENet globally. | |
| ENET_API ENetAddressFamily | enet_get_address_family (const ENetAddress *address) |
| Returns the Address family of an (IPv4-mapped) IPv6 address. | |
| ENET_API void | enet_host_bandwidth_limit (ENetHost *, enet_uint32, enet_uint32) |
| Adjusts the bandwidth limits of a host. | |
| void | enet_host_bandwidth_throttle (ENetHost *) |
| ENET_API void | enet_host_broadcast (ENetHost *, enet_uint8, ENetPacket *) |
| Queues a packet to be sent to all peers associated with the host. | |
| ENET_API void | enet_host_channel_limit (ENetHost *, size_t) |
| Limits the maximum allowed channels of future incoming connections. | |
| ENET_API int | enet_host_check_events (ENetHost *, ENetEvent *) |
| Checks for any queued events on the host and dispatches one if available. | |
| ENET_API void | enet_host_compress (ENetHost *, const ENetCompressor *) |
| Sets the packet compressor the host should use to compress and decompress packets. | |
| ENET_API int | enet_host_compress_with_range_coder (ENetHost *host) |
| Sets the packet compressor the host should use to the default range coder. | |
| ENET_API ENetPeer * | enet_host_connect (ENetHost *, const ENetAddress *, size_t, enet_uint32) |
| Initiates a connection to a foreign host. | |
| ENET_API ENetHost * | enet_host_create (const ENetAddress *, size_t, size_t, enet_uint32, enet_uint32) |
| Creates a host for communicating to peers. | |
| ENET_API void | enet_host_destroy (ENetHost *) |
| Destroys the host and all resources associated with it. | |
| ENET_API void | enet_host_flush (ENetHost *) |
| Sends any queued packets on the host specified to its designated peers. | |
| ENET_API int | enet_host_service (ENetHost *, ENetEvent *, enet_uint32) |
| Waits for events on the host specified and shuttles packets between the host and its peers. | |
| ENET_API int | enet_initialize (void) |
| Initializes ENet globally. | |
| ENET_API int | enet_initialize_with_callbacks (ENetVersion version, const ENetCallbacks *inits) |
| Initializes ENet globally and supplies user-overridden callbacks. | |
| ENET_API ENetPacket * | enet_packet_create (const void *, size_t, enet_uint32) |
| Creates a packet that may be sent to a peer. | |
| ENET_API void | enet_packet_destroy (ENetPacket *) |
| Destroys the packet and deallocates its data. | |
| ENET_API int | enet_packet_resize (ENetPacket *, size_t) |
| Attempts to resize the data in the packet to length specified in the dataLength parameter. | |
| ENET_API void | enet_peer_disconnect (ENetPeer *, enet_uint32) |
| Request a disconnection from a peer. | |
| ENET_API void | enet_peer_disconnect_later (ENetPeer *, enet_uint32) |
| Request a disconnection from a peer, but only after all queued outgoing packets are sent. | |
| ENET_API void | enet_peer_disconnect_now (ENetPeer *, enet_uint32) |
| Force an immediate disconnection from a peer. | |
| void | enet_peer_dispatch_incoming_reliable_commands (ENetPeer *, ENetChannel *) |
| void | enet_peer_dispatch_incoming_unreliable_commands (ENetPeer *, ENetChannel *) |
| ENET_API void | enet_peer_ping (ENetPeer *) |
| Sends a ping request to a peer. | |
| ENetAcknowledgement * | enet_peer_queue_acknowledgement (ENetPeer *, const ENetProtocol *, enet_uint16) |
| ENetIncomingCommand * | enet_peer_queue_incoming_command (ENetPeer *, const ENetProtocol *, ENetPacket *, enet_uint32) |
| ENetOutgoingCommand * | enet_peer_queue_outgoing_command (ENetPeer *, const ENetProtocol *, ENetPacket *, enet_uint32, enet_uint16) |
| ENET_API ENetPacket * | enet_peer_receive (ENetPeer *, enet_uint8 *channelID) |
| Attempts to dequeue any incoming queued packet. | |
| ENET_API void | enet_peer_reset (ENetPeer *) |
| Forcefully disconnects a peer. | |
| void | enet_peer_reset_queues (ENetPeer *) |
| ENET_API int | enet_peer_send (ENetPeer *, enet_uint8, ENetPacket *) |
| Queues a packet to be sent. | |
| void | enet_peer_setup_outgoing_command (ENetPeer *, ENetOutgoingCommand *) |
| int | enet_peer_throttle (ENetPeer *, enet_uint32) |
| ENET_API void | enet_peer_throttle_configure (ENetPeer *, enet_uint32, enet_uint32, enet_uint32) |
| Configures throttle parameter for a peer. | |
| size_t | enet_protocol_command_size (enet_uint8) |
| ENET_API size_t | enet_range_coder_compress (void *, const ENetBuffer *, size_t, size_t, enet_uint8 *, size_t) |
| ENET_API void * | enet_range_coder_create (void) |
| ENET_API size_t | enet_range_coder_decompress (void *, const enet_uint8 *, size_t, enet_uint8 *, size_t) |
| ENET_API void | enet_range_coder_destroy (void *) |
| ENET_API ENetSocket | enet_socket_accept (ENetSocket, ENetAddress *, ENetAddressFamily) |
| ENET_API int | enet_socket_bind (ENetSocket, const ENetAddress *, ENetAddressFamily) |
| ENET_API int | enet_socket_connect (ENetSocket, const ENetAddress *, ENetAddressFamily) |
| ENET_API ENetSocket | enet_socket_create (ENetSocketType, ENetAddressFamily) |
| ENET_API void | enet_socket_destroy (ENetSocket) |
| ENET_API int | enet_socket_listen (ENetSocket, int) |
| ENET_API int | enet_socket_receive (ENetSocket, ENetAddress *, ENetBuffer *, size_t, ENetAddressFamily) |
| ENET_API int | enet_socket_send (ENetSocket, const ENetAddress *, const ENetBuffer *, size_t, ENetAddressFamily) |
| ENET_API int | enet_socket_set_option (ENetSocket, ENetSocketOption, int) |
| ENET_API int | enet_socket_wait (ENetSocket, ENetSocket, enet_uint32 *, enet_uint32) |
| ENET_API int | enet_socketset_select (ENetSocket, ENetSocketSet *, ENetSocketSet *, enet_uint32) |
| ENET_API enet_uint32 | enet_time_get (void) |
| Returns the wall-time in milliseconds. | |
| ENET_API void | enet_time_set (enet_uint32) |
| Sets the current wall-time in milliseconds. | |
| typedef | enet_uint32 (ENET_CALLBACK *ENetChecksumCallback)(const ENetBuffer *buffers |
| Callback that computes the checksum of the data held in buffers[0:bufferCount-1]. | |
| typedef | void (ENET_CALLBACK *ENetPacketFreeCallback)(struct _ENetPacket *) |
Variables | |
| static const ENetHostAddress | ENET_HOST_ANY = ENET_HOST_ANY_INIT |
| specifies the default server host (global constant variable) | |
| static const ENetHostAddress | ENET_HOST_BROADCAST = ENET_HOST_BROADCAST_INIT |
| specifies a IPv4 subnet-wide broadcast (global constant variable) | |
| static const ENetHostAddress | ENET_IPV4MAPPED_PREFIX = ENET_IPV4MAPPED_PREFIX_INIT |
| specifies the IPv4-mapped IPv6 prefix (global constant variable) | |
Detailed Description
ENet public header file.
Define Documentation
| #define ENET_BUFFER_MAXIMUM (1 + 2 * ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS) |
| #define ENET_HOST_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } |
specifies the default server host (macro for variable initialization)
| #define ENET_HOST_BROADCAST_INIT { { 0,0,0,0,0,0,0,0,0,0,0xff,0xff,0xff,0xff,0xff,0xff } } |
specifies a IPv4 subnet-wide broadcast (macro for variable initialization)
| #define ENET_IPV4MAPPED_PREFIX_INIT { { 0,0,0,0,0,0,0,0,0,0,0xff,0xff,0,0,0,0 } } |
specifies the IPv4-mapped IPv6 prefix (macro for variable initialization)
| #define ENET_VERSION ENET_VERSION_CREATE(ENET_VERSION_MAJOR, ENET_VERSION_MINOR, ENET_VERSION_PATCH) |
| #define ENET_VERSION_CREATE | ( | major, | |||
| minor, | |||||
| patch | ) | (((major)<<16) | ((minor)<<8) | (patch)) |
| #define ENET_VERSION_MAJOR 1 |
| #define ENET_VERSION_MINOR 3 |
| #define ENET_VERSION_PATCH 1 |
Typedef Documentation
| typedef size_t bufferCount |
| typedef struct _ENetAcknowledgement ENetAcknowledgement |
| typedef struct _ENetAddress ENetAddress |
Portable internet address structure.
The host must be specified in network byte-order, and the port must be in host byte-order. The constant ENET_HOST_ANY may be used to specify the default server host. The constant ENET_HOST_BROADCAST may be used to specify the broadcast address (255.255.255.255). This makes sense for enet_host_connect, but not for enet_host_create. Once a server responds to a broadcast, the address is updated from ENET_HOST_BROADCAST to the server's actual IP address.
| typedef enum _ENetAddressFamily ENetAddressFamily |
The address family type.
| typedef struct _ENetChannel ENetChannel |
| typedef struct _ENetCompressor ENetCompressor |
An ENet packet compressor for compressing UDP packets before socket sends or receives.
| typedef struct _ENetEvent ENetEvent |
An ENet event as returned by enet_host_service().
- See also:
- enet_host_service
| typedef enum _ENetEventType ENetEventType |
An ENet event type, as specified in ENetEvent.
An ENet host for communicating with peers.
No fields should be modified unless otherwise stated.
| typedef struct _ENetHostAddress ENetHostAddress |
| typedef struct _ENetIncomingCommand ENetIncomingCommand |
| typedef struct _ENetOutgoingCommand ENetOutgoingCommand |
| typedef struct _ENetPacket ENetPacket |
ENet packet structure.
An ENet data packet that may be sent to or received from a peer. The shown fields should only be read and never modified. The data field contains the allocated data for the packet. The dataLength fields specifies the length of the allocated data. The flags field is either 0 (specifying no flags), or a bitwise-or of any combination of the following flags:
ENET_PACKET_FLAG_RELIABLE - packet must be received by the target peer and resend attempts should be made until the packet is delivered
ENET_PACKET_FLAG_UNSEQUENCED - packet will not be sequenced with other packets (not supported for reliable packets)
ENET_PACKET_FLAG_NO_ALLOCATE - packet will not allocate data, and user must supply it instead
- See also:
- ENetPacketFlag
| typedef enum _ENetPacketFlag ENetPacketFlag |
Packet flag bit constants.
The host must be specified in network byte-order, and the port must be in host byte-order. The constant ENET_HOST_ANY may be used to specify the default server host.
- See also:
- ENetPacket
An ENet peer which data packets may be sent or received from.
No fields should be modified unless otherwise specified.
| typedef enum _ENetPeerState ENetPeerState |
| typedef enum _ENetSocketOption ENetSocketOption |
| typedef enum _ENetSocketType ENetSocketType |
| typedef enum _ENetSocketWait ENetSocketWait |
| typedef enet_uint32 ENetVersion |
Enumeration Type Documentation
| anonymous enum |
| anonymous enum |
- Enumerator:
| enum _ENetAddressFamily |
| enum _ENetEventType |
An ENet event type, as specified in ENetEvent.
- Enumerator:
| enum _ENetPacketFlag |
Packet flag bit constants.
The host must be specified in network byte-order, and the port must be in host byte-order. The constant ENET_HOST_ANY may be used to specify the default server host.
- See also:
- ENetPacket
- Enumerator:
| enum _ENetPeerState |
- Enumerator:
| enum _ENetSocketOption |
| enum _ENetSocketType |
| enum _ENetSocketWait |
Function Documentation
| size_t enet_protocol_command_size | ( | enet_uint8 | ) |
| ENET_API size_t enet_range_coder_compress | ( | void * | , | |
| const ENetBuffer * | , | |||
| size_t | , | |||
| size_t | , | |||
| enet_uint8 * | , | |||
| size_t | ||||
| ) |
| ENET_API void* enet_range_coder_create | ( | void | ) |
| ENET_API size_t enet_range_coder_decompress | ( | void * | , | |
| const enet_uint8 * | , | |||
| size_t | , | |||
| enet_uint8 * | , | |||
| size_t | ||||
| ) |
| ENET_API void enet_range_coder_destroy | ( | void * | ) |
| ENET_API enet_uint32 enet_time_get | ( | void | ) |
Returns the wall-time in milliseconds.
Its initial value is unspecified unless otherwise set.
| ENET_API void enet_time_set | ( | enet_uint32 | ) |
Sets the current wall-time in milliseconds.
| typedef enet_uint32 | ( | ENET_CALLBACK * | ENetChecksumCallback | ) | const |
Callback that computes the checksum of the data held in buffers[0:bufferCount-1].
| typedef void | ( | ENET_CALLBACK * | ENetPacketFreeCallback | ) |
Variable Documentation
const ENetHostAddress ENET_HOST_ANY = ENET_HOST_ANY_INIT [static] |
specifies the default server host (global constant variable)
const ENetHostAddress ENET_HOST_BROADCAST = ENET_HOST_BROADCAST_INIT [static] |
specifies a IPv4 subnet-wide broadcast (global constant variable)
const ENetHostAddress ENET_IPV4MAPPED_PREFIX = ENET_IPV4MAPPED_PREFIX_INIT [static] |
specifies the IPv4-mapped IPv6 prefix (global constant variable)
Generated on Sun May 19 06:45:42 2013 for Orxonox by
1.6.3








