diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/smux.h | 2 | ||||
-rw-r--r-- | lib/snmp.c | 20 |
2 files changed, 22 insertions, 0 deletions
@@ -75,6 +75,8 @@ extern void smux_register_mib(const char *, struct variable *, size_t, int, oid [], size_t); extern int smux_header_generic (struct variable *, oid [], size_t *, int, size_t *, WriteMethod **); +extern int smux_header_table (struct variable *, oid *, size_t *, + int, size_t *, WriteMethod **); /* For traps, three OID are provided: @@ -110,4 +110,24 @@ smux_header_generic (struct variable *v, oid *name, size_t *length, int exact, return MATCH_SUCCEEDED; } + +int +smux_header_table (struct variable *v, oid *name, size_t *length, int exact, + size_t *var_len, WriteMethod **write_method) +{ + /* If the requested OID name is less than OID prefix we + handle, adjust it to our prefix. */ + if ((oid_compare (name, *length, v->name, v->namelen)) < 0) + { + if (exact) + return MATCH_FAILED; + oid_copy(name, v->name, v->namelen); + *length = v->namelen; + } + + *write_method = 0; + *var_len = sizeof(long); + + return MATCH_SUCCEEDED; +} #endif /* HAVE_SNMP */ |