Get rid of most of the legacy oid stuff.

svn path=/trunk/; revision=23333
This commit is contained in:
Anders Broman 2007-11-01 22:07:43 +00:00
parent 24976b1d92
commit dbcabb1938
7 changed files with 10 additions and 23 deletions

View File

@ -53,7 +53,7 @@ ReplControlValue B "1.2.840.113556.1.4.841" "replControlValue"
return offset;
object_identifier_id = tvb_get_ephemeral_string(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
name = get_oid_str_name(object_identifier_id);
name = oid_resolved_from_string(object_identifier_id);
if(name){
item = get_ber_last_created_item();

View File

@ -3140,7 +3140,7 @@ printf("OBJECT IDENTIFIER dissect_ber_object_identifier(%s) entered\n",name);
if (hfi->type == FT_OID) {
actx->created_item = proto_tree_add_item(tree, hf_id, tvb, offset, len, FALSE);
} else if (IS_FT_STRING(hfi->type)) {
str = oid_to_str(tvb_get_ptr(tvb, offset, len), len);
str = oid_encoded2string(tvb_get_ptr(tvb, offset, len), len);
actx->created_item = proto_tree_add_string(tree, hf_id, tvb, offset, len, str);
if(actx->created_item){
/* see if we know the name of this oid */
@ -3168,7 +3168,7 @@ int dissect_ber_object_identifier_str(gboolean implicit_tag, asn1_ctx_t *actx, p
if (value_string) {
if (value_tvb && (length = tvb_length(value_tvb))) {
*value_string = oid_to_str(tvb_get_ptr(value_tvb, 0, length), length);
*value_string = oid_encoded2string(tvb_get_ptr(value_tvb, 0, length), length);
} else {
*value_string = "";
}

View File

@ -2359,7 +2359,7 @@ dissect_ldap_LDAPOID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U
return offset;
object_identifier_id = tvb_get_ephemeral_string(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0));
name = get_oid_str_name(object_identifier_id);
name = oid_resolved_from_string(object_identifier_id);
if(name){
item = get_ber_last_created_item();

View File

@ -881,7 +881,7 @@ DEBUG_ENTRY("dissect_per_object_identifier");
if (hfi->type == FT_OID) {
item = proto_tree_add_item(tree, hf_index, val_tvb, 0, length, FALSE);
} else if (IS_FT_STRING(hfi->type)) {
str = oid_to_str(tvb_get_ptr(val_tvb, 0, length), length);
str = oid_encoded2string(tvb_get_ptr(val_tvb, 0, length), length);
item = proto_tree_add_string(tree, hf_index, val_tvb, 0, length, str);
} else {
DISSECTOR_ASSERT_NOT_REACHED();
@ -904,7 +904,7 @@ dissect_per_object_identifier_str(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *act
if (value_string) {
if (value_tvb && (length = tvb_length(value_tvb))) {
*value_string = oid_to_str(tvb_get_ptr(value_tvb, 0, length), length);
*value_string = oid_encoded2string(tvb_get_ptr(value_tvb, 0, length), length);
} else {
*value_string = "";
}

View File

@ -155,20 +155,7 @@ extern void oid_add_from_string(const char* name, const gchar *oid_str);
/* macros for legacy oid functions */
/* from former oid_resolv.h */
#define add_oid_name(oid, oid_len, name) oid_add_from_encoded(name,oid,oid_len)
#define get_oid_str_name(oidstr) oid_resolved_from_string(oidstr)
#define get_oid_name(encoid, encoid_len) oid_resolved_from_encoded(encoid, encoid_len)
#define oid_resolv_enabled() (1)
#define oid_resolv_cleanup() ((void)0)
/* from to_str.h */
#define oid_to_str(encoid, encoid_len) oid_encoded2string(encoid, encoid_len)
/* from former dissectors/format_oid.h */
#define format_oid(oid, oid_length) ((void*)oid_resolved(oid_length,oid))
#define new_format_oid(oid, oid_length, non_decoded, decoded) oid_both(oid_length, oid, non_decoded, decoded)
#define subid_t guint32

View File

@ -4075,15 +4075,15 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
case FT_OID:
bytes = fvalue_get(&fi->value);
name = (oid_resolv_enabled()) ? oid_resolved_from_encoded(bytes, fvalue_length(&fi->value)) : NULL;
name = oid_resolved_from_encoded(bytes, fvalue_length(&fi->value));
if (name) {
ret = g_snprintf(label_str, ITEM_LABEL_LENGTH,
"%s: %s (%s)", hfinfo->name,
oid_to_str(bytes, fvalue_length(&fi->value)), name);
oid_encoded2string(bytes, fvalue_length(&fi->value)), name);
} else {
ret = g_snprintf(label_str, ITEM_LABEL_LENGTH,
"%s: %s", hfinfo->name,
oid_to_str(bytes, fvalue_length(&fi->value)));
oid_encoded2string(bytes, fvalue_length(&fi->value)));
}
if ((ret == -1) || (ret >= ITEM_LABEL_LENGTH))
label_str[ITEM_LABEL_LENGTH - 1] = '\0';

View File

@ -315,7 +315,7 @@ static int dissect_octet_string(tvbuff_t *tvb, proto_tree *tree, int offset, cha
}
/* XXX - Is there a particular reason we're not using oid_to_str() here? */
/* XXX - Is there a particular reason we're not using oid_encoded2string() here? */
static int convert_oid_to_str(guint32 *oid, int len, char* str, int slen, char prefix)
{
int i, tlen = 0;