Skip to content

Commit 9079dc3

Browse files
committed
Natmgrd changes in sonic-swss sub module to support NAT feature. sonic-net#1059
Signed-off-by: Akhilesh Samineni [email protected]
1 parent 665b20e commit 9079dc3

7 files changed

Lines changed: 7951 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ cfgmgr/vlanmgrd
5454
cfgmgr/vrfmgrd
5555
cfgmgr/nbrmgrd
5656
cfgmgr/vxlanmgrd
57+
cfgmgr/natmgrd
5758
neighsyncd/neighsyncd
5859
portsyncd/portsyncd
5960
orchagent/orchagent

cfgmgr/Makefile.am

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CFLAGS_SAI = -I /usr/include/sai
33
LIBNL_CFLAGS = -I/usr/include/libnl3
44
LIBNL_LIBS = -lnl-genl-3 -lnl-route-3 -lnl-3
55

6-
bin_PROGRAMS = vlanmgrd teammgrd portmgrd intfmgrd buffermgrd vrfmgrd nbrmgrd vxlanmgrd sflowmgrd
6+
bin_PROGRAMS = vlanmgrd teammgrd portmgrd intfmgrd buffermgrd vrfmgrd nbrmgrd vxlanmgrd sflowmgrd natmgrd
77

88
if DEBUG
99
DBGFLAGS = -ggdb -DDEBUG
@@ -55,3 +55,8 @@ sflowmgrd_SOURCES = sflowmgrd.cpp sflowmgr.cpp $(top_srcdir)/orchagent/orch.cpp
5555
sflowmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
5656
sflowmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
5757
sflowmgrd_LDADD = -lswsscommon
58+
59+
natmgrd_SOURCES = natmgrd.cpp natmgr.cpp $(top_srcdir)/orchagent/orch.cpp $(top_srcdir)/orchagent/request_parser.cpp shellcmd.h
60+
natmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
61+
natmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
62+
natmgrd_LDADD = -lswsscommon

cfgmgr/intfmgr.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ bool IntfMgr::doIntfGeneralTask(const vector<string>& keys,
390390
string vrf_name = "";
391391
string mtu = "";
392392
string adminStatus = "";
393+
string nat_zone = "";
393394
for (auto idx : data)
394395
{
395396
const auto &field = fvField(idx);
@@ -404,6 +405,11 @@ bool IntfMgr::doIntfGeneralTask(const vector<string>& keys,
404405
{
405406
adminStatus = value;
406407
}
408+
409+
if (field == "nat_zone")
410+
{
411+
nat_zone = value;
412+
}
407413
}
408414

409415
if (op == SET_COMMAND)
@@ -431,6 +437,15 @@ bool IntfMgr::doIntfGeneralTask(const vector<string>& keys,
431437
{
432438
addLoopbackIntf(alias);
433439
}
440+
else
441+
{
442+
/* Set nat zone */
443+
if (!nat_zone.empty())
444+
{
445+
FieldValueTuple fvTuple("nat_zone", nat_zone);
446+
data.push_back(fvTuple);
447+
}
448+
}
434449

435450
if (!vrf_name.empty())
436451
{

0 commit comments

Comments
 (0)