Changeset 46d4d9f in mainline for uspace/lib/net/generic/packet_client.c
- Timestamp:
- 2010-11-20T17:04:59Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dd5046dd
- Parents:
- fdbc3ff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/generic/packet_client.c
rfdbc3ff r46d4d9f 57 57 * @return ENOMEM if there is not enough memory left. 58 58 */ 59 int packet_copy_data(packet_t packet, const void *data, size_t length)59 int packet_copy_data(packet_t *packet, const void *data, size_t length) 60 60 { 61 61 if (!packet_is_valid(packet)) … … 81 81 * @return NULL if there is not enough memory left. 82 82 */ 83 void *packet_prefix(packet_t packet, size_t length)83 void *packet_prefix(packet_t *packet, size_t length) 84 84 { 85 85 if ((!packet_is_valid(packet)) || 86 (packet->data_start - sizeof( struct packet) -86 (packet->data_start - sizeof(packet_t) - 87 87 2 * (packet->dest_addr - packet->src_addr) < length)) { 88 88 return NULL; … … 102 102 * @return NULL if there is not enough memory left. 103 103 */ 104 void *packet_suffix(packet_t packet, size_t length)104 void *packet_suffix(packet_t *packet, size_t length) 105 105 { 106 106 if ((!packet_is_valid(packet)) || … … 124 124 * @return ENOMEM if there is not enough memory left. 125 125 */ 126 int packet_trim(packet_t packet, size_t prefix, size_t suffix)126 int packet_trim(packet_t *packet, size_t prefix, size_t suffix) 127 127 { 128 128 if (!packet_is_valid(packet)) … … 143 143 * @return Zero if the packet is not valid. 144 144 */ 145 packet_id_t packet_get_id(const packet_t packet)145 packet_id_t packet_get_id(const packet_t *packet) 146 146 { 147 147 return packet_is_valid(packet) ? packet->packet_id : 0; … … 157 157 * @return EINVAL if the packet is not valid. 158 158 */ 159 int packet_get_addr(const packet_t packet, uint8_t **src, uint8_t **dest)159 int packet_get_addr(const packet_t *packet, uint8_t **src, uint8_t **dest) 160 160 { 161 161 if (!packet_is_valid(packet)) … … 177 177 * @return Zero if the packet is not valid. 178 178 */ 179 size_t packet_get_data_length(const packet_t packet)179 size_t packet_get_data_length(const packet_t *packet) 180 180 { 181 181 if (!packet_is_valid(packet)) … … 191 191 * @return NULL if the packet is not valid. 192 192 */ 193 void *packet_get_data(const packet_t packet)193 void *packet_get_data(const packet_t *packet) 194 194 { 195 195 if (!packet_is_valid(packet)) … … 210 210 */ 211 211 int 212 packet_set_addr(packet_t packet, const uint8_t *src, const uint8_t *dest,212 packet_set_addr(packet_t *packet, const uint8_t *src, const uint8_t *dest, 213 213 size_t addr_len) 214 214 { … … 257 257 * @return NULL on error. 258 258 */ 259 packet_t packet_get_copy(int phone, packet_tpacket)260 { 261 packet_t copy;259 packet_t *packet_get_copy(int phone, packet_t *packet) 260 { 261 packet_t *copy; 262 262 uint8_t * src = NULL; 263 263 uint8_t * dest = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.