Skip to content

Add ipv6 header. #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/arp.c
Original file line number Diff line number Diff line change
@@ -196,6 +196,11 @@ static int arp_input(const struct ether_hdr *hdr __unused,
LOG(LOG_WARN, "Invalid ARP op: %d", arp.arp_oper);
break;
}
} else if (arp.arp_ptype == ETHER_PROTO_IPV6) {
/* TODO: IPv6 support */
LOG(LOG_INFO, "TODO: IPv6 support - WIP");

return -EPROTOTYPE;
} else {
LOG(LOG_DEBUG, "Unknown ptype");

14 changes: 14 additions & 0 deletions src/nstack_ip.h
Original file line number Diff line number Diff line change
@@ -42,6 +42,20 @@ struct ip_hdr {

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

/**
* IPv6 Packet Header.
*/
struct ipv6_hdr {
uint8_t ip_vhl; /* version */
uint16_t ip_tc; /* traffic class */
uint32_t ip_flb; /* flowlabel (20 bits) */
uint32_t ip_len; /* payload length */
uint16_t ip_nhdr; /* next header */
uint16_t ip_hopl; /* hoplimit */
uint8_t ip_src[16]; /* source address */
uint8_t ip_dst[16]; /* destination address */
} __attribute__((packed, aligned(4)));

/**
* IP Packet Header Defaults
* @{