diff options
author | Michael Mann <mmann78@netscape.net> | 2013-10-19 18:52:13 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-10-19 18:52:13 +0000 |
commit | 3635bea0a4bccd33956cc10a9750f248cfcb4efc (patch) | |
tree | 1a51248375c3c4d8ca09f3d01891bff5a8623f4c /epan/oids.c | |
parent | b752cfa88dcd001ab6d591a9e337d48c885861c8 (diff) | |
download | wireshark-3635bea0a4bccd33956cc10a9750f248cfcb4efc.tar.gz wireshark-3635bea0a4bccd33956cc10a9750f248cfcb4efc.tar.bz2 wireshark-3635bea0a4bccd33956cc10a9750f248cfcb4efc.zip |
Add OID unit tests. Bug 9294 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9294)
From Ed Beroset
svn path=/trunk/; revision=52692
Diffstat (limited to 'epan/oids.c')
-rw-r--r-- | epan/oids.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/epan/oids.c b/epan/oids.c index bb89144077..848098235c 100644 --- a/epan/oids.c +++ b/epan/oids.c @@ -88,10 +88,7 @@ static const oid_value_type_t unknown_type = { FT_BYTES, BASE_NONE, BER_CLAS static oid_info_t oid_root = { 0, NULL, OID_KIND_UNKNOWN, NULL, &unknown_type, -2, NULL, NULL, NULL}; -static oid_info_t* add_oid(const char* name, oid_kind_t kind, const oid_value_type_t* type, oid_key_t* key, guint oid_len, guint32 *subids) { - guint i = 0; - oid_info_t* c = &oid_root; - +static void prepopulate_oids(void) { if (!oid_root.children) { char* debug_env = getenv("WIRESHARK_DEBUG_MIBS"); guint32 subid; @@ -108,7 +105,15 @@ static oid_info_t* add_oid(const char* name, oid_kind_t kind, const oid_value_ty subid = 1; oid_add("iso",1,&subid); subid = 2; oid_add("joint-iso-itu-t",1,&subid); } +} + + + +static oid_info_t* add_oid(const char* name, oid_kind_t kind, const oid_value_type_t* type, oid_key_t* key, guint oid_len, guint32 *subids) { + guint i = 0; + oid_info_t* c = &oid_root; + prepopulate_oids(); oid_len--; do { @@ -813,6 +818,7 @@ void oid_pref_init(module_t *nameres) } void oids_init(void) { + prepopulate_oids(); #ifdef HAVE_LIBSMI register_mibs(); #else |