From 62ff928b37da20ece0e3df0071998b2fe9d3b21a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 5 May 2017 15:28:38 -0400 Subject: [PATCH 1/2] *: Allow agentx to be displayed as part of vtysh Modify code so that that vtysh can now accept the agentx command for snmp support Signed-off-by: Donald Sharp --- configure.ac | 2 ++ lib/agentx.c | 7 ++++--- vtysh/Makefile.am | 4 ++++ vtysh/extract.pl.in | 3 +++ vtysh/vtysh_config.c | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 919902d938..340b0a953b 100755 --- a/configure.ac +++ b/configure.ac @@ -1510,6 +1510,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]) +AM_CONDITIONAL(SNMP, test "x$SNMP_METHOD" = "xagentx") + dnl --------------------------- dnl sockaddr and netinet checks dnl --------------------------- diff --git a/lib/agentx.c b/lib/agentx.c index 11d5c9385d..e1d8b54043 100644 --- a/lib/agentx.c +++ b/lib/agentx.c @@ -134,7 +134,8 @@ agentx_events_update(void) static struct cmd_node agentx_node = { SMUX_NODE, - "" /* AgentX has no interface. */ + "", /* AgentX has no interface. */ + 1 }; /* Logging NetSNMP messages */ @@ -165,7 +166,7 @@ config_write_agentx (struct vty *vty) { if (agentx_enabled) vty_out (vty, "agentx%s", VTY_NEWLINE); - return 0; + return 1; } DEFUN (agentx_enable, @@ -183,7 +184,7 @@ DEFUN (agentx_enable, return CMD_SUCCESS; } vty_out (vty, "SNMP AgentX already enabled%s", VTY_NEWLINE); - return CMD_WARNING; + return CMD_SUCCESS; } DEFUN (no_agentx, diff --git a/vtysh/Makefile.am b/vtysh/Makefile.am index 8e7a6cede4..bb6bbbe87e 100644 --- a/vtysh/Makefile.am +++ b/vtysh/Makefile.am @@ -118,6 +118,10 @@ vtysh_scan += $(top_srcdir)/eigrpd/eigrp_dump.c vtysh_scan += $(top_srcdir)/eigrpd/eigrp_vty.c endif +if SNMP +vtysh_scan += $(top_srcdir)/lib/agentx.c +endif + vtysh_cmd_FILES = $(vtysh_scan) \ $(top_srcdir)/lib/keychain.c $(top_srcdir)/lib/routemap.c \ $(top_srcdir)/lib/filter.c $(top_srcdir)/lib/plist.c \ diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in index 169220c772..0ca1451ff5 100755 --- a/vtysh/extract.pl.in +++ b/vtysh/extract.pl.in @@ -90,6 +90,9 @@ foreach (@ARGV) { elsif ($file =~ /lib\/filter\.c$/) { $protocol = "VTYSH_ALL"; } + elsif ($file =~ /lib\/agentx\.c$/) { + $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA"; + } elsif ($file =~ /lib\/ns\.c$/) { $protocol = "VTYSH_ZEBRA"; } diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index 06e8569341..2a84847aaa 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -277,6 +277,7 @@ vtysh_config_parse_line (const char *line) if (strncmp (line, "log", strlen ("log")) == 0 || strncmp (line, "hostname", strlen ("hostname")) == 0 || strncmp (line, "frr", strlen ("frr")) == 0 + || strncmp (line, "agentx", strlen ("agentx")) == 0 ) config_add_line_uniq (config_top, line); else From 54c50210c9313668301d038135895b7ddab7d883 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 9 May 2017 10:16:38 -0400 Subject: [PATCH 2/2] debian: Mark FRR as conflicting with Quagga FRR when compiled with this debian packaging will cause some issue with the system to work properly due to the sudoers file conflicts. So to prevent some level of stupidity, mark them as conflicting. Signed-off-by: Donald Sharp --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4ecbefc6d6..3982aa41be 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: frr Architecture: any Depends: ${shlibs:Depends}, logrotate (>= 3.2-11), iproute, ${misc:Depends}, libc-ares2 Pre-Depends: adduser -Conflicts: zebra, zebra-pj +Conflicts: zebra, zebra-pj, quagga Replaces: zebra, zebra-pj Suggests: snmpd Description: BGP/OSPF/RIP routing daemon