Changeset 1d24ad3 in mainline for uspace/srv/net/tcp/pdu.c


Ignore:
Timestamp:
2013-07-03T14:20:04Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d8b47eca
Parents:
02a09ed
Message:

more IPv6 stub code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tcp/pdu.c

    r02a09ed r1d24ad3  
    145145}
    146146
    147 static uint16_t tcp_phdr_setup(tcp_pdu_t *pdu, tcp_phdr_t *phdr)
     147static uint16_t tcp_phdr_setup(tcp_pdu_t *pdu, tcp_phdr_t *phdr,
     148    tcp_phdr6_t *phdr6)
    148149{
    149150        addr32_t src_v4;
     
    167168                break;
    168169        case AF_INET6:
    169                 // FIXME TODO
    170                 assert(false);
     170                host2addr128_t_be(src_v6, phdr6->src);
     171                host2addr128_t_be(dest_v6, phdr6->dest);
     172                phdr6->tcp_length =
     173                    host2uint32_t_be(pdu->header_size + pdu->text_size);
     174                memset(phdr6->zero, 0, 3);
     175                phdr6->next = IP_PROTO_TCP;
     176                break;
    171177        default:
    172178                assert(false);
     
    259265        uint16_t cs_headers;
    260266        tcp_phdr_t phdr;
    261        
    262         uint16_t af = tcp_phdr_setup(pdu, &phdr);
     267        tcp_phdr6_t phdr6;
     268       
     269        uint16_t af = tcp_phdr_setup(pdu, &phdr, &phdr6);
    263270        switch (af) {
    264271        case AF_INET:
     
    267274                break;
    268275        case AF_INET6:
    269                 // FIXME TODO
    270                 assert(false);
     276                cs_phdr = tcp_checksum_calc(TCP_CHECKSUM_INIT, (void *) &phdr6,
     277                    sizeof(tcp_phdr6_t));
     278                break;
    271279        default:
    272280                assert(false);
Note: See TracChangeset for help on using the changeset viewer.