Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configDB enforcer for VLAN #356

Merged
merged 8 commits into from
Nov 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ deps/
teamsyncd/teamsyncd
fpmsyncd/fpmsyncd
intfsyncd/intfsyncd
cfgmgr/vlanmgrd
neighsyncd/neighsyncd
portsyncd/portsyncd
orchagent/orchagent
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS = fpmsyncd neighsyncd intfsyncd portsyncd orchagent swssconfig
SUBDIRS = fpmsyncd neighsyncd intfsyncd portsyncd orchagent swssconfig cfgmgr

if HAVE_LIBTEAM
SUBDIRS += teamsyncd
Expand Down
16 changes: 16 additions & 0 deletions cfgmgr/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
INCLUDES = -I $(top_srcdir) -I $(top_srcdir)/orchagent
CFLAGS_SAI = -I /usr/include/sai

bin_PROGRAMS = vlanmgrd

if DEBUG
DBGFLAGS = -ggdb -DDEBUG
else
DBGFLAGS = -g
endif

vlanmgrd_SOURCES = vlanmgrd.cpp vlanmgr.cpp $(top_srcdir)/orchagent/orch.cpp shellcmd.h
vlanmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
vlanmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
vlanmgrd_LDADD = -lswsscommon

23 changes: 23 additions & 0 deletions cfgmgr/shellcmd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef __SHELLCMD__
#define __SHELLCMD__

#define IP_CMD "/sbin/ip"
#define BRIDGE_CMD "/sbin/bridge"
#define ECHO_CMD "/bin/echo"
#define REDIS_CLI_CMD "/usr/bin/redis-cli"
#define XARGS_CMD "/usr/bin/xargs"
#define GREP_CMD "/bin/grep"
#define AWK_CMD "/usr/bin/awk"
#define LS_CMD "/bin/ls"
#define PASTE_CMD "/usr/bin/paste"
#define SED_CMD "/bin/sed"

#define EXEC_WITH_ERROR_THROW(cmd, res) ({ \
int ret = swss::exec(cmd, res); \
if (ret != 0) \
{ \
throw runtime_error(cmd + " : " + res); \
} \
})

#endif /* __SHELLCMD__ */
Loading