Changeset 330df83 in mainline for uspace/srv/net/inetsrv/inet_link.c


Ignore:
Timestamp:
2013-07-19T20:42:57Z (11 years ago)
Author:
Manuele Conti <conti.ma@…>
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.
Message:

Merge with mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/inetsrv/inet_link.c

    r8a8a08d1 r330df83  
    5151static bool first_link = true;
    5252static bool first_link6 = true;
     53
     54static FIBRIL_MUTEX_INITIALIZE(ip_ident_lock);
     55static uint16_t ip_ident = 0;
    5356
    5457static int inet_link_open(service_id_t);
     
    335338}
    336339
    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 */
    338355int inet_link_send_dgram(inet_link_t *ilink, addr32_t lsrc, addr32_t ldest,
    339356    inet_dgram_t *dgram, uint8_t proto, uint8_t ttl, int df)
     
    366383        packet.proto = proto;
    367384        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       
    368391        packet.df = df;
    369392        packet.data = dgram->data;
    370393        packet.size = dgram->size;
    371394       
     395        int rc;
    372396        size_t offs = 0;
    373         int rc;
    374397       
    375398        do {
     
    392415}
    393416
    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 */
    395430int inet_link_send_dgram6(inet_link_t *ilink, addr48_t ldest,
    396431    inet_dgram_t *dgram, uint8_t proto, uint8_t ttl, int df)
     
    421456        packet.proto = proto;
    422457        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       
    423464        packet.df = df;
    424465        packet.data = dgram->data;
Note: See TracChangeset for help on using the changeset viewer.