Changeset 7f95c904 in mainline for uspace/srv/inet/pdu.c


Ignore:
Timestamp:
2012-04-16T07:04:19Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7fda2e0
Parents:
347768d
Message:

Prototype datagram reassembly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/inet/pdu.c

    r347768d r7f95c904  
    201201        uint8_t version;
    202202        uint16_t ident;
     203        uint16_t flags_foff;
     204        uint16_t foff;
    203205
    204206        log_msg(LVL_DEBUG, "inet_pdu_decode()");
     
    231233
    232234        ident = uint16_t_be2host(hdr->id);
    233         (void)ident;
    234         /* XXX Flags */
    235         /* XXX Fragment offset */
     235        flags_foff = uint16_t_be2host(hdr->flags_foff);
     236        foff = BIT_RANGE_EXTRACT(uint16_t, FF_FRAGOFF_h, FF_FRAGOFF_l,
     237            flags_foff);
    236238        /* XXX Checksum */
    237239
     
    241243        packet->proto = hdr->proto;
    242244        packet->ttl = hdr->ttl;
    243         packet->df = (uint16_t_be2host(hdr->tos) & BIT_V(uint16_t, FF_FLAG_DF))
    244             ? 1 : 0;
     245        packet->ident = ident;
     246
     247        packet->df = (flags_foff & BIT_V(uint16_t, FF_FLAG_DF)) != 0;
     248        packet->mf = (flags_foff & BIT_V(uint16_t, FF_FLAG_MF)) != 0;
     249        packet->offs = foff * FRAG_OFFS_UNIT;
    245250
    246251        /* XXX IP options */
Note: See TracChangeset for help on using the changeset viewer.