54,7 → 54,7 |
* @returns NULL if the packet is not valid. |
* @returns NULL if there is not enough memory left. |
*/ |
#define PACKET_PREFIX( packet, type ) ( type * ) packet_prepend(( packet ), sizeof( type )) |
#define PACKET_PREFIX( packet, type ) ( type * ) packet_prefix(( packet ), sizeof( type )) |
|
/** Allocates the specified type right after the actual packet content and returns its pointer. |
* The wrapper of the packet_append() function. |
64,7 → 64,7 |
* @returns NULL if the packet is not valid. |
* @returns NULL if there is not enough memory left. |
*/ |
#define PACKET_SUFFIX( packet, type ) ( type * ) packet_append(( packet ), sizeof( type )) |
#define PACKET_SUFFIX( packet, type ) ( type * ) packet_suffix(( packet ), sizeof( type )) |
|
/** Trims the actual packet content by the specified prefix and suffix types. |
* The wrapper of the packet_trim() function. |
103,18 → 103,6 |
*/ |
int packet_trim( packet_t packet, size_t prefix, size_t suffix ); |
|
/** Copies the packet content. |
* Obtains the new packet from the packet server. |
* @param phone The packet server module phone. Input parameter. |
* @param owner The owner of the new packet. Input parameter. |
* @param packet The packet reference. Input parameter. |
* @returns The packet copy. |
* @returns NULL if the source packet ids not valid. |
* @returns NULL on error. |
* \todo other error? |
*/ |
packet_t packet_copy( int phone, services_t owner, const packet_t packet ); |
|
/** Copies the specified data to the beginning of the actual packet content. |
* Pushes the content end if needed. |
* @param packet The packet to be filled. Input parameter. |
158,13 → 146,6 |
*/ |
int packet_get_addr( const packet_t packet, uint8_t ** src, uint8_t ** dest ); |
|
/** Returns the packet operation mode. |
* @param packet The packet. Input parameter. |
* @returns The packet operation mode. |
* @see packet_mode |
*/ |
packet_mode_t packet_get_mode( const packet_t packet ); |
|
/** Sets the packet addresses. |
* @param packet The packet. Input parameter. |
* @param src The new source address. Output parameter. |
176,23 → 157,6 |
*/ |
int packet_set_addr( packet_t packet, const uint8_t * src, const uint8_t * dest, size_t addr_len ); |
|
/** Sets the packet operation mode. |
* @param packet The packet. Input parameter. |
* @param mode The new packet operation mode. Input parameter. |
* @returns EOK on success. |
* @returns EINVAL if the packet is not valid. |
* @see packet_mode |
*/ |
int packet_set_mode( packet_t packet, packet_mode_t mode ); |
|
/** Sets the packet owner. |
* @param packet The packet. Input parameter. |
* @param owner The new packet owner. Input parameter. |
* @returns EOK on success. |
* @returns EINVAL if the packet is not valid. |
*/ |
int packet_set_owner( packet_t packet, services_t owner ); |
|
/** Translates the packet identifier to the packet reference. |
* Tries to find mapping first. |
* Contacts the packet server to share the packet if the mapping is not present. |
209,7 → 173,6 |
/** Obtains the packet of the given dimensions. |
* Contacts the packet server to return the appropriate packet. |
* @param phone The packet server module phone. Input parameter. |
* @param owner The owner of the new packet. Input parameter. |
* @param addr_len The source and destination addresses maximal length in bytes. Input parameter. |
* @param max_prefix The maximal prefix length in bytes. Input parameter. |
* @param max_content The maximal content length in bytes. Input parameter. |
216,20 → 179,19 |
* @param max_suffix The maximal suffix length in bytes. Input parameter. |
* @returns The packet reference. |
* @returns NULL on error. |
* \todo error as NET_PACKET_CREATE_5, packet_return() |
* \todo error as NET_PACKET_CREATE_4, packet_return() |
*/ |
packet_t packet_get_5( int phone, services_t owner, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix ); |
packet_t packet_get_4( int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix ); |
|
/** Obtains the packet of the given content size. |
* Contacts the packet server to return the appropriate packet. |
* @param phone The packet server module phone. Input parameter. |
* @param owner The owner of the new packet. Input parameter. |
* @param content The maximal content length in bytes. Input parameter. |
* @returns The packet reference. |
* @returns NULL on error. |
* \todo error as NET_PACKET_CREATE_1, packet_return() |
*/ |
packet_t packet_get_1( int phone, services_t owner, size_t content ); |
packet_t packet_get_1( int phone, size_t content ); |
|
/** Releases the packet. |
* The packet is marked as free for use. |