Changeset 330df83 in mainline for uspace/srv/net/inetsrv/inet_link.c
- Timestamp:
- 2013-07-19T20:42:57Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f4cbf9dd
- Parents:
- 8a8a08d1 (diff), cd18cd1 (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/srv/net/inetsrv/inet_link.c
r8a8a08d1 r330df83 51 51 static bool first_link = true; 52 52 static bool first_link6 = true; 53 54 static FIBRIL_MUTEX_INITIALIZE(ip_ident_lock); 55 static uint16_t ip_ident = 0; 53 56 54 57 static int inet_link_open(service_id_t); … … 335 338 } 336 339 337 /** Send IPv4 datagram over Internet link */ 340 /** Send IPv4 datagram over Internet link 341 * 342 * @param ilink Internet link 343 * @param lsrc Source IPv4 address 344 * @param ldest Destination IPv4 address 345 * @param dgram IPv4 datagram body 346 * @param proto Protocol 347 * @param ttl Time-to-live 348 * @param df Do-not-Fragment flag 349 * 350 * @return EOK on success 351 * @return ENOMEM when not enough memory to create the datagram 352 * @return ENOTSUP if networking mode is not supported 353 * 354 */ 338 355 int inet_link_send_dgram(inet_link_t *ilink, addr32_t lsrc, addr32_t ldest, 339 356 inet_dgram_t *dgram, uint8_t proto, uint8_t ttl, int df) … … 366 383 packet.proto = proto; 367 384 packet.ttl = ttl; 385 386 /* Allocate identifier */ 387 fibril_mutex_lock(&ip_ident_lock); 388 packet.ident = ++ip_ident; 389 fibril_mutex_unlock(&ip_ident_lock); 390 368 391 packet.df = df; 369 392 packet.data = dgram->data; 370 393 packet.size = dgram->size; 371 394 395 int rc; 372 396 size_t offs = 0; 373 int rc;374 397 375 398 do { … … 392 415 } 393 416 394 /** Send IPv6 datagram over Internet link */ 417 /** Send IPv6 datagram over Internet link 418 * 419 * @param ilink Internet link 420 * @param ldest Destination MAC address 421 * @param dgram IPv6 datagram body 422 * @param proto Next header 423 * @param ttl Hop limit 424 * @param df Do-not-Fragment flag (unused) 425 * 426 * @return EOK on success 427 * @return ENOMEM when not enough memory to create the datagram 428 * 429 */ 395 430 int inet_link_send_dgram6(inet_link_t *ilink, addr48_t ldest, 396 431 inet_dgram_t *dgram, uint8_t proto, uint8_t ttl, int df) … … 421 456 packet.proto = proto; 422 457 packet.ttl = ttl; 458 459 /* Allocate identifier */ 460 fibril_mutex_lock(&ip_ident_lock); 461 packet.ident = ++ip_ident; 462 fibril_mutex_unlock(&ip_ident_lock); 463 423 464 packet.df = df; 424 465 packet.data = dgram->data;
Note:
See TracChangeset
for help on using the changeset viewer.