openbsd-ports/net/zebra/patches/patch-ospfd_ospf_snmp_c

109 lines
3.5 KiB
Plaintext

$OpenBSD: patch-ospfd_ospf_snmp_c,v 1.1 2002/07/17 21:57:23 mickey Exp $
--- ospfd/ospf_snmp.c.orig Sat Jul 6 03:36:57 2002
+++ ospfd/ospf_snmp.c Wed Jul 17 17:50:35 2002
@@ -1115,6 +1115,9 @@ ospfAreaRangeLookup (struct variable *v,
int len;
struct ospf_area *area;
struct ospf_area_range *range;
+ struct prefix_ipv4 p;
+ p.family = AF_INET;
+ p.prefixlen = IPV4_MAX_BITLEN;
if (exact)
{
@@ -1136,8 +1139,9 @@ ospfAreaRangeLookup (struct variable *v,
/* Lookup area range. */
oid2in_addr (offset, IN_ADDR_SIZE, range_net);
+ p.prefix = *range_net;
- return ospf_area_range_lookup (area, range_net);
+ return ospf_area_range_lookup (area, &p);
}
else
{
@@ -1201,7 +1205,6 @@ ospfAreaRangeEntry (struct variable *v,
{
struct ospf_area_range *range;
struct in_addr area_id;
-
struct in_addr range_net;
struct in_addr mask;
@@ -1217,7 +1220,7 @@ ospfAreaRangeEntry (struct variable *v,
return NULL;
/* Convert prefixlen to network mask format. */
- masklen2ip (range->node->p.prefixlen, &mask);
+ masklen2ip (range->subst_masklen, &mask);
/* Return the current value of the variable */
switch (v->magic)
@@ -1268,7 +1271,7 @@ ospfHostLookup (struct variable *v, oid
oid2in_addr (name + v->namelen, IN_ADDR_SIZE, addr);
- nbr_nbma = ospf_nbr_nbma_lookup_by_addr (*addr);
+ nbr_nbma = ospf_nbr_nbma_lookup (ospf_top, *addr);
return nbr_nbma;
}
@@ -1653,7 +1656,7 @@ ospfIfEntry (struct variable *v, oid *na
return SNMP_INTEGER (OSPF_POLL_INTERVAL_DEFAULT);
break;
case OSPFIFSTATE: /* 12 */
- return SNMP_INTEGER (oi->status);
+ return SNMP_INTEGER (oi->state);
break;
case OSPFIFDESIGNATEDROUTER: /* 13 */
return SNMP_IPADDRESS (DR (oi));
@@ -1662,7 +1665,7 @@ ospfIfEntry (struct variable *v, oid *na
return SNMP_IPADDRESS (BDR (oi));
break;
case OSPFIFEVENTS: /* 15 */
- return SNMP_INTEGER (oi->status_change);
+ return SNMP_INTEGER (oi->state_change);
break;
case OSPFIFAUTHKEY: /* 16 */
*var_len = 0;
@@ -1993,10 +1996,10 @@ ospfVirtIfEntry (struct variable *v, oid
return SNMP_INTEGER (OSPF_IF_PARAM (oi, v_wait));
break;
case OSPFVIRTIFSTATE:
- return SNMP_INTEGER (oi->status);
+ return SNMP_INTEGER (oi->state);
break;
case OSPFVIRTIFEVENTS:
- return SNMP_INTEGER (oi->status_change);
+ return SNMP_INTEGER (oi->state_change);
break;
case OSPFVIRTIFAUTHKEY:
*var_len = 0;
@@ -2031,7 +2034,7 @@ ospf_snmp_nbr_lookup (struct in_addr *nb
for (rn = route_top (oi->nbrs); rn; rn = route_next (rn))
if ((nbr = rn->info) != NULL
&& nbr != oi->nbr_self
- && nbr->status != NSM_Down
+ && nbr->state != NSM_Down
&& nbr->src.s_addr != 0)
{
if (IPV4_ADDR_SAME (&nbr->src, nbr_addr))
@@ -2059,7 +2062,7 @@ ospf_snmp_nbr_lookup_next (struct in_add
for (rn = route_top (oi->nbrs); rn; rn = route_next (rn))
if ((nbr = rn->info) != NULL
&& nbr != oi->nbr_self
- && nbr->status != NSM_Down
+ && nbr->state != NSM_Down
&& nbr->src.s_addr != 0)
{
if (first)
@@ -2173,7 +2176,7 @@ ospfNbrEntry (struct variable *v, oid *n
return SNMP_INTEGER (nbr->priority);
break;
case OSPFNBRSTATE:
- return SNMP_INTEGER (nbr->status);
+ return SNMP_INTEGER (nbr->state);
break;
case OSPFNBREVENTS:
return SNMP_INTEGER (nbr->state_change);