Changeset 1d24ad3 in mainline for uspace/srv/net/tcp
- Timestamp:
- 2013-07-03T14:20:04Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d8b47eca
- Parents:
- 02a09ed
- Location:
- uspace/srv/net/tcp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/pdu.c
r02a09ed r1d24ad3 145 145 } 146 146 147 static uint16_t tcp_phdr_setup(tcp_pdu_t *pdu, tcp_phdr_t *phdr) 147 static uint16_t tcp_phdr_setup(tcp_pdu_t *pdu, tcp_phdr_t *phdr, 148 tcp_phdr6_t *phdr6) 148 149 { 149 150 addr32_t src_v4; … … 167 168 break; 168 169 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; 171 177 default: 172 178 assert(false); … … 259 265 uint16_t cs_headers; 260 266 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); 263 270 switch (af) { 264 271 case AF_INET: … … 267 274 break; 268 275 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; 271 279 default: 272 280 assert(false); -
uspace/srv/net/tcp/std.h
r02a09ed r1d24ad3 75 75 }; 76 76 77 /** TCP pseudo header */77 /** TCP IPv4 pseudo header */ 78 78 typedef struct { 79 79 /** Source address */ … … 88 88 uint16_t tcp_length; 89 89 } tcp_phdr_t; 90 91 /** TCP IPv6 pseudo header */ 92 typedef struct { 93 /** Source address */ 94 addr128_t src; 95 /** Destination address */ 96 addr128_t dest; 97 /** TCP length */ 98 uint32_t tcp_length; 99 /** Zeroes */ 100 uint8_t zero[3]; 101 /** Next header */ 102 uint8_t next; 103 } tcp_phdr6_t; 90 104 91 105 /** Option kind */
Note:
See TracChangeset
for help on using the changeset viewer.