Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4755 → Rev 4756

/branches/network/uspace/srv/net/structures/packet/packet_client.h
52,8 → 52,8
 
/** Allocates the specified type right before the actual packet content and returns its pointer.
* The wrapper of the packet_prepend() function.
* @param packet The packet to be used. Input parameter.
* @param type The type to be allocated at the beginning of the packet content. Input parameter.
* @param[in] packet The packet to be used.
* @param[in] type The type to be allocated at the beginning of the packet content.
* @returns The typed pointer to the allocated memory.
* @returns NULL if the packet is not valid.
* @returns NULL if there is not enough memory left.
62,8 → 62,8
 
/** Allocates the specified type right after the actual packet content and returns its pointer.
* The wrapper of the packet_append() function.
* @param packet The packet to be used. Input parameter.
* @param type The type to be allocated at the end of the packet content. Input parameter.
* @param[in] packet The packet to be used.
* @param[in] type The type to be allocated at the end of the packet content.
* @returns The typed pointer to the allocated memory.
* @returns NULL if the packet is not valid.
* @returns NULL if there is not enough memory left.
72,9 → 72,9
 
/** Trims the actual packet content by the specified prefix and suffix types.
* The wrapper of the packet_trim() function.
* @param packet The packet to be trimmed. Input parameter.
* @param prefix The type of the prefix to be removed from the beginning of the packet content. Input parameter.
* @param suffix The type of the suffix to be removed from the end of the packet content. Input parameter.
* @param[in] packet The packet to be trimmed.
* @param[in] prefix The type of the prefix to be removed from the beginning of the packet content.
* @param[in] suffix The type of the suffix to be removed from the end of the packet content.
* @returns EOK on success.
* @returns EINVAL if the packet is not valid.
* @returns ENOMEM if there is not enough memory left.
82,8 → 82,8
#define PACKET_TRIM( packet, prefix, suffix ) packet_trim(( packet ), sizeof( prefix ), sizeof( suffix ))
 
/** Allocates the specified space right before the actual packet content and returns its pointer.
* @param packet The packet to be used. Input parameter.
* @param length The space length to be allocated at the beginning of the packet content. Input parameter.
* @param[in] packet The packet to be used.
* @param[in] length The space length to be allocated at the beginning of the packet content.
* @returns The pointer to the allocated memory.
* @returns NULL if there is not enough memory left.
*/
90,8 → 90,8
void * packet_prefix( packet_t packet, size_t length );
 
/** Allocates the specified space right after the actual packet content and returns its pointer.
* @param packet The packet to be used. Input parameter.
* @param length The space length to be allocated at the end of the packet content. Input parameter.
* @param[in] packet The packet to be used.
* @param[in] length The space length to be allocated at the end of the packet content.
* @returns The pointer to the allocated memory.
* @returns NULL if there is not enough memory left.
*/
98,9 → 98,9
void * packet_suffix( packet_t packet, size_t length );
 
/** Trims the actual packet content by the specified prefix and suffix lengths.
* @param packet The packet to be trimmed. Input parameter.
* @param prefix The prefix length to be removed from the beginning of the packet content. Input parameter.
* @param suffix The suffix length to be removed from the end of the packet content. Input parameter.
* @param[in] packet The packet to be trimmed.
* @param[in] prefix The prefix length to be removed from the beginning of the packet content.
* @param[in] suffix The suffix length to be removed from the end of the packet content.
* @returns EOK on success.
* @returns EINVAL if the packet is not valid.
* @returns ENOMEM if there is not enough memory left.
109,9 → 109,9
 
/** 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.
* @param data The data to be copied. Input parameter.
* @param length The length of the copied data. Input parameter.
* @param[in] packet The packet to be filled.
* @param[in] data The data to be copied.
* @param[in] length The length of the copied data.
* @returns EOK on success.
* @returns EINVAL if the packet is not valid.
* @returns ENOMEM if there is not enough memory left.
119,7 → 119,7
int packet_copy_data( packet_t packet, const void * data, size_t length );
 
/** Returns the packet identifier.
* @param packet The packet. Input parameter.
* @param[in] packet The packet.
* @returns The packet identifier.
* @returns Zero (0) if the packet is not valid.
*/
126,7 → 126,7
packet_id_t packet_get_id( const packet_t packet );
 
/** Returns the packet content length.
* @param packet The packet. Input parameter.
* @param[in] packet The packet.
* @returns The packet content length in bytes.
* @returns Zero (0) if the packet is not valid.
*/
133,7 → 133,7
size_t packet_get_data_length( const packet_t packet );
 
/** Returns the pointer to the beginning of the packet content.
* @param packet The packet. Input parameter.
* @param[in] packet The packet.
* @returns The pointer to the beginning of the packet content.
* @returns NULL if the packet is not valid.
*/
140,9 → 140,9
void * packet_get_data( const packet_t packet );
 
/** Returns the stored packet addresses and their length.
* @param packet The packet. Input parameter.
* @param src The source address. May be NULL if not desired. Output parameter.
* @param dest The destination address. May be NULL if not desired. Output parameter.
* @param[in] packet The packet.
* @param[out] src The source address. May be NULL if not desired.
* @param[out] dest The destination address. May be NULL if not desired.
* @returns The stored addresses length.
* @returns Zero (0) if the addresses are not present.
* @returns EINVAL if the packet is not valid.
150,10 → 150,10
int packet_get_addr( const packet_t packet, uint8_t ** src, uint8_t ** dest );
 
/** Sets the packet addresses.
* @param packet The packet. Input parameter.
* @param src The new source address. May be NULL. Input parameter.
* @param dest The new destination address. May be NULL. Input parameter.
* @param addr_len The addresses length.
* @param[in] packet The packet.
* @param[in] src The new source address. May be NULL.
* @param[in] dest The new destination address. May be NULL.
* @param[in] addr_len The addresses length.
* @returns EOK on success.
* @returns EINVAL if the packet is not valid.
* @returns ENOMEM if there is not enough memory left.
163,9 → 163,9
/** 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.
* @param phone The packet server module phone. Input parameter.
* @param packet The packet reference. Output parameter.
* @param packet_id The packet identifier. Input parameter.
* @param[in] phone The packet server module phone.
* @param[out] packet The packet reference.
* @param[in] packet_id The packet identifier.
* @returns EOK on success.
* @returns EINVAL if the packet parameter is NULL.
* @returns Other error codes as defined for the NET_PACKET_GET_SIZE message.
175,11 → 175,11
 
/** 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 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.
* @param max_suffix The maximal suffix length in bytes. Input parameter.
* @param[in] phone The packet server module phone.
* @param[in] addr_len The source and destination addresses maximal length in bytes.
* @param[in] max_prefix The maximal prefix length in bytes.
* @param[in] max_content The maximal content length in bytes.
* @param[in] max_suffix The maximal suffix length in bytes.
* @returns The packet reference.
* @returns NULL on error.
*/
187,8 → 187,8
 
/** 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 content The maximal content length in bytes. Input parameter.
* @param[in] phone The packet server module phone.
* @param[in] content The maximal content length in bytes.
* @returns The packet reference.
* @returns NULL on error.
*/
198,12 → 198,18
* All packets in the queue are marked as free for use.
* The packet queue may be one packet only.
* The module should not use the packets after this point until they are received or obtained again.
* @param phone The packet server module phone. Input parameter.
* @param packet_id The packet identifier. Input parameter.
* @param[in] phone The packet server module phone.
* @param[in] packet_id The packet identifier.
*/
void pq_release( int phone, packet_id_t packet_id );
 
/** \todo
/** Returns the packet copy.
* Copies the addresses, data, order and metric values.
* Does not copy the queue placement.
* @param[in] phone The packet server module phone.
* @param[in] packet The original packet.
* @returns The packet copy.
* @returns NULL on error.
*/
packet_t packet_get_copy( int phone, packet_t packet );