Changeset 1d24ad3 in mainline for uspace/srv/net/udp
- 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/udp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/udp/pdu.c
r02a09ed r1d24ad3 85 85 } 86 86 87 static uint16_t udp_phdr_setup(udp_pdu_t *pdu, udp_phdr_t *phdr) 87 static uint16_t udp_phdr_setup(udp_pdu_t *pdu, udp_phdr_t *phdr, 88 udp_phdr6_t *phdr6) 88 89 { 89 90 addr32_t src_v4; … … 106 107 break; 107 108 case AF_INET6: 108 // FIXME TODO 109 assert(false); 109 host2addr128_t_be(src_v6, phdr6->src_addr); 110 host2addr128_t_be(dest_v6, phdr6->dest_addr); 111 phdr6->udp_length = host2uint32_t_be(pdu->data_size); 112 memset(phdr6->zero, 0, 3); 113 phdr6->next = IP_PROTO_UDP; 114 break; 110 115 default: 111 116 assert(false); … … 130 135 uint16_t cs_phdr; 131 136 udp_phdr_t phdr; 132 133 uint16_t af = udp_phdr_setup(pdu, &phdr); 137 udp_phdr6_t phdr6; 138 139 uint16_t af = udp_phdr_setup(pdu, &phdr, &phdr6); 134 140 switch (af) { 135 141 case AF_INET: … … 138 144 break; 139 145 case AF_INET6: 140 // FIXME TODO 141 assert(false); 146 cs_phdr = udp_checksum_calc(UDP_CHECKSUM_INIT, (void *) &phdr6, 147 sizeof(udp_phdr6_t)); 148 break; 142 149 default: 143 150 assert(false); -
uspace/srv/net/udp/std.h
r02a09ed r1d24ad3 54 54 } udp_header_t; 55 55 56 /** UDP pseudo header */56 /** UDP IPv4 pseudo header */ 57 57 typedef struct { 58 58 /** Source address */ … … 68 68 } udp_phdr_t; 69 69 70 /** UDP IPv6 pseudo header */ 71 typedef struct { 72 /** Source address */ 73 addr128_t src_addr; 74 /** Destination address */ 75 addr128_t dest_addr; 76 /** UDP length */ 77 uint32_t udp_length; 78 /** Reserved */ 79 uint8_t zero[3]; 80 /** Next header */ 81 uint8_t next; 82 } udp_phdr6_t; 83 70 84 #endif 71 85
Note:
See TracChangeset
for help on using the changeset viewer.