aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ntlmssp.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-11-23 02:20:13 +0000
committerMichael Mann <mmann78@netscape.net>2013-11-23 02:20:13 +0000
commit9b7fb8a81120f99babc82e25416f9e25fe616c73 (patch)
tree5dc37cedfddb9588b91957f7da7aeaac83d75543 /epan/dissectors/packet-ntlmssp.c
parentb3a24c5cc401498535ffdb64aaa212e46e587698 (diff)
Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future. And search/replace of a function name is easy enough to do. The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As. All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope(). All other dissectors were converted to using file_scope() which was the original scope for "proto" data. svn path=/trunk/; revision=53520
Diffstat (limited to 'epan/dissectors/packet-ntlmssp.c')
-rw-r--r--epan/dissectors/packet-ntlmssp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index addd203f64..283fef123b 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -1651,7 +1651,7 @@ dissect_ntlmssp_auth (tvbuff_t *tvb, packet_info *pinfo, int offset,
* - has the AUTHENTICATE message in a second TCP connection;
* (The authentication aparently succeeded).
*/
- conv_ntlmssp_info = (ntlmssp_info *)p_get_proto_data(pinfo->fd, proto_ntlmssp, NTLMSSP_CONV_INFO_KEY);
+ conv_ntlmssp_info = (ntlmssp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ntlmssp, NTLMSSP_CONV_INFO_KEY);
if (conv_ntlmssp_info == NULL) {
/*
* There isn't any. Is there any from this conversation? If so,
@@ -1670,7 +1670,7 @@ dissect_ntlmssp_auth (tvbuff_t *tvb, packet_info *pinfo, int offset,
/* XXX: The *conv_ntlmssp_info struct attached to the frame is the
same as the one attached to the conversation. That is: *both* point to
the exact same struct in memory. Is this what is indended ? */
- p_add_proto_data(pinfo->fd, proto_ntlmssp, NTLMSSP_CONV_INFO_KEY, conv_ntlmssp_info);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_ntlmssp, NTLMSSP_CONV_INFO_KEY, conv_ntlmssp_info);
}
if (conv_ntlmssp_info != NULL) {
@@ -2023,11 +2023,11 @@ decrypt_data_payload(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
ntlmssp_packet_info *stored_packet_ntlmssp_info = NULL;
/* Check to see if we already have state for this packet */
- packet_ntlmssp_info = (ntlmssp_packet_info *)p_get_proto_data(pinfo->fd, proto_ntlmssp, NTLMSSP_PACKET_INFO_KEY);
+ packet_ntlmssp_info = (ntlmssp_packet_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ntlmssp, NTLMSSP_PACKET_INFO_KEY);
if (packet_ntlmssp_info == NULL) {
/* We don't have any packet state, so create one */
packet_ntlmssp_info = wmem_new0(wmem_file_scope(), ntlmssp_packet_info);
- p_add_proto_data(pinfo->fd, proto_ntlmssp, NTLMSSP_PACKET_INFO_KEY, packet_ntlmssp_info);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_ntlmssp, NTLMSSP_PACKET_INFO_KEY, packet_ntlmssp_info);
}
if (!packet_ntlmssp_info->payload_decrypted) {
conversation_t *conversation;
@@ -2247,7 +2247,7 @@ decrypt_verifier(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
int sequence = 0;
ntlmssp_packet_info *stored_packet_ntlmssp_info = NULL;
- packet_ntlmssp_info = (ntlmssp_packet_info *)p_get_proto_data(pinfo->fd, proto_ntlmssp, NTLMSSP_PACKET_INFO_KEY);
+ packet_ntlmssp_info = (ntlmssp_packet_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ntlmssp, NTLMSSP_PACKET_INFO_KEY);
if (packet_ntlmssp_info == NULL) {
/* We don't have data for this packet */
return;
@@ -2554,11 +2554,11 @@ dissect_ntlmssp_encrypted_payload(tvbuff_t *data_tvb,
fprintf(stderr, "Called dissect_ntlmssp_encrypted_payload\n");
/* Check to see if we already have state for this packet */
- packet_ntlmssp_info = p_get_proto_data(pinfo->fd, proto_ntlmssp, NTLMSSP_PACKET_INFO_KEY);
+ packet_ntlmssp_info = p_get_proto_data(wmem_file_scope(), pinfo, proto_ntlmssp, NTLMSSP_PACKET_INFO_KEY);
if (packet_ntlmssp_info == NULL) {
/* We don't have any packet state, so create one */
packet_ntlmssp_info = wmem_new0(wmem_file_scope(), ntlmssp_packet_info);
- p_add_proto_data(pinfo->fd, proto_ntlmssp, NTLMSSP_PACKET_INFO_KEY, packet_ntlmssp_info);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_ntlmssp, NTLMSSP_PACKET_INFO_KEY, packet_ntlmssp_info);
}
if (!packet_ntlmssp_info->payload_decrypted) {