Diff for /embedaddon/quagga/zebra/zebra_snmp.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2012/02/21 17:26:11 version 1.1.1.2, 2013/07/21 23:54:41
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 156  ipFwNumber (struct variable *v, oid objid[], size_t *o Line 150  ipFwNumber (struct variable *v, oid objid[], size_t *o
   /* Return number of routing entries. */    /* Return number of routing entries. */
   result = 0;    result = 0;
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       result++;        result++;
   
   return (u_char *)&result;    return (u_char *)&result;
Line 181  ipCidrNumber (struct variable *v, oid objid[], size_t  Line 175  ipCidrNumber (struct variable *v, oid objid[], size_t 
   /* Return number of routing entries. */    /* Return number of routing entries. */
   result = 0;    result = 0;
   for (rn = route_top (table); rn; rn = route_next (rn))    for (rn = route_top (table); rn; rn = route_next (rn))
    for (rib = rn->info; rib; rib = rib->next)    RNODE_FOREACH_RIB (rn, rib)
       result++;        result++;
   
   return (u_char *)&result;    return (u_char *)&result;
Line 375  get_fwtable_route_node(struct variable *v, oid objid[] Line 369  get_fwtable_route_node(struct variable *v, oid objid[]
         {          {
           if (!in_addr_cmp(&(*np)->p.u.prefix, (u_char *)&dest))            if (!in_addr_cmp(&(*np)->p.u.prefix, (u_char *)&dest))
             {              {
              for (*rib = (*np)->info; *rib; *rib = (*rib)->next)              RNODE_FOREACH_RIB (*np, *rib)
                 {                  {
                   if (!in_addr_cmp((u_char *)&(*rib)->nexthop->gate.ipv4,                    if (!in_addr_cmp((u_char *)&(*rib)->nexthop->gate.ipv4,
                                    (u_char *)&nexthop))                                     (u_char *)&nexthop))
Line 394  get_fwtable_route_node(struct variable *v, oid objid[] Line 388  get_fwtable_route_node(struct variable *v, oid objid[]
   
       /* Check destination first */        /* Check destination first */
       if (in_addr_cmp(&np2->p.u.prefix, (u_char *)&dest) > 0)        if (in_addr_cmp(&np2->p.u.prefix, (u_char *)&dest) > 0)
        for (rib2 = np2->info; rib2; rib2 = rib2->next)        RNODE_FOREACH_RIB (np2, rib2)
           check_replace(np2, rib2, np, rib);            check_replace(np2, rib2, np, rib);
   
       if (in_addr_cmp(&np2->p.u.prefix, (u_char *)&dest) == 0)        if (in_addr_cmp(&np2->p.u.prefix, (u_char *)&dest) == 0)
         { /* have to look at each rib individually */          { /* have to look at each rib individually */
          for (rib2 = np2->info; rib2; rib2 = rib2->next)          RNODE_FOREACH_RIB (np2, rib2)
             {              {
               int proto2, policy2;                int proto2, policy2;
   
Line 457  ipFwTable (struct variable *v, oid objid[], size_t *ob Line 451  ipFwTable (struct variable *v, oid objid[], size_t *ob
   static struct in_addr netmask;    static struct in_addr netmask;
   struct nexthop *nexthop;    struct nexthop *nexthop;
   
     if (smux_header_table(v, objid, objid_len, exact, val_len, write_method)
         == MATCH_FAILED)
       return NULL;
   
   get_fwtable_route_node(v, objid, objid_len, exact, &np, &rib);    get_fwtable_route_node(v, objid, objid_len, exact, &np, &rib);
   if (!np)    if (!np)
     return NULL;      return NULL;
Line 555  static u_char * Line 553  static u_char *
 ipCidrTable (struct variable *v, oid objid[], size_t *objid_len,  ipCidrTable (struct variable *v, oid objid[], size_t *objid_len,
              int exact, size_t *val_len, WriteMethod **write_method)               int exact, size_t *val_len, WriteMethod **write_method)
 {  {
     if (smux_header_table(v, objid, objid_len, exact, val_len, write_method)
         == MATCH_FAILED)
       return NULL;
   
   switch (v->magic)    switch (v->magic)
     {      {
     case IPCIDRROUTEDEST:      case IPCIDRROUTEDEST:

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


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