diff options
author | Bill Meier <wmeier@newsguy.com> | 2012-05-17 14:35:11 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2012-05-17 14:35:11 +0000 |
commit | 6fbb09d50b21f6a5a193c9581eb3eed63466295f (patch) | |
tree | a4ce63d7a8b041be368cbebfec5ba9cd6d6b894f /epan/dissectors/packet-pdcp-lte.c | |
parent | 6526ea37512972cd13a8e9096f03801329846359 (diff) |
General Cleanup including:
- Remove unneeded #include <stdlib.h>;
- Remove "README.developer" comments;
- Reformat hf[] entries;
- Remove unneeded variable initialization;
- "localize" some variables;
- Whitespace/indentation/long lines/formatting
- (In one case) proto_tree_add_uint returns a proto_item* (not a proto_tree *);
svn path=/trunk/; revision=42678
Diffstat (limited to 'epan/dissectors/packet-pdcp-lte.c')
-rw-r--r-- | epan/dissectors/packet-pdcp-lte.c | 130 |
1 files changed, 64 insertions, 66 deletions
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c index 48c41d9dbf..7f9d9ba167 100644 --- a/epan/dissectors/packet-pdcp-lte.c +++ b/epan/dissectors/packet-pdcp-lte.c @@ -237,23 +237,23 @@ static const value_string rohc_mode_vals[] = { /* Values taken from: http://www.iana.org/assignments/rohc-pro-ids/rohc-pro-ids.txt */ static const value_string rohc_profile_vals[] = { - { 0x0000, "ROHC uncompressed" }, /* [RFC5795] */ - { 0x0001, "ROHC RTP" }, /* [RFC3095] */ - { 0x0101, "ROHCv2 RTP" }, /* [RFC5225] */ - { 0x0002, "ROHC UDP" }, /* [RFC3095] */ - { 0x0102, "ROHCv2 UDP" }, /* [RFC5225] */ - { 0x0003, "ROHC ESP" }, /* [RFC3095] */ - { 0x0103, "ROHCv2 ESP" }, /* [RFC5225] */ - { 0x0004, "ROHC IP" }, /* [RFC3843] */ - { 0x0104, "ROHCv2 IP" }, /* [RFC5225] */ - { 0x0005, "ROHC LLA" }, /* [RFC4362] */ - { 0x0105, "ROHC LLA with R-mode" }, /* [RFC3408] */ - { 0x0006, "ROHC TCP" }, /* [RFC4996] */ - { 0x0007, "ROHC RTP/UDP-Lite" }, /* [RFC4019] */ - { 0x0107, "ROHCv2 RTP/UDP-Lite" }, /* [RFC5225] */ - { 0x0008, "ROHC UDP-Lite" }, /* [RFC4019] */ - { 0x0108, "ROHCv2 UDP-Lite" }, /* [RFC5225] */ - { 0, NULL } + { 0x0000, "ROHC uncompressed" }, /* [RFC5795] */ + { 0x0001, "ROHC RTP" }, /* [RFC3095] */ + { 0x0101, "ROHCv2 RTP" }, /* [RFC5225] */ + { 0x0002, "ROHC UDP" }, /* [RFC3095] */ + { 0x0102, "ROHCv2 UDP" }, /* [RFC5225] */ + { 0x0003, "ROHC ESP" }, /* [RFC3095] */ + { 0x0103, "ROHCv2 ESP" }, /* [RFC5225] */ + { 0x0004, "ROHC IP" }, /* [RFC3843] */ + { 0x0104, "ROHCv2 IP" }, /* [RFC5225] */ + { 0x0005, "ROHC LLA" }, /* [RFC4362] */ + { 0x0105, "ROHC LLA with R-mode" }, /* [RFC3408] */ + { 0x0006, "ROHC TCP" }, /* [RFC4996] */ + { 0x0007, "ROHC RTP/UDP-Lite" }, /* [RFC4019] */ + { 0x0107, "ROHCv2 RTP/UDP-Lite" }, /* [RFC5225] */ + { 0x0008, "ROHC UDP-Lite" }, /* [RFC4019] */ + { 0x0108, "ROHCv2 UDP-Lite" }, /* [RFC5225] */ + { 0, NULL } }; static const value_string pdu_type_vals[] = { @@ -402,8 +402,8 @@ static gpointer get_report_hash_key(guint16 SN, guint32 frameNumber, pdcp_lte_info *p_pdcp_lte_info, gboolean do_persist) { - static pdcp_result_hash_key key; - pdcp_result_hash_key *p_key; + static pdcp_result_hash_key key; + pdcp_result_hash_key *p_key; /* Only allocate a struct when will be adding entry */ if (do_persist) { @@ -428,13 +428,13 @@ static gpointer get_report_hash_key(guint16 SN, guint32 frameNumber, /* Info to attach to frame when first read, recording what to show about sequence */ typedef struct { - gboolean sequenceExpectedCorrect; - guint16 sequenceExpected; - guint32 previousFrameNum; - guint32 nextFrameNum; + gboolean sequenceExpectedCorrect; + guint16 sequenceExpected; + guint32 previousFrameNum; + guint32 nextFrameNum; - guint16 firstSN; - guint16 lastSN; + guint16 firstSN; + guint16 lastSN; enum { SN_OK, SN_Repeated, SN_MAC_Retx, SN_Retx, SN_Missing} state; } pdcp_sequence_report_in_frame; @@ -563,12 +563,12 @@ static void checkChannelSequenceInfo(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree) { pdcp_channel_hash_key channel_key; - pdcp_channel_hash_key *p_channel_key; - pdcp_channel_status *p_channel_status; - pdcp_sequence_report_in_frame *p_report_in_frame = NULL; - gboolean createdChannel = FALSE; - guint16 expectedSequenceNumber = 0; - guint16 snLimit = 0; + pdcp_channel_hash_key *p_channel_key; + pdcp_channel_status *p_channel_status; + pdcp_sequence_report_in_frame *p_report_in_frame = NULL; + gboolean createdChannel = FALSE; + guint16 expectedSequenceNumber = 0; + guint16 snLimit = 0; /* If find stat_report_in_frame already, use that and get out */ if (pinfo->fd->flags.visited) { @@ -768,9 +768,9 @@ static int dissect_pdcp_dynamic_chain(proto_tree *tree, if (p_pdcp_info->rohc_ip_version == 4) { proto_tree *dynamic_ipv4_tree; proto_item *root_ti; - int tree_start_offset = offset; - guint8 tos, ttl, rnd, nbo; - guint16 id; + int tree_start_offset = offset; + guint8 tos, ttl, rnd, nbo; + guint16 id; /* Create dynamic IPv4 subtree */ root_ti = proto_tree_add_item(tree, hf_pdcp_lte_rohc_dynamic_ipv4, tvb, offset, -1, ENC_NA); @@ -975,8 +975,8 @@ static int dissect_pdcp_ir_packet(proto_tree *tree, struct pdcp_lte_info *p_pdcp_info, packet_info *pinfo) { - unsigned char dynamic_chain_present; - rohc_info *p_rohc_info; + unsigned char dynamic_chain_present; + rohc_info *p_rohc_info; col_append_str(pinfo->cinfo, COL_INFO, " IR"); proto_item_append_text(root_item, " (IR)"); @@ -1135,12 +1135,12 @@ static int dissect_pdcp_feedback_feedback2(proto_tree *tree, packet_info *pinfo) { proto_item *ti; - guint8 ack_type; - guint8 mode; - guint8 first_octet; - guint16 sn; - const char * full_mode_name; - int size_remaining; + guint8 ack_type; + guint8 mode; + guint8 first_octet; + guint16 sn; + const char *full_mode_name; + int size_remaining; proto_item_append_text(item, " (type 2)"); @@ -1250,8 +1250,8 @@ static int dissect_pdcp_feedback_packet(proto_tree *tree, struct pdcp_lte_info *p_pdcp_info, packet_info *pinfo) { - guint8 code; - guint8 size; + guint8 code; + guint8 size; proto_item *ti; proto_item *feedback_ti; proto_tree *feedback_tree; @@ -1863,12 +1863,12 @@ static gboolean global_pdcp_lte_heur = FALSE; static gboolean dissect_pdcp_lte_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - gint offset = 0; + gint offset = 0; struct pdcp_lte_info *p_pdcp_lte_info; tvbuff_t *pdcp_tvb; - guint8 tag = 0; - gboolean infoAlreadySet = FALSE; - gboolean seqnumLengthTagPresent = FALSE; + guint8 tag = 0; + gboolean infoAlreadySet = FALSE; + gboolean seqnumLengthTagPresent = FALSE; /* This is a heuristic dissector, which means we get all the UDP * traffic not sent to a known dissector and not claimed by @@ -1999,20 +1999,20 @@ static gboolean dissect_pdcp_lte_heur(tvbuff_t *tvb, packet_info *pinfo, /* Main dissection function. */ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - const char *mode; - proto_tree *pdcp_tree = NULL; - proto_item *root_ti = NULL; - gint offset = 0; - gint rohc_offset; - struct pdcp_lte_info *p_pdcp_info; - rohc_info *p_rohc_info = NULL; - tvbuff_t *rohc_tvb = NULL; + const char *mode; + proto_tree *pdcp_tree = NULL; + proto_item *root_ti = NULL; + gint offset = 0; + gint rohc_offset; + struct pdcp_lte_info *p_pdcp_info; + rohc_info *p_rohc_info = NULL; + tvbuff_t *rohc_tvb = NULL; #if 0 - proto_tree *rohc_tree = NULL;*/ - proto_item *rohc_ti = NULL; - guint8 base_header_byte; - gboolean udp_checksum_needed = TRUE; - gboolean ip_id_needed = TRUE; + proto_tree *rohc_tree = NULL; + proto_item *rohc_ti = NULL; + guint8 base_header_byte; + gboolean udp_checksum_needed = TRUE; + gboolean ip_id_needed = TRUE; #endif @@ -2269,7 +2269,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree } break; } - + if (do_analysis) { checkChannelSequenceInfo(pinfo, tvb, p_pdcp_info, (guint16)seqnum, pdcp_tree); @@ -2590,8 +2590,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree /* Initializes the hash tables each time a new * file is loaded or re-loaded in wireshark */ -static void -pdcp_lte_init_protocol(void) +static void pdcp_lte_init_protocol(void) { /* Destroy any existing hashes. */ if (pdcp_sequence_analysis_channel_hash) { @@ -3322,7 +3321,6 @@ void proto_register_pdcp(void) "Can show RLC, PDCP or Traffic layer info in Info column", &global_pdcp_lte_layer_to_show, show_info_col_vals, FALSE); - register_init_routine(&pdcp_lte_init_protocol); } @@ -3331,7 +3329,7 @@ void proto_reg_handoff_pdcp_lte(void) /* Add as a heuristic UDP dissector */ heur_dissector_add("udp", dissect_pdcp_lte_heur, proto_pdcp_lte); - ip_handle = find_dissector("ip"); + ip_handle = find_dissector("ip"); ipv6_handle = find_dissector("ipv6"); rohc_handle = find_dissector("rohc"); data_handle = find_dissector("data"); |