Home | Documentation | Development | Download
#include <rssnmp/snmp.h>
Function | Description |
---|---|
rssnmp_oid_v2a | Convert OID from vector to string form. |
rssnmp_oid_a2v | Convert OID from string to vector form. |
rssnmp_oid_cmp | Compare two OIDs in vector form. |
rssnmp_oid_copy | Create an OID copy. |
char *rssnmp_oid_v2a(rssnmp_oid_t *v, int v_size, char *buff, int buff_size);
rssnmp_oid_t *rssnmp_oid_a2v(char *a, int *v_size);
An OID in RSSNMP is represented by a vector of integers. These functions will help you convert
these vectors in string and vice-versa. The rssnmp_oid_v2a
function converts
the vector v
, with size v_size
into a string
and writes it in buff
, with it's size given by
buff_size
.
The rssnmp_oid_a2v
, on the other hand, does the opposite: it converts the
string a
into a vector, writing its size in the memmory area pointed by
v_size
.
Both functions will return NULL
on error.
rssnmp_oid_t *rssnmp_oid_copy(rssnmp_oid_t *oid, int size);
This function will instance a new OID and copy the first size
elements of the vector oid
.
Will return NULL
on error.
int rssnmp_oid_cmp(rssnmp_oid_t *a, rssnmp_oid_t *b, int size);
The rssnmp_oid_cmp
function compares the first size
elements of the vector a
and b
and returns the
difference.
Returns an integer less than, equal to, or greater than zero if the first size
bytes of a
is found, respectively, to be less than, to match, or be greater than
the first size
bytes of b
.
Copyright (c) 2011, Alain-Jacques L. de Burlet - All rights reserved.