static oid ospfv3_trap_oid[] = {OSPFv3MIB, 0};
/* Hook functions. */
-static u_char *ospfv3GeneralGroup(struct variable *, oid *, size_t *, int,
+static uint8_t *ospfv3GeneralGroup(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+static uint8_t *ospfv3AreaEntry(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+static uint8_t *ospfv3WwLsdbEntry(struct variable *, oid *, size_t *, int,
size_t *, WriteMethod **);
-static u_char *ospfv3AreaEntry(struct variable *, oid *, size_t *, int,
+static uint8_t *ospfv3NbrEntry(struct variable *, oid *, size_t *, int,
size_t *, WriteMethod **);
-static u_char *ospfv3WwLsdbEntry(struct variable *, oid *, size_t *, int,
- size_t *, WriteMethod **);
-static u_char *ospfv3NbrEntry(struct variable *, oid *, size_t *, int, size_t *,
+static uint8_t *ospfv3IfEntry(struct variable *, oid *, size_t *, int, size_t *,
WriteMethod **);
-static u_char *ospfv3IfEntry(struct variable *, oid *, size_t *, int, size_t *,
- WriteMethod **);
static struct variable ospfv3_variables[] = {
/* OSPF general variables */
{1, 9, 1, 15}},
};
-static u_char *ospfv3GeneralGroup(struct variable *v, oid *name, size_t *length,
- int exact, size_t *var_len,
- WriteMethod **write_method)
+static uint8_t *ospfv3GeneralGroup(struct variable *v, oid *name,
+ size_t *length, int exact, size_t *var_len,
+ WriteMethod **write_method)
{
- u_int16_t sum;
- u_int32_t count;
+ uint16_t sum;
+ uint32_t count;
struct ospf6_lsa *lsa = NULL;
/* Check whether the instance identifier is valid */
return NULL;
}
-static u_char *ospfv3AreaEntry(struct variable *v, oid *name, size_t *length,
- int exact, size_t *var_len,
- WriteMethod **write_method)
+static uint8_t *ospfv3AreaEntry(struct variable *v, oid *name, size_t *length,
+ int exact, size_t *var_len,
+ WriteMethod **write_method)
{
struct ospf6_area *oa, *area = NULL;
struct ospf6_lsa *lsa = NULL;
- u_int32_t area_id = 0;
- u_int32_t count;
- u_int16_t sum;
+ uint32_t area_id = 0;
+ uint32_t count;
+ uint16_t sum;
struct listnode *node;
unsigned int len;
char a[16];
inet_ntop(AF_INET, &area_id, a, sizeof(a));
zlog_debug("SNMP access by area: %s, exact=%d len=%d length=%lu", a,
- exact, len, (u_long)*length);
+ exact, len, (unsigned long)*length);
for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, node, oa)) {
if (area == NULL) {
inet_ntop(AF_INET, &area->area_id, a, sizeof(a));
zlog_debug("SNMP found area: %s, exact=%d len=%d length=%lu", a, exact,
- len, (u_long)*length);
+ len, (unsigned long)*length);
switch (v->magic) {
case OSPFv3IMPORTASEXTERN:
return (ifp1->ifindex - ifp2->ifindex);
}
-static u_char *ospfv3WwLsdbEntry(struct variable *v, oid *name, size_t *length,
- int exact, size_t *var_len,
- WriteMethod **write_method)
+static uint8_t *ospfv3WwLsdbEntry(struct variable *v, oid *name, size_t *length,
+ int exact, size_t *var_len,
+ WriteMethod **write_method)
{
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct ospf6_lsa *lsa = NULL;
ifindex_t ifindex;
uint32_t area_id, id, instid, adv_router;
- u_int16_t type;
+ uint16_t type;
int len;
oid *offset;
int offsetlen;
if (len)
id = htonl(*offset);
offset += len;
- offsetlen -= len;
+ // offsetlen -= len; // Add back in if we need it again
if (exact) {
if (v->magic & OSPFv3WWASTABLE) {
if (!ifslist)
return NULL;
ifslist->cmp = (int (*)(void *, void *))if_icmp_func;
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node,
- iif))
+ FOR_ALL_INTERFACES (vrf, iif)
listnode_add_sort(ifslist, iif);
for (ALL_LIST_ELEMENTS_RO(ifslist, node, iif)) {
break;
case OSPFv3WWLSDBADVERTISEMENT:
*var_len = ntohs(lsa->header->length);
- return (u_char *)lsa->header;
+ return (uint8_t *)lsa->header;
break;
case OSPFv3WWLSDBTYPEKNOWN:
return SNMP_INTEGER(OSPF6_LSA_IS_KNOWN(lsa->header->type)
return NULL;
}
-static u_char *ospfv3IfEntry(struct variable *v, oid *name, size_t *length,
- int exact, size_t *var_len,
- WriteMethod **write_method)
+static uint8_t *ospfv3IfEntry(struct variable *v, oid *name, size_t *length,
+ int exact, size_t *var_len,
+ WriteMethod **write_method)
{
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
ifindex_t ifindex = 0;
unsigned int instid = 0;
struct ospf6_interface *oi = NULL;
struct list *ifslist;
oid *offset;
int offsetlen, len;
- u_int32_t sum;
+ uint32_t sum;
if (smux_header_table(v, name, length, exact, var_len, write_method)
== MATCH_FAILED)
len = (offsetlen < 1 ? 0 : 1);
if (len)
instid = *offset;
- offset += len;
- offsetlen -= len;
+ // offset += len; // Add back in if we ever start using again
+ // offsetlen -= len;
if (exact) {
oi = ospf6_interface_lookup_by_ifindex(ifindex);
if (!ifslist)
return NULL;
ifslist->cmp = (int (*)(void *, void *))if_icmp_func;
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), i, iif))
+ FOR_ALL_INTERFACES (vrf, iif)
listnode_add_sort(ifslist, iif);
for (ALL_LIST_ELEMENTS_RO(ifslist, i, iif)) {
return NULL;
}
-static u_char *ospfv3NbrEntry(struct variable *v, oid *name, size_t *length,
- int exact, size_t *var_len,
- WriteMethod **write_method)
+static uint8_t *ospfv3NbrEntry(struct variable *v, oid *name, size_t *length,
+ int exact, size_t *var_len,
+ WriteMethod **write_method)
{
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
ifindex_t ifindex = 0;
unsigned int instid, rtrid;
struct ospf6_interface *oi = NULL;
len = (offsetlen < 1 ? 0 : 1);
if (len)
rtrid = htonl(*offset);
- offset += len;
- offsetlen -= len;
+ // offset += len; // Add back in if we ever start looking at data
+ // offsetlen -= len;
if (exact) {
oi = ospf6_interface_lookup_by_ifindex(ifindex);
if (!ifslist)
return NULL;
ifslist->cmp = (int (*)(void *, void *))if_icmp_func;
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), i, iif))
+ FOR_ALL_INTERFACES (vrf, iif)
listnode_add_sort(ifslist, iif);
for (ALL_LIST_ELEMENTS_RO(ifslist, i, iif)) {
return SNMP_INTEGER(2); /* IPv6 only */
case OSPFv3NBRADDRESS:
*var_len = sizeof(struct in6_addr);
- return (u_char *)&on->linklocal_addr;
+ return (uint8_t *)&on->linklocal_addr;
case OSPFv3NBROPTIONS:
return SNMP_INTEGER(on->options[2]);
case OSPFv3NBRPRIORITY: