++todos; begin router mode

This commit is contained in:
Nico Schottelius 2019-02-23 18:58:04 +01:00
commit c4a4e370f0
4 changed files with 52 additions and 7 deletions

View file

@ -8,5 +8,6 @@
#define THE_ANSWER_TO_LIFE_THE_UNIVERSE_AND_EVERYTHING 42 /* Important constant */
#define ROUTING_TABLE_SIZE 64 /* maximum routes per protocol */
#define ADDRESS_TABLE_SIZE 64 /* maximum number of addresses per protocol */
#endif

View file

@ -16,11 +16,31 @@ control MyIngress(inout headers hdr,
inout metadata meta,
inout standard_metadata_t standard_metadata) {
/********************** ADDRESS TABLES ***********************************/
action icmp6_answer(port_t port) {
/* do something:
- change src/dst
- change type
*/
}
table v6_addresses {
key = {
hdr.ipv6.dst_addr: exact;
}
actions = {
icmp6_answer;
NoAction;
}
size = ADDRESS_TABLE_SIZE;
default_action = NoAction;
}
/********************** ROUTING (egress definiton) TABLES ***********************************/
action set_egress_port (port_t out_port) {
standard_metadata.egress_spec = out_port;
}
table v6_routing {
key = {
hdr.ipv6.dst_addr: lpm;