the ldap values for supportedControl and supportedCapabilities is an oid in ascii...
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 6 Aug 2006 14:04:07 +0000 (14:04 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 6 Aug 2006 14:04:07 +0000 (14:04 +0000)
resolve it into a anme if possible and present it.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18842 f5534014-38df-0310-8fa8-9805f1628bb7

asn1/ldap/packet-ldap-template.c
epan/dissectors/packet-ldap.c

index 3d2beec608bbf3f4292622e15d1b04853ef7d8db..d4722c4a8c114376de3ddcc9af17f36122d9c82f 100644 (file)
@@ -1171,6 +1171,30 @@ dissect_normal_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        return;
 }
 
+static void
+dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+       char *oid, *oidname;
+
+       /* tvb here contains an ascii string that is really an oid */
+/* XXX   we should convert the string oid into a real oid so we can use
+ *       proto_tree_add_oid() instead.
+ */
+
+       oid=tvb_get_ephemeral_string(tvb, 0, tvb_length(tvb));
+       if(!oid){
+               return;
+       }
+
+       oidname=get_oid_str_name(oid);
+
+       if(oidname){
+               proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "OID: %s (%s)",oid,oidname);
+       } else {
+               proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "OID: %s",oid);
+       }
+}
+
 static void
 dissect_ldap_guid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
@@ -1529,6 +1553,8 @@ proto_reg_handoff_ldap(void)
 
        register_ldap_name_dissector("netlogon", dissect_NetLogon_PDU, proto_cldap);
        register_ldap_name_dissector("objectGUID", dissect_ldap_guid, proto_ldap);
+       register_ldap_name_dissector("supportedControl", dissect_ldap_oid, proto_ldap);
+       register_ldap_name_dissector("supportedCapabilities", dissect_ldap_oid, proto_ldap);
 }
 
 
index 5a25fb1755f4975509195b488296dd80a0dcbd0b..897de2ef9b6fb48b4d7b67b3825f2e42846964be 100644 (file)
@@ -3410,6 +3410,30 @@ dissect_normal_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        return;
 }
 
+static void
+dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+       char *oid, *oidname;
+
+       /* tvb here contains an ascii string that is really an oid */
+/* XXX   we should convert the string oid into a real oid so we can use
+ *       proto_tree_add_oid() instead.
+ */
+
+       oid=tvb_get_ephemeral_string(tvb, 0, tvb_length(tvb));
+       if(!oid){
+               return;
+       }
+
+       oidname=get_oid_str_name(oid);
+
+       if(oidname){
+               proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "OID: %s (%s)",oid,oidname);
+       } else {
+               proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "OID: %s",oid);
+       }
+}
+
 static void
 dissect_ldap_guid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
@@ -4073,7 +4097,7 @@ void proto_register_ldap(void) {
         "ExtendedResponse/response", HFILL }},
 
 /*--- End of included file: packet-ldap-hfarr.c ---*/
-#line 1445 "packet-ldap-template.c"
+#line 1469 "packet-ldap-template.c"
   };
 
   /* List of subtrees */
@@ -4126,7 +4150,7 @@ void proto_register_ldap(void) {
     &ett_ldap_ExtendedResponse,
 
 /*--- End of included file: packet-ldap-ettarr.c ---*/
-#line 1456 "packet-ldap-template.c"
+#line 1480 "packet-ldap-template.c"
   };
 
     module_t *ldap_module;
@@ -4203,6 +4227,8 @@ proto_reg_handoff_ldap(void)
 
        register_ldap_name_dissector("netlogon", dissect_NetLogon_PDU, proto_cldap);
        register_ldap_name_dissector("objectGUID", dissect_ldap_guid, proto_ldap);
+       register_ldap_name_dissector("supportedControl", dissect_ldap_oid, proto_ldap);
+       register_ldap_name_dissector("supportedCapabilities", dissect_ldap_oid, proto_ldap);
 }