From 0d020cd6d98f454f22723f404da99fa48b7b2751 Mon Sep 17 00:00:00 2001 From: Pat Ruddy Date: Mon, 28 Sep 2020 16:35:35 +0100 Subject: bgpd, lib: add mplsL3VpnVrf table Add SNMP support for L3vpn Vrf table as defined in [RFC4382] Keep track of vrf status for the table and for future traps. Signed-off-by: Pat Ruddy --- lib/snmp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lib/snmp.c') diff --git a/lib/snmp.c b/lib/snmp.c index 736a3c62b8..cc317d7a3b 100644 --- a/lib/snmp.c +++ b/lib/snmp.c @@ -78,6 +78,34 @@ void oid_copy_addr(oid oid[], const struct in_addr *addr, int len) oid[i] = *pnt++; } +void oid2string(oid oid[], int len, char *string) +{ + int i; + uint8_t *pnt; + + if (len == 0) + return; + + pnt = (uint8_t *)string; + + for (i = 0; i < len; i++) + *pnt++ = oid[i]; +} + +void oid_copy_str(oid oid[], const char *string, int len) +{ + int i; + const uint8_t *pnt; + + if (len == 0) + return; + + pnt = (uint8_t *)string; + + for (i = 0; i < len; i++) + oid[i] = *pnt++; +} + int smux_header_generic(struct variable *v, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) { -- cgit v1.2.3