16#include "ws_symbol_export.h"
38typedef enum _oid_key_type_t {
46 OID_KEY_TYPE_IMPLIED_OID,
47 OID_KEY_TYPE_IMPLIED_STRING,
48 OID_KEY_TYPE_IMPLIED_BYTES,
50 OID_KEY_TYPE_DATE_AND_TIME
60 oid_key_type_t keytype;
64typedef enum _oid_kind_t {
71 OID_KIND_NOTIFICATION,
80 oid_key_type_t key_type;
105WS_DLL_PUBLIC
void oids_init(
const char* app_env_var_prefix);
107extern void oid_pref_init(
module_t *nameres);
133unsigned oid_subid2encoded(
wmem_allocator_t *scope,
unsigned len, uint32_t* subids, uint8_t** encoded_p);
135unsigned oid_string2encoded(
wmem_allocator_t *scope,
const char *oid_str, uint8_t** encoded_p);
139unsigned oid_encoded2subid(
wmem_allocator_t *scope,
const uint8_t *oid,
int len, uint32_t** subids_p);
141unsigned oid_encoded2subid_sub(
wmem_allocator_t *scope,
const uint8_t *oid_bytes,
int oid_len, uint32_t** subids_pi,
144unsigned oid_string2subid(
wmem_allocator_t *scope,
const char *oid_str, uint32_t** subids_p);
146WS_DLL_PUBLIC
char* oid_encoded2string(
wmem_allocator_t *scope,
const uint8_t* encoded,
unsigned len);
147WS_DLL_PUBLIC
char* rel_oid_encoded2string(
wmem_allocator_t *scope,
const uint8_t* encoded,
unsigned len);
181WS_DLL_PUBLIC
char *oid_resolved_from_encoded(
wmem_allocator_t *scope,
const uint8_t *oid,
int len);
213WS_DLL_PUBLIC
void oid_both(
wmem_allocator_t *scope,
unsigned oid_len, uint32_t *subids,
char** resolved_p,
char** numeric_p);
241WS_DLL_PUBLIC
oid_info_t* oid_get(
unsigned oid_len, uint32_t *subids,
unsigned* matched_p,
unsigned* left_p);
269WS_DLL_PUBLIC
void oid_add(
const char* name,
unsigned oid_len, uint32_t *subids);
270WS_DLL_PUBLIC
void oid_add_from_encoded(
const char* name,
const uint8_t *oid,
int oid_len);
271WS_DLL_PUBLIC
void oid_add_from_string(
const char* name,
const char *oid_str);
283#define subid_t uint32_t
288extern char* oid_test_a2b(uint32_t num_subids, uint32_t* subids);
291#define add_oid_debug_subtree(a,b) ((void)0)
WS_DLL_PUBLIC char * oid_subid2string(wmem_allocator_t *scope, uint32_t *subids, unsigned len)
Convert a sequence of OID sub-identifiers to a human-readable string.
Definition oids.c:878
WS_DLL_PUBLIC char * rel_oid_resolved_from_encoded(wmem_allocator_t *scope, const uint8_t *oid, int len)
Resolve an OID from its encoded form.
Definition oids.c:1097
WS_DLL_PUBLIC void oid_both_from_string(wmem_allocator_t *scope, const char *oid_str, char **resolved_p, char **numeric_p)
Resolve and convert an OID from its string representation to both resolved and numeric forms.
Definition oids.c:1265
WS_DLL_PUBLIC void oids_init(const char *app_env_var_prefix)
Initialize OID resolution and register related preferences.
WS_DLL_PUBLIC char * oid_resolved(wmem_allocator_t *scope, unsigned len, uint32_t *subids)
Resolve an OID to its human-readable name.
WS_DLL_PUBLIC void oid_both(wmem_allocator_t *scope, unsigned oid_len, uint32_t *subids, char **resolved_p, char **numeric_p)
Resolve and convert an OID to both resolved and numeric representations.
Definition oids.c:1252
WS_DLL_PUBLIC char * oid_resolved_from_string(wmem_allocator_t *scope, const char *oid_str)
Resolves an OID string to its resolved form.
Definition oids.c:1207
WS_DLL_PUBLIC void oid_both_from_encoded(wmem_allocator_t *scope, const uint8_t *oid, int oid_len, char **resolved_p, char **numeric_p)
Resolve and convert an OID from its encoded form to both resolved and numeric representations.
Definition oids.c:1257
WS_DLL_PUBLIC oid_info_t * oid_get_from_encoded(wmem_allocator_t *scope, const uint8_t *oid, int oid_len, uint32_t **subids, unsigned *matched, unsigned *left)
Retrieves an OID information structure from its encoded form.
Definition oids.c:1077
WS_DLL_PUBLIC oid_info_t * oid_get_from_string(wmem_allocator_t *scope, const char *oid_str, uint32_t **subids, unsigned *matched, unsigned *left)
Retrieves an OID information structure from a string representation.
Definition oids.c:1082
WS_DLL_PUBLIC char * oid_get_default_mib_path(const char *app_env_var_prefix)
Fetch the default MIB/PIB path.
WS_DLL_PUBLIC void oids_cleanup(void)
Clean up OID-related resources.
Definition oids.c:870
WS_DLL_PUBLIC char * rel_oid_subid2string(wmem_allocator_t *scope, uint32_t *subids, unsigned len, bool is_absolute)
Convert a sequence of OID subidentifiers to a human-readable string.
Definition oids.c:881
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
Internal representation of a wmem balanced tree.
Definition wmem_tree-int.h:81
Definition prefs-int.h:24