]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: Allow agentx to be displayed as part of vtysh
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 5 May 2017 19:28:38 +0000 (15:28 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 9 May 2017 14:16:06 +0000 (10:16 -0400)
Modify code so that that vtysh can now accept the
agentx command for snmp support

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
configure.ac
lib/agentx.c
vtysh/Makefile.am
vtysh/extract.pl.in
vtysh/vtysh_config.c

index 919902d938738241196cbfea30c64b75e08d38d6..340b0a953ba7cdac033510c83f8ee549b3bb5caa 100755 (executable)
@@ -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 ---------------------------
index 11d5c9385d103f51f549ed6f2f9dc53293589376..e1d8b5404317e8dd1d767523b17f16302951a380 100644 (file)
@@ -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,
index 8e7a6cede48db3a267529ae0c4fa5f7255b203be..bb6bbbe87e50ebadd87584fab591ad61b42ef38f 100644 (file)
@@ -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 \
index 169220c772ad69a3cb5364163e44e6979bf8faf2..0ca1451ff536da3efa3138fdcfa4fe4c3dea7eb2 100755 (executable)
@@ -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";
         }
index 06e856934100e571eddcc7177c41deca37e879e3..2a84847aaa798d56f3fe2231f590023a21f5bee5 100644 (file)
@@ -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