Skip to content

Commit 2c84290

Browse files
committed
Add ipv6 header
1 parent 45acc43 commit 2c84290

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/arp.c

+5
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ static int arp_input(const struct ether_hdr *hdr __unused,
196196
LOG(LOG_WARN, "Invalid ARP op: %d", arp.arp_oper);
197197
break;
198198
}
199+
} else if (arp.arp_ptype == ETHER_PROTO_IPV6) {
200+
/* TODO: IPv6 support */
201+
LOG(LOG_INFO, "TODO: IPv6 support - WIP");
202+
203+
return -EPROTOTYPE;
199204
} else {
200205
LOG(LOG_DEBUG, "Unknown ptype");
201206

src/nstack_ip.h

+14
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ struct ip_hdr {
4242

4343
} __attribute__((packed, aligned(4)));
4444

45+
/**
46+
* IPv6 Packet Header.
47+
*/
48+
struct ipv6_hdr {
49+
uint8_t ip_vhl; /* version */
50+
uint16_t ip_tc; /* traffic class */
51+
uint32_t ip_flb; /* flowlabel (20 bits) */
52+
uint32_t ip_len; /* payload length */
53+
uint16_t ip_nhdr; /* next header */
54+
uint16_t ip_hopl; /* hoplimit */
55+
uint8_t ip_src[16]; /* source address */
56+
uint8_t ip_dst[16]; /* destination address */
57+
} __attribute__((packed, aligned(4)));
58+
4559
/**
4660
* IP Packet Header Defaults
4761
* @{

0 commit comments

Comments
 (0)