Changes in uspace/srv/net/structures/packet/packet_client.h [21580dd:aadf01e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/structures/packet/packet_client.h
r21580dd raadf01e 59 59 * @returns NULL if there is not enough memory left. 60 60 */ 61 #define PACKET_PREFIX( packet, type ) ( type * ) packet_prefix(( packet ), sizeof( type))61 #define PACKET_PREFIX(packet, type) (type *) packet_prefix((packet), sizeof(type)) 62 62 63 63 /** Allocates the specified type right after the actual packet content and returns its pointer. … … 69 69 * @returns NULL if there is not enough memory left. 70 70 */ 71 #define PACKET_SUFFIX( packet, type ) ( type * ) packet_suffix(( packet ), sizeof( type))71 #define PACKET_SUFFIX(packet, type) (type *) packet_suffix((packet), sizeof(type)) 72 72 73 73 /** Trims the actual packet content by the specified prefix and suffix types. … … 80 80 * @returns ENOMEM if there is not enough memory left. 81 81 */ 82 #define PACKET_TRIM( packet, prefix, suffix ) packet_trim(( packet ), sizeof( prefix ), sizeof( suffix))82 #define PACKET_TRIM(packet, prefix, suffix) packet_trim((packet), sizeof(prefix), sizeof(suffix)) 83 83 84 84 /** Allocates the specified space right before the actual packet content and returns its pointer. … … 88 88 * @returns NULL if there is not enough memory left. 89 89 */ 90 void * packet_prefix( packet_t packet, size_t length);90 void * packet_prefix(packet_t packet, size_t length); 91 91 92 92 /** Allocates the specified space right after the actual packet content and returns its pointer. … … 96 96 * @returns NULL if there is not enough memory left. 97 97 */ 98 void * packet_suffix( packet_t packet, size_t length);98 void * packet_suffix(packet_t packet, size_t length); 99 99 100 100 /** Trims the actual packet content by the specified prefix and suffix lengths. … … 106 106 * @returns ENOMEM if there is not enough memory left. 107 107 */ 108 int packet_trim( packet_t packet, size_t prefix, size_t suffix);108 int packet_trim(packet_t packet, size_t prefix, size_t suffix); 109 109 110 110 /** Copies the specified data to the beginning of the actual packet content. … … 117 117 * @returns ENOMEM if there is not enough memory left. 118 118 */ 119 int packet_copy_data( packet_t packet, const void * data, size_t length);119 int packet_copy_data(packet_t packet, const void * data, size_t length); 120 120 121 121 /** Returns the packet identifier. … … 124 124 * @returns Zero (0) if the packet is not valid. 125 125 */ 126 packet_id_t packet_get_id( const packet_t packet);126 packet_id_t packet_get_id(const packet_t packet); 127 127 128 128 /** Returns the packet content length. … … 131 131 * @returns Zero (0) if the packet is not valid. 132 132 */ 133 size_t packet_get_data_length( const packet_t packet);133 size_t packet_get_data_length(const packet_t packet); 134 134 135 135 /** Returns the pointer to the beginning of the packet content. … … 138 138 * @returns NULL if the packet is not valid. 139 139 */ 140 void * packet_get_data( const packet_t packet);140 void * packet_get_data(const packet_t packet); 141 141 142 142 /** Returns the stored packet addresses and their length. … … 148 148 * @returns EINVAL if the packet is not valid. 149 149 */ 150 int packet_get_addr( const packet_t packet, uint8_t ** src, uint8_t ** dest);150 int packet_get_addr(const packet_t packet, uint8_t ** src, uint8_t ** dest); 151 151 152 152 /** Sets the packet addresses. … … 159 159 * @returns ENOMEM if there is not enough memory left. 160 160 */ 161 int packet_set_addr( packet_t packet, const uint8_t * src, const uint8_t * dest, size_t addr_len);161 int packet_set_addr(packet_t packet, const uint8_t * src, const uint8_t * dest, size_t addr_len); 162 162 163 163 /** Translates the packet identifier to the packet reference. … … 172 172 * @returns Other error codes as defined for the packet_return() function. 173 173 */ 174 int packet_translate( int phone, packet_ref packet, packet_id_t packet_id);174 int packet_translate(int phone, packet_ref packet, packet_id_t packet_id); 175 175 176 176 /** Obtains the packet of the given dimensions. … … 184 184 * @returns NULL on error. 185 185 */ 186 packet_t packet_get_4( int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix);186 packet_t packet_get_4(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix); 187 187 188 188 /** Obtains the packet of the given content size. … … 193 193 * @returns NULL on error. 194 194 */ 195 packet_t packet_get_1( int phone, size_t content);195 packet_t packet_get_1(int phone, size_t content); 196 196 197 197 /** Releases the packet queue. … … 202 202 * @param[in] packet_id The packet identifier. 203 203 */ 204 void pq_release( int phone, packet_id_t packet_id);204 void pq_release(int phone, packet_id_t packet_id); 205 205 206 206 /** Returns the packet copy. … … 212 212 * @returns NULL on error. 213 213 */ 214 packet_t packet_get_copy( int phone, packet_t packet);214 packet_t packet_get_copy(int phone, packet_t packet); 215 215 216 216 /*@}*/
Note:
See TracChangeset
for help on using the changeset viewer.