aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ldap.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-ldap.c')
-rw-r--r--epan/dissectors/packet-ldap.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 2606dc1c9b..a8398c4f36 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -430,16 +430,13 @@ static gchar *attr_type = NULL;
static gboolean is_binary_attr_type = FALSE;
static gboolean ldap_found_in_frame = FALSE;
-#define TCP_PORT_LDAP 389
+#define TCP_PORT_RANGE_LDAP "389,3268" /* 3268 is Windows 2000 Global Catalog */
#define TCP_PORT_LDAPS 636
#define UDP_PORT_CLDAP 389
-#define TCP_PORT_GLOBALCAT_LDAP 3268 /* Windows 2000 Global Catalog */
/* desegmentation of LDAP */
static gboolean ldap_desegment = TRUE;
-static guint global_ldap_tcp_port = TCP_PORT_LDAP;
static guint global_ldaps_tcp_port = TCP_PORT_LDAPS;
-static guint tcp_port = 0;
static guint ssl_port = 0;
static dissector_handle_t gssapi_handle;
@@ -3832,7 +3829,7 @@ static int dissect_PasswordPolicyResponseValue_PDU(tvbuff_t *tvb _U_, packet_inf
/*--- End of included file: packet-ldap-fn.c ---*/
-#line 916 "./asn1/ldap/packet-ldap-template.c"
+#line 913 "./asn1/ldap/packet-ldap-template.c"
static int dissect_LDAPMessage_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ldap_conv_info_t *ldap_info) {
int offset = 0;
@@ -5643,7 +5640,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
/*--- End of included file: packet-ldap-hfarr.c ---*/
-#line 2158 "./asn1/ldap/packet-ldap-template.c"
+#line 2155 "./asn1/ldap/packet-ldap-template.c"
};
/* List of subtrees */
@@ -5717,7 +5714,7 @@ void proto_register_ldap(void) {
&ett_ldap_T_warning,
/*--- End of included file: packet-ldap-ettarr.c ---*/
-#line 2172 "./asn1/ldap/packet-ldap-template.c"
+#line 2169 "./asn1/ldap/packet-ldap-template.c"
};
/* UAT for header fields */
static uat_field_t custom_attribute_types_uat_fields[] = {
@@ -5752,10 +5749,6 @@ void proto_register_ldap(void) {
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
&ldap_desegment);
- prefs_register_uint_preference(ldap_module, "tcp.port", "LDAP TCP Port",
- "Set the port for LDAP operations",
- 10, &global_ldap_tcp_port);
-
prefs_register_uint_preference(ldap_module, "ssl.port", "LDAPS TCP Port",
"Set the port for LDAP operations over SSL",
10, &global_ldaps_tcp_port);
@@ -5801,8 +5794,6 @@ proto_reg_handoff_ldap(void)
{
dissector_handle_t cldap_handle;
- dissector_add_uint("tcp.port", TCP_PORT_GLOBALCAT_LDAP, ldap_handle);
-
cldap_handle = create_dissector_handle(dissect_mscldap, proto_cldap);
dissector_add_uint("udp.port", UDP_PORT_CLDAP, cldap_handle);
@@ -5885,27 +5876,14 @@ proto_reg_handoff_ldap(void)
/*--- End of included file: packet-ldap-dis-tab.c ---*/
-#line 2323 "./asn1/ldap/packet-ldap-template.c"
-
+#line 2314 "./asn1/ldap/packet-ldap-template.c"
+ dissector_add_uint_range_with_preference("tcp.port", TCP_PORT_RANGE_LDAP, ldap_handle);
}
static void
prefs_register_ldap(void)
{
-
- if(tcp_port != global_ldap_tcp_port) {
- if(tcp_port)
- dissector_delete_uint("tcp.port", tcp_port, ldap_handle);
-
- /* Set our port number for future use */
- tcp_port = global_ldap_tcp_port;
-
- if(tcp_port)
- dissector_add_uint("tcp.port", tcp_port, ldap_handle);
-
- }
-
if(ssl_port != global_ldaps_tcp_port) {
if(ssl_port)
ssl_dissector_delete(ssl_port, ldap_handle);