static void oids_test_2string_subids_abs(void) { const gchar* oid; oid = oid_subid2string(ex1.subids, ex1.subids_len); g_assert_cmpstr(oid, ==, ex1.string); }
void oid_add(const char* name, guint oid_len, guint32 *subids) { g_assert(subids && *subids <= 2); if (oid_len) { D(3,("\tOid (from subids): %s %s ",name?name:"NULL", oid_subid2string(subids,oid_len))); add_oid(name,OID_KIND_UNKNOWN,NULL,NULL,oid_len,subids); } else { D(1,("Failed to add Oid: %s (from subids)",name?name:"NULL")); } }
extern void oid_add_from_encoded(const char* name, const guint8 *oid, gint oid_len) { guint32* subids; guint subids_len = oid_encoded2subid(oid, oid_len, &subids); if (subids_len) { D(3,("\tOid (from encoded): %s %s ",name, oid_subid2string(subids,subids_len))); add_oid(name,OID_KIND_UNKNOWN,NULL,NULL,subids_len,subids); } else { D(1,("Failed to add Oid: %s [%d]%s ",name?name:"NULL", oid_len,bytestring_to_str(oid, oid_len, ':'))); } }
void oid_add_from_string(const char* name, const gchar *oid_str) { guint32* subids; guint oid_len = oid_string2subid(oid_str, &subids); if (oid_len) { D(3,("\tOid (from string): %s %s ",name?name:"NULL", oid_subid2string(subids,oid_len))); add_oid(name,OID_KIND_UNKNOWN,NULL,NULL,oid_len,subids); } else { D(1,("Failed to add Oid: %s %s ",name?name:"NULL", oid_str?oid_str:NULL)); } }
extern void oid_add_from_encoded(const char* name, const guint8 *oid, gint oid_len) { guint32* subids = NULL; guint subids_len = oid_encoded2subid(NULL, oid, oid_len, &subids); if (subids_len) { gchar* sub = oid_subid2string(NULL, subids,subids_len); D(3,("\tOid (from encoded): %s %s ",name, sub)); add_oid(name,OID_KIND_UNKNOWN,NULL,NULL,subids_len,subids); wmem_free(NULL, sub); } else { gchar* bytestr = bytestring_to_str(NULL, oid, oid_len, ':'); D(1,("Failed to add Oid: %s [%d]%s ",name?name:"NULL", oid_len, bytestr)); wmem_free(NULL, bytestr); } wmem_free(NULL, subids); }