summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/prox_args.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2020-05-11 21:00:33 +0200
committerXavier Simonart <xavier.simonart@intel.com>2020-05-29 23:45:09 +0200
commitc871c361f9d69a93429ae385e7dbf21a46aa6857 (patch)
tree957ec8a53d2cd0a9b5676e163c22e8a3ae8f6f3e /VNFs/DPPD-PROX/prox_args.c
parent7c4601f23c526b14a67674782b303663dfaa95af (diff)
Added initial support for NDP (IPv6)
Following messages are now handled by PROX - router_solicitation - neighbour_solicitation - router_advertisement - neighbour_advertisement The following parameters are supported (through the PROX config file) - sub mode=ndp This will enable handling of router and neighbour solicitation and advertisement. - local ipv6=xxxx:xxxx:xxxxx:xxxx:xxxx:xxxx:xxxx:xxxx This will configure the local IPv6 address of the port. This parameter is optional. If not specified, the local IPv6 will be calculated from the EUI. - global ipv6=xxxx:xxxx:xxxxx:xxxx:xxxx:xxxx:xxxx:xxxx This will configure the global IPv6 address of the port. This parameter is optional. If not specified, the global IPv6 will be calculated from the EUI and the router prefix received from the router. - ipv6 router=yes This will cause the core to behave as an IPv6 router i.e. it will generate Router Advertisement messages This is only useful in back to back cases, when no real IPv6 router is present in the setup. - router prefix=xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx The router prefix usedin the router advertisement The prefix will be used by the node to build an IPv6 global address in cases none were configured. "Unsollicited NA" parameter has been added within the core/task section. If set to yes (Unsollicited NA=yes), then an unsollicited neighbour Advertisement is sent at startup A same core/task cannot support both l3 and ndp mode. Those messages will be generated or handled when submode is set to "ndp": - neighbour sollicitation - neighbour advertisement - router sollicitation - router advertisement An example configuration is provided: config/ipv6.cfg in which port 0 / core 1 plays the role of the generator and port 1 / core 2 plays the role of the swap. Change-Id: Id0ab32d384448b4cf767fb4a1c486fc023f4f395 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/prox_args.c')
-rw-r--r--VNFs/DPPD-PROX/prox_args.c59
1 files changed, 54 insertions, 5 deletions
diff --git a/VNFs/DPPD-PROX/prox_args.c b/VNFs/DPPD-PROX/prox_args.c
index cc8b3b25..25599cb7 100644
--- a/VNFs/DPPD-PROX/prox_args.c
+++ b/VNFs/DPPD-PROX/prox_args.c
@@ -35,6 +35,8 @@
#include "defaults.h"
#include "prox_lua.h"
#include "cqm.h"
+#include "defines.h"
+#include "prox_ipv6.h"
#include "prox_compat.h"
#define MAX_RTE_ARGV 64
@@ -976,6 +978,9 @@ static int get_core_cfg(unsigned sindex, char *str, void *data)
if (STR_EQ(str, "streams")) {
return parse_str(targ->streams, pkey, sizeof(targ->streams));
}
+ if (STR_EQ(str, "Unsollicited NA")) {
+ return parse_flag(&targ->flags, TASK_ARG_SEND_NA_AT_STARTUP, pkey);
+ }
if (STR_EQ(str, "local lpm")) {
return parse_flag(&targ->flags, TASK_ARG_LOCAL_LPM, pkey);
}
@@ -1381,7 +1386,7 @@ static int get_core_cfg(unsigned sindex, char *str, void *data)
targ->task_init = to_task_init(mode_str, sub_mode_str);
if (!targ->task_init) {
- if (strcmp(sub_mode_str, "l3") != 0) {
+ if ((strcmp(sub_mode_str, "l3") != 0) && (strcmp(sub_mode_str, "ndp") != 0)) {
set_errf("sub mode %s not supported for mode %s", sub_mode_str, mode_str);
return -1;
}
@@ -1392,9 +1397,13 @@ static int get_core_cfg(unsigned sindex, char *str, void *data)
}
}
if (strcmp(sub_mode_str, "l3") == 0) {
- prox_cfg.flags |= DSF_CTRL_PLANE_ENABLED;
+ prox_cfg.flags |= DSF_L3_ENABLED;
targ->flags |= TASK_ARG_L3;
strcpy(targ->sub_mode_str, "l3");
+ } else if (strcmp(sub_mode_str, "ndp") == 0) {
+ prox_cfg.flags |= DSF_NDP_ENABLED;
+ targ->flags |= TASK_ARG_NDP;
+ strcpy(targ->sub_mode_str, "ndp");
} else {
strcpy(targ->sub_mode_str, targ->task_init->sub_mode_str);
}
@@ -1453,6 +1462,16 @@ static int get_core_cfg(unsigned sindex, char *str, void *data)
targ->local_prefix = 32;
return parse_ip(&targ->gateway_ipv4, pkey);
}
+ if (STR_EQ(str, "ipv6 router")) { /* we simulate an IPV6 router */
+ int rc = parse_flag(&targ->ipv6_router, 1, pkey);
+ if (!rc && targ->ipv6_router) {
+ plog_info("\tipv6 router configured => NDP enabled\n");
+ prox_cfg.flags |= DSF_NDP_ENABLED;
+ targ->flags |= TASK_ARG_NDP;
+ strcpy(targ->sub_mode_str, "ndp");
+ }
+ return 0;
+ }
if (STR_EQ(str, "local ipv4")) { /* source IP address to be used for packets */
struct ip4_subnet cidr;
if (parse_ip4_cidr(&cidr, pkey) != 0) {
@@ -1470,13 +1489,43 @@ static int get_core_cfg(unsigned sindex, char *str, void *data)
if (STR_EQ(str, "remote ipv4")) { /* source IP address to be used for packets */
return parse_ip(&targ->remote_ipv4, pkey);
}
+ if (STR_EQ(str, "global ipv6")) {
+ if (parse_ip6(&targ->global_ipv6, pkey) == 0) {
+ plog_info("\tglobal ipv6 configured => NDP enabled\n");
+ targ->flags |= TASK_ARG_NDP;
+ prox_cfg.flags |= DSF_NDP_ENABLED;
+ strcpy(targ->sub_mode_str, "ndp");
+ } else {
+ plog_err("Unable to parse content of local ipv6: %s\n", pkey);
+ return -1;
+ }
+ return 0;
+ }
if (STR_EQ(str, "local ipv6")) { /* source IPv6 address to be used for packets */
- return parse_ip6(&targ->local_ipv6, pkey);
+ if (parse_ip6(&targ->local_ipv6, pkey) == 0) {
+ plog_info("\tlocal ipv6 configured => NDP enabled\n");
+ targ->flags |= TASK_ARG_NDP;
+ prox_cfg.flags |= DSF_NDP_ENABLED;
+ strcpy(targ->sub_mode_str, "ndp");
+ } else {
+ plog_err("Unable to parse content of local ipv6: %s\n", pkey);
+ return -1;
+ }
+ return 0;
}
+ if (STR_EQ(str, "router prefix")) {
+ if (parse_ip6(&targ->router_prefix, pkey) == 0) {
+ plog_info("\trouter prefix set to "IPv6_BYTES_FMT" (%s)\n", IPv6_BYTES(targ->router_prefix.bytes), IP6_Canonical(&targ->router_prefix));
+ } else {
+ plog_err("Unable to parse content of router prefix: %s\n", pkey);
+ return -1;
+ }
+ return 0;
+ }
if (STR_EQ(str, "arp timeout"))
- return parse_int(&targ->arp_timeout, pkey);
+ return parse_int(&targ->reachable_timeout, pkey);
if (STR_EQ(str, "arp update time"))
- return parse_int(&targ->arp_update_time, pkey);
+ return parse_int(&targ->arp_ndp_retransmit_timeout, pkey);
if (STR_EQ(str, "number of packets"))
return parse_int(&targ->n_pkts, pkey);
if (STR_EQ(str, "pipes")) {