Changeset 26e7d6d in mainline for uspace/lib/net/generic/packet_client.c
- Timestamp:
- 2011-09-19T16:31:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a347a11
- Parents:
- 3842a955 (diff), 086290d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/generic/packet_client.c
r3842a955 r26e7d6d 247 247 } 248 248 249 /** Returns the packet copy. 250 * 251 * Copies the addresses, data, order and metric values. 252 * Does not copy the queue placement. 253 * 254 * @param[in] phone The packet server module phone. 255 * @param[in] packet The original packet. 256 * @return The packet copy. 257 * @return NULL on error. 258 */ 259 packet_t *packet_get_copy(int phone, packet_t *packet) 260 { 261 packet_t *copy; 262 uint8_t * src = NULL; 263 uint8_t * dest = NULL; 264 size_t addrlen; 265 266 if (!packet_is_valid(packet)) 267 return NULL; 268 249 /** Return the packet copy. 250 * 251 * Copy the addresses, data, order and metric values. 252 * Queue placement is not copied. 253 * 254 * @param[in] sess Packet server module session. 255 * @param[in] packet Original packet. 256 * 257 * @return Packet copy. 258 * @return NULL on error. 259 * 260 */ 261 packet_t *packet_get_copy(async_sess_t *sess, packet_t *packet) 262 { 263 if (!packet_is_valid(packet)) 264 return NULL; 265 269 266 /* Get a new packet */ 270 copy = packet_get_4_remote(phone, PACKET_DATA_LENGTH(packet),267 packet_t *copy = packet_get_4_remote(sess, PACKET_DATA_LENGTH(packet), 271 268 PACKET_MAX_ADDRESS_LENGTH(packet), packet->max_prefix, 272 269 PACKET_MIN_SUFFIX(packet)); 270 273 271 if (!copy) 274 272 return NULL; 275 273 276 274 /* Get addresses */ 277 addrlen = packet_get_addr(packet, &src, &dest); 275 uint8_t *src = NULL; 276 uint8_t *dest = NULL; 277 size_t addrlen = packet_get_addr(packet, &src, &dest); 278 278 279 /* Copy data */ 279 280 if ((packet_copy_data(copy, packet_get_data(packet), … … 286 287 return copy; 287 288 } else { 288 pq_release_remote( phone, copy->packet_id);289 pq_release_remote(sess, copy->packet_id); 289 290 return NULL; 290 291 }
Note:
See TracChangeset
for help on using the changeset viewer.