Diff for /embedaddon/quagga/ripd/rip_snmp.c between versions 1.1.1.1 and 1.1.1.3

version 1.1.1.1, 2012/02/21 17:26:12 version 1.1.1.3, 2016/11/02 10:09:10
Line 22 Line 22
 #include <zebra.h>  #include <zebra.h>
   
 #ifdef HAVE_SNMP  #ifdef HAVE_SNMP
 #ifdef HAVE_NETSNMP  
 #include <net-snmp/net-snmp-config.h>  #include <net-snmp/net-snmp-config.h>
 #include <net-snmp/net-snmp-includes.h>  #include <net-snmp/net-snmp-includes.h>
 #else  
 #include <asn1.h>  
 #include <snmp.h>  
 #include <snmp_impl.h>  
 #endif  
   
 #include "if.h"  #include "if.h"
 #include "log.h"  #include "log.h"
Line 39 Line 33
 #include "smux.h"  #include "smux.h"
   
 #include "ripd/ripd.h"  #include "ripd/ripd.h"
 /* RIPv2-MIB. */  /* RIPv2-MIB. */
 #define RIPV2MIB 1,3,6,1,2,1,23  #define RIPV2MIB 1,3,6,1,2,1,23
   
Line 82 Line 76
 #define TIMETICKS   ASN_TIMETICKS  #define TIMETICKS   ASN_TIMETICKS
 #define IPADDRESS   ASN_IPADDRESS  #define IPADDRESS   ASN_IPADDRESS
 #define STRING      ASN_OCTET_STR  #define STRING      ASN_OCTET_STR
 /* Define SNMP local variables. */  /* Define SNMP local variables. */
 SNMP_LOCAL_VARIABLES  SNMP_LOCAL_VARIABLES
   
Line 155  struct variable rip_variables[] =  Line 149  struct variable rip_variables[] = 
 };  };
   
 extern struct thread_master *master;  extern struct thread_master *master;
 static u_char *  static u_char *
 rip2Globals (struct variable *v, oid name[], size_t *length,  rip2Globals (struct variable *v, oid name[], size_t *length,
              int exact, size_t *var_len, WriteMethod **write_method)               int exact, size_t *var_len, WriteMethod **write_method)
Line 301  rip2PeerLookup (struct variable *v, oid name[], size_t Line 295  rip2PeerLookup (struct variable *v, oid name[], size_t
   
       peer = rip_peer_lookup (addr);        peer = rip_peer_lookup (addr);
   
      if (peer->domain == name[v->namelen + sizeof (struct in_addr)])      if (peer->domain == (int)name[v->namelen + sizeof (struct in_addr)])
         return peer;          return peer;
   
       return NULL;        return NULL;
Line 317  rip2PeerLookup (struct variable *v, oid name[], size_t Line 311  rip2PeerLookup (struct variable *v, oid name[], size_t
       peer = rip_peer_lookup (addr);        peer = rip_peer_lookup (addr);
       if (peer)        if (peer)
         {          {
          if ((len < sizeof (struct in_addr) + 1) ||          if ((len < (int)sizeof (struct in_addr) + 1) ||
              (peer->domain > name[v->namelen + sizeof (struct in_addr)]))              (peer->domain > (int)name[v->namelen + sizeof (struct in_addr)]))
             {              {
               oid_copy_addr (name + v->namelen, &peer->addr,                oid_copy_addr (name + v->namelen, &peer->addr,
                              sizeof (struct in_addr));                               sizeof (struct in_addr));
Line 351  rip2IfStatEntry (struct variable *v, oid name[], size_ Line 345  rip2IfStatEntry (struct variable *v, oid name[], size_
   static struct in_addr addr;    static struct in_addr addr;
   static long valid = SNMP_VALID;    static long valid = SNMP_VALID;
   
     if (smux_header_table(v, name, length, exact, var_len, write_method)
         == MATCH_FAILED)
       return NULL;
   
   memset (&addr, 0, sizeof (struct in_addr));    memset (&addr, 0, sizeof (struct in_addr));
       
   /* Lookup interface. */    /* Lookup interface. */
Line 454  rip2IfConfAddress (struct variable *v, oid name[], siz Line 452  rip2IfConfAddress (struct variable *v, oid name[], siz
   struct interface *ifp;    struct interface *ifp;
   struct rip_interface *ri;    struct rip_interface *ri;
   
     if (smux_header_table(v, name, length, exact, val_len, write_method)
         == MATCH_FAILED)
       return NULL;
   
   memset (&addr, 0, sizeof (struct in_addr));    memset (&addr, 0, sizeof (struct in_addr));
       
   /* Lookup interface. */    /* Lookup interface. */
Line 523  rip2PeerTable (struct variable *v, oid name[], size_t  Line 525  rip2PeerTable (struct variable *v, oid name[], size_t 
   /* static time_t uptime; */    /* static time_t uptime; */
   
   struct rip_peer *peer;    struct rip_peer *peer;
   
     if (smux_header_table(v, name, length, exact, val_len, write_method)
         == MATCH_FAILED)
       return NULL;
   
   memset (&addr, 0, sizeof (struct in_addr));    memset (&addr, 0, sizeof (struct in_addr));
       

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>