diff options
author | Xavier Simonart <xavier.simonart@intel.com> | 2020-05-02 21:51:24 +0200 |
---|---|---|
committer | Xavier Simonart <xavier.simonart@intel.com> | 2020-05-29 23:31:54 +0200 |
commit | 08fee9c5d2e1d1f3fe14d00683c2a4b7a17e7876 (patch) | |
tree | 5b1f2a9aaab23b654c9504f83eaa1cb8ac2a0b01 /VNFs/DPPD-PROX/prox_args.c | |
parent | 354bfce1e946ec796516b3ae7f3fc677960867ef (diff) |
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 <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/prox_args.c')
-rw-r--r-- | VNFs/DPPD-PROX/prox_args.c | 15 |
1 files changed, 14 insertions, 1 deletions
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); |