Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4755 → Rev 4756

/branches/network/uspace/srv/net/structures/measured_strings.c
48,8 → 48,8
#include "measured_strings.h"
 
/** Computes the lengths of the measured strings in the given array.
* @param strings The measured strings array to be processed. Input parameter.
* @param count The measured strings array size. Input parameter.
* @param[in] strings The measured strings array to be processed.
* @param[in] count The measured strings array size.
* @returns The computed sizes array.
* @returns NULL if there is not enough memory left.
*/
/branches/network/uspace/srv/net/structures/char_map.h
77,10 → 77,10
};
 
/** Adds the value with the key to the map.
* @param map The character string to integer map. Input/output parameter.
* @param identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found. Input parameter.
* @param length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found. Input parameter.
* @param value The integral value to be stored for the key character string. Input parameter.
* @param[in,out] map The character string to integer map.
* @param[in] identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found.
* @param[in] length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found.
* @param[in] value The integral value to be stored for the key character string.
* @returns EOK on success.
* @returns EINVAL if the map is not valid.
* @returns EINVAL if the identifier parameter is NULL.
91,15 → 91,15
int char_map_add( char_map_ref map, const char * identifier, size_t length, const int value );
 
/** Clears and destroys the map.
* @param map The character string to integer map. Input/output parameter.
* @param[in,out] map The character string to integer map.
*/
void char_map_destroy( char_map_ref map );
 
/** Excludes the value assigned to the key from the map.
* The entry is cleared from the map.
* @param map The character string to integer map. Input/output parameter.
* @param identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found. Input parameter.
* @param length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found. Input parameter.
* @param[in,out] map The character string to integer map.
* @param[in] identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found.
* @param[in] length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found.
* @returns The integral value assigned to the key character string.
* @returns CHAR_MAP_NULL if the key is not assigned a value.
*/
106,9 → 106,9
int char_map_exclude( char_map_ref map, const char * identifier, size_t length );
 
/** Returns the value assigned to the key from the map.
* @param map The character string to integer map. Input parameter.
* @param identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found. Input parameter.
* @param length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found. Input parameter.
* @param[in] map The character string to integer map.
* @param[in] identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found.
* @param[in] length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found.
* @returns The integral value assigned to the key character string.
* @returns CHAR_MAP_NULL if the key is not assigned a value.
*/
115,7 → 115,7
int char_map_find( const char_map_ref map, const char * identifier, size_t length );
 
/** Initializes the map.
* @param map The character string to integer map. Input/output parameter.
* @param[in,out] map The character string to integer map.
* @returns EOK on success.
* @returns EINVAL if the map parameter is NULL.
* @returns ENOMEM if there is not enough memory left.
123,10 → 123,10
int char_map_initialize( char_map_ref map );
 
/** Adds or updates the value with the key to the map.
* @param map The character string to integer map. Input/output parameter.
* @param identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found. Input parameter.
* @param length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found. Input parameter.
* @param value The integral value to be stored for the key character string. Input parameter.
* @param[in,out] map The character string to integer map.
* @param[in] identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found.
* @param[in] length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found.
* @param[in] value The integral value to be stored for the key character string.
* @returns EOK on success.
* @returns EINVAL if the map is not valid.
* @returns EINVAL if the identifier parameter is NULL.
/branches/network/uspace/srv/net/structures/measured_strings.h
65,8 → 65,8
/** Creates a new measured string bundled with a copy of the given string itself as one memory block.
* If the measured string is being freed, whole memory block is freed.
* The measured string should be used only as a constant.
* @param string The initial character string to be stored. Input parameter.
* @param length The length of the given string without the terminating zero ('/0') character. If the length is zero (0), the actual length is computed. The given length is used and appended with the terminating zero ('\\0') character otherwise. Input parameter.
* @param[in] string The initial character string to be stored.
* @param[in] length The length of the given string without the terminating zero ('/0') character. If the length is zero (0), the actual length is computed. The given length is used and appended with the terminating zero ('\\0') character otherwise.
* @returns The new bundled character string with measured length.
* @returns NULL if there is not enough memory left.
*/
73,7 → 73,7
measured_string_ref measured_string_create_bulk( const char * string, size_t length );
 
/** Copies the given measured string with separated header and data parts.
* @param source The source measured string to be copied. Input parameter.
* @param[in] source The source measured string to be copied.
* @returns The copy of the given measured string.
* @returns NULL if the source parameter is NULL.
* @returns NULL if there is not enough memory left.
83,9 → 83,9
/** Receives a measured strings array from a calling module.
* Creates the array and the data memory blocks.
* This method should be used only while processing IPC messages as the array size has to be negotiated in advance.
* @param strings The received measured strings array. Output parameter.
* @param data The measured strings data. This memory block stores the actual character strings. Output parameter.
* @param count The size of the measured strings array. Input parameter.
* @param[out] strings The received measured strings array.
* @param[out] data The measured strings data. This memory block stores the actual character strings.
* @param[in] count The size of the measured strings array.
* @returns EOK on success.
* @returns EINVAL if the strings or data parameter is NULL.
* @returns EINVAL if the count parameter is zero (0).
98,8 → 98,8
 
/** Replies the given measured strings array to a calling module.
* This method should be used only while processing IPC messages as the array size has to be negotiated in advance.
* @param strings The measured strings array to be transferred. Input parameter.
* @param count The measured strings array size. Input parameter.
* @param[in] strings The measured strings array to be transferred.
* @param[in] count The measured strings array size.
* @returns EOK on success.
* @returns EINVAL if the strings parameter is NULL.
* @returns EINVAL if the count parameter is zero (0).
112,10 → 112,10
/** Receives a measured strings array from another module.
* Creates the array and the data memory blocks.
* This method should be used only following other IPC messages as the array size has to be negotiated in advance.
* @param phone The other module phone. Input parameter.
* @param strings The returned measured strings array. Output parameter.
* @param data The measured strings data. This memory block stores the actual character strings. Output parameter.
* @param count The size of the measured strings array. Input parameter.
* @param[in] phone The other module phone.
* @param[out] strings The returned measured strings array.
* @param[out] data The measured strings data. This memory block stores the actual character strings.
* @param[in] count The size of the measured strings array.
* @returns EOK on success.
* @returns EINVAL if the strings or data parameter is NULL.
* @returns EINVAL if the phone or count parameter is not positive (<=0).
127,9 → 127,9
 
/** Sends the given measured strings array to another module.
* This method should be used only following other IPC messages as the array size has to be negotiated in advance.
* @param phone The other module phone. Input parameter.
* @param strings The measured strings array to be transferred. Input parameter.
* @param count The measured strings array size. Input parameter.
* @param[in] phone The other module phone.
* @param[in] strings The measured strings array to be transferred.
* @param[in] count The measured strings array size.
* @returns EOK on success.
* @returns EINVAL if the strings parameter is NULL.
* @returns EINVAL if the phone or count parameter is not positive (<=0).
/branches/network/uspace/srv/net/structures/generic_field.h
47,8 → 47,8
#define GENERIC_FIELD_MAGIC_VALUE 0x55667788
 
/** Generic type field declaration.
* @param name Name of the field. Input parameter.
* @param type Inner object type. Input parameter
* @param[in] name Name of the field.
* @param[in] type Inner object type.
*/
#define GENERIC_FIELD_DECLARE( name, type ) \
\
73,8 → 73,8
 
/** Generic type field implementation.
* Should follow declaration with the same parameters.
* @param name Name of the field. Input parameter.
* @param type Inner object type. Input parameter
* @param[in] name Name of the field.
* @param[in] type Inner object type.
*/
#define GENERIC_FIELD_IMPLEMENT( name, type ) \
\
/branches/network/uspace/srv/net/structures/packet/packet_remote.c
51,10 → 51,10
 
/** Obtains the packet from the packet server as the shared memory block.
* Creates the local packet mapping as well.
* @param phone The packet server module phone. Input parameter.
* @param packet The packet reference pointer to store the received packet reference. Output parameter.
* @param packet_id The packet identifier. Input parameter.
* @param size The packet total size in bytes. Input parameter.
* @param[in] phone The packet server module phone.
* @param[out] packet The packet reference pointer to store the received packet reference.
* @param[in] packet_id The packet identifier.
* @param[in] size The packet total size in bytes.
* @returns EOK on success.
* @returns Other error codes as defined for the pm_add() function.
* @returns Other error codes as defined for the ipc_share_in_start() function.
/branches/network/uspace/srv/net/structures/packet/packet_server.h
45,10 → 45,10
#include <ipc/ipc.h>
 
/** Processes the packet server message.
* @param callid The message identifier. Input parameter.
* @param call The message parameters. Input parameter.
* @param answer The message answer parameters. Output parameter.
* @param answer_count The last parameter for the actual answer in the answer parameter. Output parameter.
* @param[in] callid The message identifier.
* @param[in] call The message parameters.
* @param[out] answer The message answer parameters.
* @param[out] answer_count The last parameter for the actual answer in the answer parameter.
* @returns EOK on success.
* @returns ENOMEM if there is not enough memory left.
* @returns ENOENT if there is no such packet as in the packet message parameter..
/branches/network/uspace/srv/net/structures/packet/packet_header.h
40,17 → 40,17
#include "packet.h"
 
/** Returns the actual packet data length.
* @param header The packet header. Input parameter.
* @param[in] header The packet header.
*/
#define PACKET_DATA_LENGTH( header ) (( header )->data_end - ( header )->data_start )
 
/** Returns the maximum packet address length.
* @param header The packet header. Input parameter.
* @param[in] header The packet header.
*/
#define PACKET_MAX_ADDRESS_LENGTH( header ) (( header )->dest_addr - ( header )->src_addr )
 
/** Returns the minimum packet suffix.
* @param header The packet header. Input parameter.
* @param[in] header The packet header.
*/
#define PACKET_MIN_SUFFIX( header ) (( header )->length - ( header )->data_start - ( header )->max_content )
 
109,7 → 109,7
};
 
/** Returns whether the packet is valid.
* @param packet The packet to be checked. Input parameter.
* @param[in] packet The packet to be checked.
* @returns true if the packet is not NULL and the magic value is correct.
* @returns false otherwise.
*/
/branches/network/uspace/srv/net/structures/packet/packet.c
56,12 → 56,12
#define PACKET_MAP_SIZE 100
 
/** Returns the packet map page index.
* @param packet_id The packet identifier.
* @param[in] packet_id The packet identifier.
*/
#define PACKET_MAP_PAGE( packet_id ) ((( packet_id ) - 1 ) / PACKET_MAP_SIZE )
 
/** Returns the packet index in the corresponding packet map page.
* @param packet_id The packet identifier.
* @param[in] packet_id The packet identifier.
*/
#define PACKET_MAP_INDEX( packet_id ) ((( packet_id ) - 1 ) % PACKET_MAP_SIZE )
 
79,7 → 79,7
GENERIC_FIELD_DECLARE( gpm, packet_map_t );
 
/** Releases the packet.
* @param packet The packet to be released. Input parameter.
* @param[in] packet The packet to be released.
* @returns EOK on success.
* @returns EINVAL if the packet is not valid.
*/
/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 );
 
/branches/network/uspace/srv/net/structures/packet/packet.h
57,7 → 57,7
/*@{*/
 
/** Finds the packet mapping.
* @param packet_id The packet identifier to be found. Input parameter.
* @param[in] packet_id The packet identifier to be found.
* @returns The found packet reference.
* @returns NULL if the mapping does not exist.
*/
64,7 → 64,7
packet_t pm_find( packet_id_t packet_id );
 
/** Adds the packet mapping.
* @param packet The packet to be remembered. Input parameter.
* @param[in] packet The packet to be remembered.
* @returns EOK on success.
* @returns EINVAL if the packet is not valid.
* @returns EINVAL if the packet map is not initialized.
85,10 → 85,10
/** Add packet to the sorted queue.
* The queue is sorted in the ascending order.
* The packet is inserted right before the packets of the same order value.
* @param first The first packet of the queue. May be NULL. Input parameter.
* @param packet The packet to be added. Input parameter.
* @param order The packet order value. Input parameter.
* @param metric The metric value of the packet. Input parameter.
* @param[in] first The first packet of the queue. May be NULL.
* @param[in] packet The packet to be added.
* @param[in] order The packet order value.
* @param[in] metric The metric value of the packet.
* @returns The first packet of the queue. The original first packet may be shifted by the new packet.
* @returns NULL if the packet is not valid.
*/
95,8 → 95,8
packet_t pq_add( packet_t first, packet_t packet, size_t order, size_t metric );
 
/** Finds the packet with the given order.
* @param first The first packet of the queue. Input parameter.
* @param order The packet order value. Input parameter.
* @param[in] first The first packet of the queue.
* @param[in] order The packet order value.
* @returns The packet with the given order.
* @returns NULL if the first packet is not valid.
* @returns NULL if the packet is not found.
104,8 → 104,8
packet_t pq_find( packet_t first, size_t order );
 
/** Inserts packet after the given one.
* @param packet The packet in the queue. Input parameter.
* @param new_packet The new packet to be inserted. Input parameter.
* @param[in] packet The packet in the queue.
* @param[in] new_packet The new packet to be inserted.
* @returns EOK on success.
* @returns EINVAL if etiher of the packets is invalid.
*/
112,7 → 112,7
int pq_insert_after( packet_t packet, packet_t new_packet );
 
/** Detach the packet from the queue.
* @param packet The packet to be detached. Input parameter.
* @param[in] packet The packet to be detached.
* @returns The next packet in the queue. If the packet is the first one of the queue, this becomes the new first one.
* @returns NULL if there is no packet left.
* @returns NULL if the packet is not valid.
120,9 → 120,9
packet_t pq_detach( packet_t packet );
 
/** Sets the packet order and metric attributes.
* @param packet The packet to be set. Input parameter.
* @param order The packet order value. Input parameter.
* @param metric The metric value of the packet. Input parameter.
* @param[in] packet The packet to be set.
* @param[in] order The packet order value.
* @param[in] metric The metric value of the packet.
* @returns EOK on success.
* @returns EINVAL if the packet is invalid..
*/
129,9 → 129,9
int pq_set_order( packet_t packet, size_t order, size_t metric );
 
/** Sets the packet order and metric attributes.
* @param packet The packet to be set. Input parameter.
* @param order The packet order value. Output parameter.
* @param metric The metric value of the packet. Ouput parameter.
* @param[in] packet The packet to be set.
* @param[out] order The packet order value.
* @param[out] metric The metric value of the packet.
* @returns EOK on success.
* @returns EINVAL if the packet is invalid..
*/
139,13 → 139,13
 
/** Releases the whole queue.
* Detaches all packets of the queue and calls the packet_release() for each of them.
* @param first The first packet of the queue. Input parameter.
* @param packet_release The releasing function called for each of the packets after its detachment. Input parameter.
* @param[in] first The first packet of the queue.
* @param[in] packet_release The releasing function called for each of the packets after its detachment.
*/
void pq_destroy( packet_t first, void ( * packet_release )( packet_t packet ));
 
/** Returns the next packet in the queue.
* @param packet The packet queue member. Input parameter.
* @param[in] packet The packet queue member.
* @returns The next packet in the queue.
* @returns NULL if there is no next packet.
* @returns NULL if the packet is not valid.
153,7 → 153,7
packet_t pq_next( packet_t packet );
 
/** Returns the previous packet in the queue.
* @param packet The packet queue member. Input parameter.
* @param[in] packet The packet queue member.
* @returns The previous packet in the queue.
* @returns NULL if there is no previous packet.
* @returns NULL if the packet is not valid.
/branches/network/uspace/srv/net/structures/packet/packet_server.c
105,10 → 105,10
* Tries to reuse free packets first.
* Creates a&nbsp;new packet aligned to the memory page size if none available.
* Locks the global data during its processing.
* @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] 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 of dimensions at least as given.
* @returns NULL if there is not enough memory left.
*/
115,7 → 115,7
packet_t packet_get( size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix );
 
/** Releases the packet queue.
* @param packet_id The first packet identifier. Input parameter.
* @param[in] packet_id The first packet identifier.
* @returns EOK on success.
* @returns ENOENT if there is no such packet.
*/
123,17 → 123,17
 
/** Releases the packet and returns it to the appropriate free packet queue.
* Should be used only when the global data are locked.
* @param packet The packet to be released. Input parameter.
* @param[in] packet The packet to be released.
*/
void packet_release( packet_t packet );
 
/** Creates a&nbsp;new packet of dimensions at least as given.
* Should be used only when the global data are locked.
* @param length The total length of the packet, including the header, the addresses and the data of the 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.
* @param max_suffix The maximal suffix length in bytes. Input parameter.
* @param[in] length The total length of the packet, including the header, the addresses and the data of the packet.
* @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 of dimensions at least as given.
* @returns NULL if there is not enough memory left.
*/
140,16 → 140,16
packet_t packet_create( size_t length, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix );
 
/** Clears and initializes the packet according to the given dimensions.
* @param packet The packet to be initialized. 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] packet The packet to be initialized.
* @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.
*/
void packet_init( packet_t packet, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix );
 
/** Shares the packet memory block.
* @param packet The packet to be shared.
* @param[in] packet The packet to be shared.
* @returns EOK on success.
* @returns EINVAL if the packet is not valid.
* @returns EINVAL if the calling module does not accept the memory.
/branches/network/uspace/srv/net/structures/dynamic_fifo.c
46,13 → 46,13
 
/** Returns the next queue index.
* The queue field is circular.
* @param fifo The dynamic queue. Input parameter.
* @param index The actual index to be shifted. Input parameter.
* @param[in] fifo The dynamic queue.
* @param[in] index The actual index to be shifted.
*/
#define NEXT_INDEX( fifo, index ) ((( index ) + 1 ) % (( fifo )->size + 1 ))
 
/** Checks if the queue is valid.
* @param fifo The dynamic queue. Input parameter.
* @param[in] fifo The dynamic queue.
* @returns TRUE if the queue is valid.
* @returns FALSE otherwise.
*/
/branches/network/uspace/srv/net/structures/module_map.h
88,13 → 88,13
};
 
/** Adds module to the module map.
* @param module The module structure added. Output parameter.
* @param modules The module map. Input parameter.
* @param name The module name. Input parameter.
* @param filename The full path filename. Input parameter.
* @param service The module service. Input parameter.
* @param task_id The module current task identifier. Zero (0) means not running. Input parameter.
* @param connect_module The module connecting function. Input parameter.
* @param[out] module The module structure added.
* @param[in] modules The module map.
* @param[in] name The module name.
* @param[in] filename The full path filename.
* @param[in] service The module service.
* @param[in] task_id The module current task identifier. Zero (0) means not running.
* @param[in] connect_module The module connecting function.
* @returns EOK on success.
* @returns ENOMEM if there is not enough memory left.
*/
103,8 → 103,8
/** Searches and returns the specified module.
* If the module is not running, the module filaname is spawned.
* If the module is not connected, the connect_function is called.
* @param modules The module map. Input parameter.
* @param name The module name. Input parameter.
* @param[in] modules The module map.
* @param[in] name The module name.
* @returns The running module found. It does not have to be connected.
* @returns NULL if there is no such module.
*/
111,7 → 111,7
module_ref get_running_module( modules_ref modules, char * name );
 
/** Starts the given module.
* @param fname The module full or relative path filename. Input parameter.
* @param[in] fname The module full or relative path filename.
* @returns The new module task identifier on success.
* @returns 0 if there is no such module.
*/
/branches/network/uspace/srv/net/structures/char_map.c
48,10 → 48,10
 
/** Adds the value with the key to the map.
* Creates new nodes to map the key.
* @param map The character string to integer map. Input/output parameter.
* @param identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found. Input parameter.
* @param length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found. Input parameter.
* @param value The integral value to be stored for the key character string. Input parameter.
* @param[in,out] map The character string to integer map.
* @param[in] identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found.
* @param[in] length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found.
* @param[in] value The integral value to be stored for the key character string.
* @returns EOK on success.
* @returns ENOMEM if there is not enough memory left.
* @returns EEXIST if the key character string is already used.
59,9 → 59,9
int char_map_add_item( char_map_ref map, const char * identifier, size_t length, const int value );
 
/** Returns the node assigned to the key from the map.
* @param map The character string to integer map. Input parameter.
* @param identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found. Input parameter.
* @param length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found. Input parameter.
* @param[in] map The character string to integer map.
* @param[in] identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found.
* @param[in] length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found.
* @returns The node holding the integral value assigned to the key character string.
* @returns NULL if the key is not assigned a&nbsp;node.
*/
68,7 → 68,7
char_map_ref char_map_find_node( const char_map_ref map, const char * identifier, const size_t length );
 
/** Returns the value assigned to the map.
* @param map The character string to integer map. Input parameter.
* @param[in] map The character string to integer map.
* @returns The integral value assigned to the map.
* @returns CHAR_MAP_NULL if the map is not assigned a&nbsp;value.
*/
75,7 → 75,7
int char_map_get_value( const char_map_ref map );
 
/** Checks if the map is valid.
* @param map The character string to integer map. Input parameter.
* @param[in] map The character string to integer map.
* @returns TRUE if the map is valid.
* @returns FALSE otherwise.
*/
/branches/network/uspace/srv/net/structures/generic_char_map.h
50,8 → 50,8
#define GENERIC_CHAR_MAP_MAGIC_VALUE 0x12345622
 
/** Character string to generic type map declaration.
* @param name Name of the map. Input parameter.
* @param type Inner object type. Input parameter
* @param[in] name Name of the map.
* @param[in] type Inner object type.
*/
#define GENERIC_CHAR_MAP_DECLARE( name, type ) \
\
76,8 → 76,8
 
/** Character string to generic type map implementation.
* Should follow declaration with the same parameters.
* @param name Name of the map. Input parameter.
* @param type Inner object type. Input parameter
* @param[in] name Name of the map.
* @param[in] type Inner object type.
*/
#define GENERIC_CHAR_MAP_IMPLEMENT( name, type ) \
\
/branches/network/uspace/srv/net/structures/dynamic_fifo.h
71,8 → 71,8
};
 
/** Initializes the dynamic queue.
* @param fifo The dynamic queue. Input/output parameter.
* @param size The initial queue size. Input parameter.
* @param[in,out] fifo The dynamic queue.
* @param[in] size The initial queue size.
* @returns EOK on success.
* @returns EINVAL if the queue is not valid.
* @returns EBADMEM if the fifo parameter is NULL.
81,9 → 81,9
int dyn_fifo_initialize( dyn_fifo_ref fifo, int size );
 
/** Appends a new item to the queue end.
* @param fifo The dynamic queue. Input/output parameter.
* @param value The new item value. Should be positive. Input parameter.
* @param max_size The maximum queue size. The queue is not resized beyound this limit. May be zero or negative (<=0) to indicate no limit. Input parameter.
* @param[in,out] fifo The dynamic queue.
* @param[in] value The new item value. Should be positive.
* @param[in] max_size The maximum queue size. The queue is not resized beyound this limit. May be zero or negative (<=0) to indicate no limit.
* @returns EOK on success.
* @returns EINVAL if the queue is not valid.
* @returns ENOMEM if there is not enough memory left.
91,7 → 91,7
int dyn_fifo_push( dyn_fifo_ref fifo, int value, int max_size );
 
/** Returns and excludes the first item in the queue.
* @param fifo The dynamic queue. Input/output parameter.
* @param[in,out] fifo The dynamic queue.
* @returns Value of the first item in the queue.
* @returns EINVAL if the queue is not valid.
* @returns ENOENT if the queue is empty.
99,7 → 99,7
int dyn_fifo_pop( dyn_fifo_ref fifo );
 
/** Returns and keeps the first item in the queue.
* @param fifo The dynamic queue. Input/output parameter.
* @param[in,out] fifo The dynamic queue.
* @returns Value of the first item in the queue.
* @returns EINVAL if the queue is not valid.
* @returns ENOENT if the queue is empty.
107,7 → 107,7
int dyn_fifo_value( dyn_fifo_ref fifo );
 
/** Clears and destroys the queue.
* @param fifo The dynamic queue. Input/output parameter.
* @param[in,out] fifo The dynamic queue.
* @returns EOK on success.
* @returns EINVAL if the queue is not valid.
*/
/branches/network/uspace/srv/net/structures/int_map.h
51,8 → 51,8
#define INT_MAP_ITEM_MAGIC_VALUE 0x55667788
 
/** Integer to generic type map declaration.
* @param name Name of the map. Input parameter.
* @param type Inner object type. Input parameter
* @param[in] name Name of the map.
* @param[in] type Inner object type.
*/
#define INT_MAP_DECLARE( name, type ) \
\
89,8 → 89,8
 
/** Integer to generic type map implementation.
* Should follow declaration with the same parameters.
* @param name Name of the map. Input parameter.
* @param type Inner object type. Input parameter
* @param[in] name Name of the map.
* @param[in] type Inner object type.
*/
#define INT_MAP_IMPLEMENT( name, type ) \
\