More pinfo->fd->num to pinfo->num.

Change-Id: Ic56b1e9be4886be9985c4b7082fbd330dbf297df
Reviewed-on: https://code.wireshark.org/review/13510
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2016-01-23 19:46:37 -08:00
parent bc5a0374bf
commit 8e5dfa5905
3 changed files with 40 additions and 40 deletions

View File

@ -2600,7 +2600,7 @@ my_entry_t *data_ptr;
/* look up the conversation */ /* look up the conversation */
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0); pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
/* if conversation found get the data pointer that you stored */ /* if conversation found get the data pointer that you stored */
@ -2616,7 +2616,7 @@ else {
/* create the conversation with your data pointer */ /* create the conversation with your data pointer */
conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, conversation = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst, pinfo->ptype,
pinfo->srcport, pinfo->destport, 0); pinfo->srcport, pinfo->destport, 0);
conversation_add_proto_data(conversation, my_proto, (void *)data_ptr); conversation_add_proto_data(conversation, my_proto, (void *)data_ptr);
} }
@ -2634,19 +2634,19 @@ Sometimes a dissector has determined that a new conversation is needed that
starts at a specific frame number, when a capture session encompasses multiple starts at a specific frame number, when a capture session encompasses multiple
conversation that reuse the same src/dest ip/port pairs. You can use the conversation that reuse the same src/dest ip/port pairs. You can use the
conversation->setup_frame returned by find_conversation with conversation->setup_frame returned by find_conversation with
pinfo->fd->num to determine whether or not there already exists a conversation pinfo->num to determine whether or not there already exists a conversation
that starts at the specific frame number. that starts at the specific frame number.
/* in the dissector routine */ /* in the dissector routine */
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0); pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
if (conversation == NULL || (conversation->setup_frame != pinfo->fd->num)) { if (conversation == NULL || (conversation->setup_frame != pinfo->num)) {
/* It's not part of any conversation or the returned /* It's not part of any conversation or the returned
* conversation->setup_frame doesn't match the current frame * conversation->setup_frame doesn't match the current frame
* create a new one. * create a new one.
*/ */
conversation = conversation_new(pinfo->fd->num, &pinfo->src, conversation = conversation_new(pinfo->num, &pinfo->src,
&pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport,
NULL, 0); NULL, 0);
} }
@ -2751,7 +2751,7 @@ static void sub_dissector(tvbuff_t *tvb, packet_info *pinfo,
/* First check if a conversation already exists for this /* First check if a conversation already exists for this
socketpair socketpair
*/ */
conversation = find_conversation(pinfo->fd->num, conversation = find_conversation(pinfo->num,
&pinfo->src, &pinfo->dst, protocol, &pinfo->src, &pinfo->dst, protocol,
src_port, dst_port, 0); src_port, dst_port, 0);
@ -2765,7 +2765,7 @@ static void sub_dissector(tvbuff_t *tvb, packet_info *pinfo,
new_conv_info->data1 = value1; new_conv_info->data1 = value1;
/* create the conversation for the dynamic port */ /* create the conversation for the dynamic port */
conversation = conversation_new(pinfo->fd->num, conversation = conversation_new(pinfo->num,
&pinfo->src, &pinfo->dst, protocol, &pinfo->src, &pinfo->dst, protocol,
src_port, dst_port, new_conv_info, 0); src_port, dst_port, new_conv_info, 0);
@ -2845,7 +2845,7 @@ static dissector_handle_t sub_dissector_handle;
/* First check if a conversation already exists for this /* First check if a conversation already exists for this
IP/protocol/port IP/protocol/port
*/ */
conversation = find_conversation(pinfo->fd->num, conversation = find_conversation(pinfo->num,
&server_src_addr, 0, protocol, &server_src_addr, 0, protocol,
server_src_port, 0, NO_ADDR2 | NO_PORT_B); server_src_port, 0, NO_ADDR2 | NO_PORT_B);
/* If there is no such conversation, or if there is one but for /* If there is no such conversation, or if there is one but for
@ -2854,7 +2854,7 @@ static dissector_handle_t sub_dissector_handle;
*/ */
if ( (conversation == NULL) || if ( (conversation == NULL) ||
(conversation->dissector_handle != sub_dissector_handle) ) { (conversation->dissector_handle != sub_dissector_handle) ) {
conversation = conversation_new(pinfo->fd->num, conversation = conversation_new(pinfo->num,
&server_src_addr, 0, protocol, &server_src_addr, 0, protocol,
server_src_port, 0, new_conv_info, NO_ADDR2 | NO_PORT2); server_src_port, 0, new_conv_info, NO_ADDR2 | NO_PORT2);

View File

@ -107,14 +107,14 @@ actual dissector.
if (flags&PANA_FLAG_R) { if (flags&PANA_FLAG_R) {
/* This is a request */ /* This is a request */
pana_trans=wmem_new(wmem_file_scope(), pana_transaction_t); pana_trans=wmem_new(wmem_file_scope(), pana_transaction_t);
pana_trans->req_frame = pinfo->fd->num; pana_trans->req_frame = pinfo->num;
pana_trans->rep_frame = 0; pana_trans->rep_frame = 0;
pana_trans->req_time = pinfo->fd->abs_ts; pana_trans->req_time = pinfo->fd->abs_ts;
wmem_map_insert(pana_info->pdus, GUINT_TO_POINTER(seq_num), (void *)pana_trans); wmem_map_insert(pana_info->pdus, GUINT_TO_POINTER(seq_num), (void *)pana_trans);
} else { } else {
pana_trans=(pana_transaction_t *)wmem_map_lookup(pana_info->pdus, GUINT_TO_POINTER(seq_num)); pana_trans=(pana_transaction_t *)wmem_map_lookup(pana_info->pdus, GUINT_TO_POINTER(seq_num));
if (pana_trans) { if (pana_trans) {
pana_trans->rep_frame = pinfo->fd->num; pana_trans->rep_frame = pinfo->num;
} }
} }
} else { } else {

View File

@ -6735,12 +6735,12 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
/* Has this already been dissected? */ /* Has this already been dissected? */
if (!pinfo->fd->flags.visited) { if (!pinfo->fd->flags.visited) {
/* Find the conversation whence the request would have come. */ /* Find the conversation whence the request would have come. */
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
PT_NCP, nw_connection, nw_connection, 0); PT_NCP, nw_connection, nw_connection, 0);
if (conversation != NULL) { if (conversation != NULL) {
/* find the record telling us the request made that caused /* find the record telling us the request made that caused
this reply */ this reply */
request_value = ncp_hash_lookup(conversation, sequence, pinfo->fd->num); request_value = ncp_hash_lookup(conversation, sequence, pinfo->num);
if (!request_value) { if (!request_value) {
dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap); dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
return; return;
@ -6805,7 +6805,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
} }
/* Now we process the fragments */ /* Now we process the fragments */
if (request_value->nds_frag || (request_value->nds_end_frag == pinfo->fd->num)) if (request_value->nds_frag || (request_value->nds_end_frag == pinfo->num))
{ {
/* Check to see of this is a fragment. If so then mark as a fragment. */ /* Check to see of this is a fragment. If so then mark as a fragment. */
if (frags[frag_count].nds_frag==0xffffffff) { if (frags[frag_count].nds_frag==0xffffffff) {
@ -6906,7 +6906,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
* Only do this on the first dissection. After the first * Only do this on the first dissection. After the first
* dissection we will just read the memory values. * dissection we will just read the memory values.
*/ */
request_value->nds_end_frag = pinfo->fd->num; request_value->nds_end_frag = pinfo->num;
request_value->nds_request_verb = frags[frag_count].nds_frag_verb; request_value->nds_request_verb = frags[frag_count].nds_frag_verb;
request_value->nds_version = frags[frag_count].nds_frag_version; request_value->nds_version = frags[frag_count].nds_frag_version;
request_value->req_nds_flags = frags[frag_count].nds_frag_flags; request_value->req_nds_flags = frags[frag_count].nds_frag_flags;
@ -6963,7 +6963,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
/* This is not any fragment packet */ /* This is not any fragment packet */
request_value->nds_frag = FALSE; request_value->nds_frag = FALSE;
/* Trap for retransmitted end fragment */ /* Trap for retransmitted end fragment */
if (request_value->nds_end_frag < pinfo->fd->num) { if (request_value->nds_end_frag < pinfo->num) {
col_add_fstr(pinfo->cinfo, COL_INFO, "[Retransmitted end of NDS Fragment 0x%08x, see packet #%d for details.]", request_value->nds_frag_num, request_value->nds_end_frag); col_add_fstr(pinfo->cinfo, COL_INFO, "[Retransmitted end of NDS Fragment 0x%08x, see packet #%d for details.]", request_value->nds_frag_num, request_value->nds_end_frag);
} }
else else
@ -7109,16 +7109,16 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
to have all packets over the same connection treated to have all packets over the same connection treated
as being part of a single conversation so that we can as being part of a single conversation so that we can
let the user select that conversation to be displayed.) */ let the user select that conversation to be displayed.) */
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
PT_NCP, nw_connection, nw_connection, 0); PT_NCP, nw_connection, nw_connection, 0);
if (conversation == NULL) { if (conversation == NULL) {
/* It's not part of any conversation - create a new one. */ /* It's not part of any conversation - create a new one. */
conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst,
PT_NCP, nw_connection, nw_connection, 0); PT_NCP, nw_connection, nw_connection, 0);
} }
request_value = ncp_hash_insert(conversation, sequence, ncp_rec, pinfo->fd->num); request_value = ncp_hash_insert(conversation, sequence, ncp_rec, pinfo->num);
request_value->req_frame_num = pinfo->fd->num; request_value->req_frame_num = pinfo->num;
request_value->req_frame_time = pinfo->fd->abs_ts; request_value->req_frame_time = pinfo->fd->abs_ts;
/* If this is the first time we're examining the packet, /* If this is the first time we're examining the packet,
@ -7268,12 +7268,12 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
if (!request_value) if (!request_value)
{ {
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
PT_NCP, nw_connection, nw_connection, 0); PT_NCP, nw_connection, nw_connection, 0);
if (conversation != NULL) { if (conversation != NULL) {
/* find the record telling us the request made that caused /* find the record telling us the request made that caused
this reply */ this reply */
request_value = ncp_hash_lookup(conversation, sequence, pinfo->fd->num); request_value = ncp_hash_lookup(conversation, sequence, pinfo->num);
} }
} }
/* SecretStore packets are dessected in packet-ncp-sss.c */ /* SecretStore packets are dessected in packet-ncp-sss.c */
@ -7933,12 +7933,12 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
if (!pinfo->fd->flags.visited) { if (!pinfo->fd->flags.visited) {
/* Find the conversation whence the request would have come. */ /* Find the conversation whence the request would have come. */
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
PT_NCP, nw_connection, nw_connection, 0); PT_NCP, nw_connection, nw_connection, 0);
if (conversation != NULL) { if (conversation != NULL) {
/* find the record telling us the request made that caused /* find the record telling us the request made that caused
this reply */ this reply */
request_value = ncp_hash_lookup(conversation, sequence, pinfo->fd->num); request_value = ncp_hash_lookup(conversation, sequence, pinfo->num);
if (request_value) { if (request_value) {
ncp_rec = request_value->ncp_rec; ncp_rec = request_value->ncp_rec;
} }
@ -7953,13 +7953,13 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
the search again with 65535 to see if we can locate the the search again with 65535 to see if we can locate the
proper request packet. */ proper request packet. */
else { else {
conversation = find_conversation(pinfo->fd->num, conversation = find_conversation(pinfo->num,
&pinfo->src, &pinfo->dst, PT_NCP, 65535, 65535, 0); &pinfo->src, &pinfo->dst, PT_NCP, 65535, 65535, 0);
if (conversation != NULL) { if (conversation != NULL) {
/* find the record telling us the request made /* find the record telling us the request made
that caused this reply */ that caused this reply */
request_value = ncp_hash_lookup(conversation, request_value = ncp_hash_lookup(conversation,
sequence, pinfo->fd->num); sequence, pinfo->num);
if (request_value) { if (request_value) {
ncp_rec = request_value->ncp_rec; ncp_rec = request_value->ncp_rec;
} }
@ -7967,13 +7967,13 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
(void*) request_value); (void*) request_value);
} }
else { else {
conversation = find_conversation(pinfo->fd->num, conversation = find_conversation(pinfo->num,
&pinfo->src, &pinfo->dst, PT_NCP, 0, 0, 0); &pinfo->src, &pinfo->dst, PT_NCP, 0, 0, 0);
if (conversation != NULL) { if (conversation != NULL) {
/* find the record telling us the request made /* find the record telling us the request made
that caused this reply */ that caused this reply */
request_value = ncp_hash_lookup(conversation, request_value = ncp_hash_lookup(conversation,
sequence, pinfo->fd->num); sequence, pinfo->num);
if (request_value) { if (request_value) {
ncp_rec = request_value->ncp_rec; ncp_rec = request_value->ncp_rec;
} }
@ -7987,12 +7987,12 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
} }
else { else {
/*request_value = p_get_proto_data(wmem_file_scope(), pinfo, proto_ncp);*/ /*request_value = p_get_proto_data(wmem_file_scope(), pinfo, proto_ncp);*/
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
PT_NCP, nw_connection, nw_connection, 0); PT_NCP, nw_connection, nw_connection, 0);
if (conversation != NULL) { if (conversation != NULL) {
request_value = ncp_hash_lookup(conversation, request_value = ncp_hash_lookup(conversation,
sequence, pinfo->fd->num); sequence, pinfo->num);
} }
if (request_value) { if (request_value) {
ncp_rec = request_value->ncp_rec; ncp_rec = request_value->ncp_rec;
@ -8257,17 +8257,17 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
as being part of a single conversation so that we can as being part of a single conversation so that we can
let the user select that conversation to be displayed.) */ let the user select that conversation to be displayed.) */
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
PT_NCP, nw_connection, nw_connection, 0); PT_NCP, nw_connection, nw_connection, 0);
if (conversation == NULL) { if (conversation == NULL) {
/* It's not part of any conversation - create a new one. */ /* It's not part of any conversation - create a new one. */
conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst,
PT_NCP, nw_connection, nw_connection, 0); PT_NCP, nw_connection, nw_connection, 0);
} }
if (!pinfo->fd->flags.visited) { if (!pinfo->fd->flags.visited) {
request_value = ncp_hash_insert(conversation, sequence, ncp_rec, pinfo->fd->num); request_value = ncp_hash_insert(conversation, sequence, ncp_rec, pinfo->num);
request_value->req_frame_num = pinfo->fd->num; request_value->req_frame_num = pinfo->num;
request_value->req_frame_time=pinfo->fd->abs_ts; request_value->req_frame_time=pinfo->fd->abs_ts;
/* If this is the first time we're examining the packet, /* If this is the first time we're examining the packet,
@ -8344,7 +8344,7 @@ dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
if (type == NCP_SERVICE_REQUEST) { if (type == NCP_SERVICE_REQUEST) {
memset(&temp_value, 0, sizeof(temp_value)); memset(&temp_value, 0, sizeof(temp_value));
request_value = ncp_hash_lookup(conversation, sequence, pinfo->fd->num); request_value = ncp_hash_lookup(conversation, sequence, pinfo->num);
if (ncp_rec && ncp_rec->request_ptvc) if (ncp_rec && ncp_rec->request_ptvc)
{ {
@ -9250,18 +9250,18 @@ dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
as being part of a single conversation so that we can as being part of a single conversation so that we can
let the user select that conversation to be displayed.) */ let the user select that conversation to be displayed.) */
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
PT_NCP, nw_connection, nw_connection, 0); PT_NCP, nw_connection, nw_connection, 0);
if (conversation == NULL) if (conversation == NULL)
{ {
/* It's not part of any conversation - create a new one. */ /* It's not part of any conversation - create a new one. */
conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, conversation = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst,
PT_NCP, nw_connection, nw_connection, 0); PT_NCP, nw_connection, nw_connection, 0);
} }
request_value = ncp_hash_insert(conversation, sequence, ncp_rec, pinfo->fd->num); request_value = ncp_hash_insert(conversation, sequence, ncp_rec, pinfo->num);
request_value->req_frame_num = pinfo->fd->num; request_value->req_frame_num = pinfo->num;
request_value->req_frame_time=pinfo->fd->abs_ts; request_value->req_frame_time=pinfo->fd->abs_ts;
/* If this is the first time we're examining the packet, /* If this is the first time we're examining the packet,