Prepare switch for fully answering NDP/NS query

Including parser which might be broken in case there are no options present
This commit is contained in:
Nico Schottelius 2019-03-23 14:15:31 +01:00
commit 9f5a37f7f6
3 changed files with 41 additions and 6 deletions

View file

@ -31,7 +31,14 @@ const bit<8> ICMP6_ECHO_REPLY = 129;
const bit<8> ICMP6_NS = 135;
const bit<8> ICMP6_NA = 136;
/* RFC4861, Section 4.6 */
const bit<8> ICMP6_NDP_OPT_SOURCE_LL = 1;
const bit<8> ICMP6_NDP_OPT_TARGET_LL = 2;
const bit<8> ICMP6_NDP_OPT_PREFIX_INFO = 3;
const bit<8> ICMP6_NDP_OPT_REDIR_HEADER = 4;
const bit<8> ICMP6_NDP_OPT_MTU = 5;
/* Tasks from switch to controller - no RFC, internal */
const task_t TASK_ICMP6_NS = 1;
const task_t TASK_ICMP6_GENERAL = 2;
const task_t TASK_DEBUG = 3;
@ -119,6 +126,13 @@ header icmp6_na_ns_t {
ipv6_addr_t target_addr;
}
header icmp6_option_link_layer_addr_t {
bit<8> type;
bit<8> ll_length;
mac_addr_t mac_addr;
}
header icmp_t {
bit<8> type;
bit<8> code;
@ -143,6 +157,7 @@ struct headers {
cpu_t cpu;
icmp6_t icmp6;
icmp6_na_ns_t icmp6_na_ns;
icmp6_option_link_layer_addr_t icmp6_option_link_layer_addr;
}
struct metadata {