diff options
author | Michael Mann <mmann78@netscape.net> | 2013-05-03 14:54:39 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-05-03 14:54:39 +0000 |
commit | ce537f6b9434dfb817cfa9ae2cd2a3a131dccce5 (patch) | |
tree | ad8896509ce9d9d36f68b0de7b585698a1cfc624 /epan/dissectors/packet-gsm_sms.c | |
parent | 2602490a2d0d81a3f37c65aae5973a9aae21dd21 (diff) |
Remove static packet_info *gpinfo and just use the packet_info provided by the function.
svn path=/trunk/; revision=49145
Diffstat (limited to 'epan/dissectors/packet-gsm_sms.c')
-rw-r--r-- | epan/dissectors/packet-gsm_sms.c | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c index 56418047f3..31d2cf11dd 100644 --- a/epan/dissectors/packet-gsm_sms.c +++ b/epan/dissectors/packet-gsm_sms.c @@ -150,7 +150,6 @@ static gint hf_gsm_sms_tp_ud = -1; static gboolean reassemble_sms = TRUE; static char bigbuf[1024]; -static packet_info *g_pinfo; static proto_tree *g_tree; /* 3GPP TS 23.038 version 7.0.0 Release 7 @@ -2578,7 +2577,7 @@ dis_field_ud_iei(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint8 length) #define SMS_MAX_MESSAGE_SIZE 160 static char messagebuf[SMS_MAX_MESSAGE_SIZE+1]; static void -dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gboolean udhi, guint8 udl, +dis_field_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint32 length, gboolean udhi, guint8 udl, gboolean seven_bit, gboolean eight_bit, gboolean ucs2, gboolean compressed) { static guint8 fill_bits_mask[7] = @@ -2669,10 +2668,10 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb if ( is_fragmented && reassemble_sms) { try_gsm_sms_ud_reassemble = TRUE; - save_fragmented = g_pinfo->fragmented; - g_pinfo->fragmented = TRUE; + save_fragmented = pinfo->fragmented; + pinfo->fragmented = TRUE; fd_sm = fragment_add_seq_check (&g_sm_reassembly_table, tvb, offset, - g_pinfo, + pinfo, g_sm_id, /* guint32 ID for fragments belonging together */ NULL, g_frag-1, /* guint32 fragment sequence number */ @@ -2684,20 +2683,20 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb reassembled_in = fd_sm->reassembled_in; } - sm_tvb = process_reassembled_data(tvb, offset, g_pinfo, + sm_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled Short Message", fd_sm, &sm_frag_items, NULL, tree); - if(reassembled && g_pinfo->fd->num == reassembled_in) + if(reassembled && pinfo->fd->num == reassembled_in) { /* Reassembled */ - col_append_str (g_pinfo->cinfo, COL_INFO, + col_append_str (pinfo->cinfo, COL_INFO, " (Short Message Reassembled)"); } else { /* Not last packet of reassembled Short Message */ - col_append_fstr (g_pinfo->cinfo, COL_INFO, + col_append_fstr (pinfo->cinfo, COL_INFO, " (Short Message fragment %u of %u)", g_frag, g_frags); } @@ -2720,7 +2719,7 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb { if (seven_bit) { - if(!(reassembled && g_pinfo->fd->num == reassembled_in)) + if(!(reassembled && pinfo->fd->num == reassembled_in)) { /* Show unassembled SMS */ out_len = @@ -2764,9 +2763,9 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb { /*proto_tree_add_text(subtree, tvb , offset , length, "%s", tvb_format_text(tvb, offset, length)); */ - if (! dissector_try_uint(gsm_sms_dissector_tbl, g_port_src, sm_tvb, g_pinfo, subtree)) + if (! dissector_try_uint(gsm_sms_dissector_tbl, g_port_src, sm_tvb, pinfo, subtree)) { - if (! dissector_try_uint(gsm_sms_dissector_tbl, g_port_dst,sm_tvb, g_pinfo, subtree)) + if (! dissector_try_uint(gsm_sms_dissector_tbl, g_port_dst,sm_tvb, pinfo, subtree)) { if (subtree) { /* Only display if needed */ @@ -2783,7 +2782,7 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb { guint8 rep_len = tvb_reported_length(sm_tvb); - if(!(reassembled && g_pinfo->fd->num == reassembled_in)) + if(!(reassembled && pinfo->fd->num == reassembled_in)) { /* Show unreassembled SMS */ utf8_text = g_convert_with_iconv(tvb_get_ptr(sm_tvb, 0, rep_len), rep_len , cd , NULL , NULL , &l_conv_error); @@ -2847,7 +2846,7 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb } if (try_gsm_sms_ud_reassemble) /* Clean up defragmentation */ - g_pinfo->fragmented = save_fragmented; + pinfo->fragmented = save_fragmented; } /* 9.2.3.27 */ @@ -2905,7 +2904,7 @@ dis_field_pi(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint8 oct) * Section 9.2.2 */ static void -dis_msg_deliver(tvbuff_t *tvb, proto_tree *tree, guint32 offset) +dis_msg_deliver(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { guint32 saved_offset; guint32 length; @@ -2954,7 +2953,7 @@ dis_msg_deliver(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { offset++; - dis_field_ud(tvb, tree, offset, length - (offset - saved_offset), udhi, udl, + dis_field_ud(tvb, pinfo, tree, offset, length - (offset - saved_offset), udhi, udl, seven_bit, eight_bit, ucs2, compressed); } } @@ -2964,7 +2963,7 @@ dis_msg_deliver(tvbuff_t *tvb, proto_tree *tree, guint32 offset) * Section 9.2.2 */ static void -dis_msg_deliver_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset) +dis_msg_deliver_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { guint32 saved_offset; guint32 length; @@ -3074,7 +3073,7 @@ dis_msg_deliver_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { offset++; - dis_field_ud(tvb, tree, offset, length - (offset - saved_offset), udhi, udl, + dis_field_ud(tvb, pinfo, tree, offset, length - (offset - saved_offset), udhi, udl, seven_bit, eight_bit, ucs2, compressed); } } @@ -3084,7 +3083,7 @@ dis_msg_deliver_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset) * Section 9.2.2 */ static void -dis_msg_submit(tvbuff_t *tvb, proto_tree *tree, guint32 offset) +dis_msg_submit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { guint32 saved_offset; guint32 length; @@ -3141,7 +3140,7 @@ dis_msg_submit(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { offset++; - dis_field_ud(tvb, tree, offset, length - (offset - saved_offset), udhi, udl, + dis_field_ud(tvb, pinfo, tree, offset, length - (offset - saved_offset), udhi, udl, seven_bit, eight_bit, ucs2, compressed); } } @@ -3151,7 +3150,7 @@ dis_msg_submit(tvbuff_t *tvb, proto_tree *tree, guint32 offset) * Section 9.2.2 */ static void -dis_msg_submit_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset) +dis_msg_submit_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { guint32 saved_offset; guint32 length; @@ -3251,7 +3250,7 @@ dis_msg_submit_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset) if (udl > 0) { - dis_field_ud(tvb, tree, offset, length - (offset - saved_offset), udhi, udl, + dis_field_ud(tvb, pinfo, tree, offset, length - (offset - saved_offset), udhi, udl, seven_bit, eight_bit, ucs2, compressed); } } @@ -3261,7 +3260,7 @@ dis_msg_submit_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset) * Section 9.2.2 */ static void -dis_msg_status_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset) +dis_msg_status_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { guint32 saved_offset; guint32 length; @@ -3370,7 +3369,7 @@ dis_msg_status_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset) { offset++; - dis_field_ud(tvb, tree, offset, length - (offset - saved_offset), udhi, udl, + dis_field_ud(tvb, pinfo, tree, offset, length - (offset - saved_offset), udhi, udl, seven_bit, eight_bit, ucs2, compressed); } } @@ -3380,7 +3379,7 @@ dis_msg_status_report(tvbuff_t *tvb, proto_tree *tree, guint32 offset) * Section 9.2.2 */ static void -dis_msg_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset) +dis_msg_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset) { guint8 oct; guint8 cdl; @@ -3433,7 +3432,7 @@ dis_msg_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset) static gint ett_msgs[NUM_MSGS]; #endif -static void (*gsm_sms_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset) = { +static void (*gsm_sms_msg_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) = { dis_msg_deliver, /* SMS-DELIVER */ dis_msg_deliver_report, /* SMS-DELIVER REPORT */ dis_msg_submit, /* SMS-SUBMIT */ @@ -3450,7 +3449,7 @@ static void (*gsm_sms_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset static void dissect_gsm_sms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset) = NULL; + void (*msg_fcn)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) = NULL; proto_item *gsm_sms_item; proto_tree *gsm_sms_tree = NULL; guint32 offset; @@ -3460,8 +3459,6 @@ dissect_gsm_sms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) const gchar *str = NULL; /*gint ett_msg_idx;*/ - - g_pinfo = pinfo; g_is_wsp = 0; g_sm_id = 0; g_frags = 0; @@ -3524,7 +3521,7 @@ dissect_gsm_sms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else { - (*msg_fcn)(tvb, gsm_sms_tree, offset); + (*msg_fcn)(tvb, pinfo, gsm_sms_tree, offset); } } } |