== MATCH_FAILED)
return NULL;
+ if (!rip)
+ return NULL;
+
/* Retrun global counter. */
switch (v->magic) {
case RIP2GLOBALROUTECHANGES:
- return SNMP_INTEGER(rip_global_route_changes);
+ return SNMP_INTEGER(rip->counters.route_changes);
break;
case RIP2GLOBALQUERIES:
- return SNMP_INTEGER(rip_global_queries);
+ return SNMP_INTEGER(rip->counters.queries);
break;
default:
return NULL;
inet_ntoa(rp->p.u.prefix4), rp->p.prefixlen);
}
- rip_global_route_changes++;
+ rip->counters.route_changes++;
}
/* Add/update ECMP routes to zebra. */
/* RIP Structure. */
struct rip *rip = NULL;
-/* RIP route changes. */
-long rip_global_route_changes = 0;
-
-/* RIP queries. */
-long rip_global_queries = 0;
-
/* Prototypes. */
static void rip_output_process(struct connected *, struct sockaddr_in *, int,
uint8_t);
(void)rip_send_packet((uint8_t *)packet, size, from, ifc);
}
- rip_global_queries++;
+ rip->counters.queries++;
}
/* First entry point of RIP packet. */
/* For distribute-list container */
struct distribute_ctx *distribute_ctx;
+
+ /* Counters for SNMP. */
+ struct {
+ /* RIP route changes. */
+ long route_changes;
+
+ /* RIP queries. */
+ long queries;
+ } counters;
};
/* RIP routing table entry which belong to rip_packet. */
/* Master thread strucutre. */
extern struct thread_master *master;
-/* RIP statistics for SNMP. */
-extern long rip_global_route_changes;
-extern long rip_global_queries;
-
DECLARE_HOOK(rip_ifaddr_add, (struct connected * ifc), (ifc))
DECLARE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc))