Пример #1
0
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, ':')));
	}
}
Пример #2
0
static void
oids_test_2subids_encoded_long(void)
{
    guint32 *subids = NULL;
    guint len;
    guint i;

    len = oid_encoded2subid(ex3.encoded, ex3.encoded_len, &subids);
    g_assert(len == ex3.subids_len);
    for (i=0; i < len; i++)
        g_assert(subids[i] == ex3.subids[i]);
}
Пример #3
0
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);
}