From 08fee9c5d2e1d1f3fe14d00683c2a4b7a17e7876 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Sat, 2 May 2020 21:51:24 +0200 Subject: Added initial support for BGP Through this commit BGP messages are forwarded to tap device Netlink messages are enabled to receive route Updates. In addition, generating tasks can also specify a routing table which will be used when sending packets The routes initialized by the routing table can be changed through the reception of BGP messages Change-Id: I187ba9a921885cbc9b209aae5fb654309e3388b8 Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/prox_args.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'VNFs/DPPD-PROX/prox_args.c') diff --git a/VNFs/DPPD-PROX/prox_args.c b/VNFs/DPPD-PROX/prox_args.c index 41082209..30b4cbd7 100644 --- a/VNFs/DPPD-PROX/prox_args.c +++ b/VNFs/DPPD-PROX/prox_args.c @@ -1389,10 +1389,23 @@ static int get_core_cfg(unsigned sindex, char *str, void *data) if (STR_EQ(str, "gateway ipv4")) { /* Gateway IP address used when generating */ if ((targ->flags & TASK_ARG_L3) == 0) plog_warn("gateway ipv4 configured but L3 sub mode not enabled\n"); + if (targ->local_ipv4) + targ->local_prefix = 32; return parse_ip(&targ->gateway_ipv4, pkey); } if (STR_EQ(str, "local ipv4")) { /* source IP address to be used for packets */ - return parse_ip(&targ->local_ipv4, pkey); + struct ip4_subnet cidr; + if (parse_ip4_cidr(&cidr, pkey) != 0) { + if (targ->gateway_ipv4) + targ->local_prefix = 32; + else + targ->local_prefix = 0; + return parse_ip(&targ->local_ipv4, pkey); + } else { + targ->local_ipv4 = cidr.ip; + targ->local_prefix = cidr.prefix; + return 0; + } } if (STR_EQ(str, "remote ipv4")) { /* source IP address to be used for packets */ return parse_ip(&targ->remote_ipv4, pkey); -- cgit 1.2.3-korg