enet  v1.3.12
reliable UDP networking library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ENet packet functions

Functions

enet_uint32 enet_crc32 (const ENetBuffer *buffers, size_t bufferCount)
 
ENetPacketenet_packet_create (const void *data, size_t dataLength, enet_uint32 flags)
 Creates a packet that may be sent to a peer. More...
 
void enet_packet_destroy (ENetPacket *packet)
 Destroys the packet and deallocates its data. More...
 
int enet_packet_resize (ENetPacket *packet, size_t dataLength)
 Attempts to resize the data in the packet to length specified in the dataLength parameter. More...
 

Detailed Description

Function Documentation

enet_uint32 enet_crc32 ( const ENetBuffer buffers,
size_t  bufferCount 
)

#include <packet.c>

References ENET_HOST_TO_NET_32.

ENetPacket* enet_packet_create ( const void data,
size_t  dataLength,
enet_uint32  flags 
)

#include <packet.c>

Creates a packet that may be sent to a peer.

Parameters
datainitial contents of the packet's data; the packet's data will remain uninitialized if data is NULL.
dataLengthsize of the data allocated for this packet
flagsflags for this packet as described for the ENetPacket structure.
Returns
the packet on success, NULL on failure

References enet_free(), enet_malloc(), and ENET_PACKET_FLAG_NO_ALLOCATE.

Referenced by enet_peer_queue_incoming_command().

Here is the call graph for this function:

Here is the caller graph for this function:

void enet_packet_destroy ( ENetPacket packet)

#include <packet.c>

Destroys the packet and deallocates its data.

Parameters
packetpacket to be destroyed

References enet_free(), and ENET_PACKET_FLAG_NO_ALLOCATE.

Referenced by enet_host_broadcast(), and enet_peer_queue_incoming_command().

Here is the call graph for this function:

Here is the caller graph for this function:

int enet_packet_resize ( ENetPacket packet,
size_t  dataLength 
)

#include <packet.c>

Attempts to resize the data in the packet to length specified in the dataLength parameter.

Parameters
packetpacket to resize
dataLengthnew size for the packet data
Returns
0 on success, < 0 on failure

References enet_free(), enet_malloc(), and ENET_PACKET_FLAG_NO_ALLOCATE.

Here is the call graph for this function: