- Timestamp:
- 10/28/08 21:57:55 (4 years ago)
- File:
-
- 1 edited
-
branches/tap/src/ocateth.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap/src/ocateth.c
r328 r340 63 63 * RFC2460 8.1, (RFC1885 2.3) RFC2463, RFC1071. */ 64 64 65 /* IPv6 Ethernet Multicast: (MAC) 33:33:xx:xx:xx:xx, xx -> 4 lowest order bytes of IPv6 source. 66 * Solicited-Node address: (IPv6) FF02:0:0:0:0:1:ffxx:xxxx, -> xx -> 3 lowest order bytes of IPv6 Source. (RFC4291) 67 * IPv4 Ethernet Multicast: 01:00:5e:0xx:xx:xx, */ 68 65 69 void mac_cleanup(void) 66 70 { … … 191 195 192 196 return (uint16_t*) psh; 197 } 198 199 200 int ndp_(const struct in6_addr *in6) 201 { 202 char buf[FRAME_SIZE]; 203 struct ether_header *eh = (struct ether_header*) (buf + 4); 204 struct ip6_hdr *ip6 = (struct ip6_hdr*) (eh + 1); // ip6 header starts behind ether_header 205 struct nd_neighbor_solicit *nds = (struct nd_neighbor_solicit*) ip6; 206 struct nd_opt_hdr *ohd = (struct nd_opt_hdr*) (nds + 1); 207 uint16_t *ckb, cksum; 208 193 209 } 194 210 … … 239 255 } 240 256 241 /*242 memcpy(&ip6ph->src, &ip6->ip6_src, sizeof(struct in6_addr));243 memcpy(&ip6ph->dst, &ip6->ip6_dst, sizeof(struct in6_addr));244 ip6ph->len = ip6->ip6_plen;245 ip6ph->nxt = IPPROTO_ICMPV6;246 memcpy(ip6ph + 1, icmp6, ntohs(ip6->ip6_plen));247 */248 249 257 ckb = malloc_ckbuf(&ip6->ip6_src, &ip6->ip6_dst, ntohs(ip6->ip6_plen), IPPROTO_ICMPV6, icmp6); 250 258 cksum = checksum(ckb, ntohs(ip6->ip6_plen) + sizeof(struct ip6_psh)); … … 276 284 memcpy(ohd + 1, setup.ocat_hwaddr, ETH_ALEN); 277 285 278 /*279 memcpy(&ip6ph->src, &ip6->ip6_src, sizeof(struct in6_addr));280 memcpy(&ip6ph->dst, &ip6->ip6_dst, sizeof(struct in6_addr));281 ip6ph->len = ip6->ip6_plen;282 ip6ph->nxt = IPPROTO_ICMPV6;283 memcpy(ip6ph + 1, icmp6, ntohs(ip6->ip6_plen));284 */285 286 286 ckb = malloc_ckbuf(&ip6->ip6_src, &ip6->ip6_dst, ntohs(ip6->ip6_plen), IPPROTO_ICMPV6, icmp6); 287 287 nda->nd_na_hdr.icmp6_cksum = checksum(ckb, ntohs(ip6->ip6_plen) + sizeof(struct ip6_psh));
Note: See TracChangeset
for help on using the changeset viewer.
