summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cell_broadcast.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
commit9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch)
tree2784370cda9bbf2da9114d70f05399c0b229d28c /epan/dissectors/packet-cell_broadcast.c
parentAdding debian version 4.2.6-1. (diff)
downloadwireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.tar.xz
wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-cell_broadcast.c')
-rw-r--r--epan/dissectors/packet-cell_broadcast.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/epan/dissectors/packet-cell_broadcast.c b/epan/dissectors/packet-cell_broadcast.c
index 5594f9bf..a4ca519f 100644
--- a/epan/dissectors/packet-cell_broadcast.c
+++ b/epan/dissectors/packet-cell_broadcast.c
@@ -91,40 +91,40 @@ static const value_string geographic_scope_values[] = {
};
/* Initialize the protocol and registered fields */
-static int proto_cell_broadcast = -1;
+static int proto_cell_broadcast;
-static int hf_gsm_cbs_serial_number = -1;
-static int hf_gsm_cbs_geographic_scope = -1;
-static int hf_gsm_cbs_message_code = -1;
-static int hf_gsm_cbs_update_number = -1;
-static int hf_gsm_cbs_message_identifier = -1;
-static int hf_gsm_cbs_total_pages = -1;
-static int hf_gsm_cbs_current_page = -1;
+static int hf_gsm_cbs_serial_number;
+static int hf_gsm_cbs_geographic_scope;
+static int hf_gsm_cbs_message_code;
+static int hf_gsm_cbs_update_number;
+static int hf_gsm_cbs_message_identifier;
+static int hf_gsm_cbs_total_pages;
+static int hf_gsm_cbs_current_page;
/* These fields are used when reassembling multi-page gsm cbs messages */
-static int hf_gsm_cbs_pages = -1;
-static int hf_gsm_cbs_page_num = -1;
-static int hf_gsm_cbs_page_overlap = -1;
-static int hf_gsm_cbs_page_overlap_conflict = -1;
-static int hf_gsm_cbs_page_multiple_tails = -1;
-static int hf_gsm_cbs_page_too_long_fragment = -1;
-static int hf_gsm_cbs_page_error = -1;
-static int hf_gsm_cbs_page_count = -1;
-static int hf_gsm_cbs_message_reassembled_in = -1;
-static int hf_gsm_cbs_message_reassembled_length = -1;
-static int hf_gsm_cbs_page_content = -1;
-static int hf_gsm_cbs_page_content_padding = -1;
-static int hf_gsm_cbs_message_content = -1;
+static int hf_gsm_cbs_pages;
+static int hf_gsm_cbs_page_num;
+static int hf_gsm_cbs_page_overlap;
+static int hf_gsm_cbs_page_overlap_conflict;
+static int hf_gsm_cbs_page_multiple_tails;
+static int hf_gsm_cbs_page_too_long_fragment;
+static int hf_gsm_cbs_page_error;
+static int hf_gsm_cbs_page_count;
+static int hf_gsm_cbs_message_reassembled_in;
+static int hf_gsm_cbs_message_reassembled_length;
+static int hf_gsm_cbs_page_content;
+static int hf_gsm_cbs_page_content_padding;
+static int hf_gsm_cbs_message_content;
/* Initialize the subtree pointers */
-static gint ett_cbs_msg = -1;
-static gint ett_cbs_serial_no = -1;
-static gint ett_cbs_coding = -1;
-static gint ett_gsm_cbs_page = -1;
-static gint ett_gsm_cbs_page_content = -1;
-static gint ett_gsm_cbs_pages = -1;
+static int ett_cbs_msg;
+static int ett_cbs_serial_no;
+static int ett_cbs_coding;
+static int ett_gsm_cbs_page;
+static int ett_gsm_cbs_page_content;
+static int ett_gsm_cbs_pages;
-static expert_field ei_gsm_cbs_unhandled_encoding = EI_INIT;
+static expert_field ei_gsm_cbs_unhandled_encoding;
/* reassembly of GSM multi-page messages */
static reassembly_table gsm_cbs_reassembly_table;
@@ -148,9 +148,9 @@ static const fragment_items gsm_page_items = {
"pages"
};
-guint dissect_cbs_serial_number(tvbuff_t *tvb, proto_tree *tree, guint offset)
+unsigned dissect_cbs_serial_number(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
{
- guint16 serial_number = tvb_get_ntohs(tvb, offset) ;
+ uint16_t serial_number = tvb_get_ntohs(tvb, offset) ;
proto_item *item;
proto_tree *subtree;
@@ -164,9 +164,9 @@ guint dissect_cbs_serial_number(tvbuff_t *tvb, proto_tree *tree, guint offset)
return offset;
}
-guint dissect_cbs_message_identifier(tvbuff_t *tvb, proto_tree *tree, guint offset)
+unsigned dissect_cbs_message_identifier(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
{
- guint16 msg_id;
+ uint16_t msg_id;
const char *msg_id_string = NULL;
msg_id = tvb_get_ntohs(tvb, offset);
@@ -231,17 +231,17 @@ guint dissect_cbs_message_identifier(tvbuff_t *tvb, proto_tree *tree, guint offs
return offset;
}
-tvbuff_t * dissect_cbs_data(guint8 sms_encoding, tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint offset )
+tvbuff_t * dissect_cbs_data(uint8_t sms_encoding, tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, unsigned offset )
{
tvbuff_t * tvb_out = NULL;
int length = tvb_reported_length(tvb) - offset;
- gchar *text;
+ char *text;
switch(sms_encoding){
case SMS_ENCODING_7BIT:
case SMS_ENCODING_7BIT_LANG:
text = tvb_get_ts_23_038_7bits_string_packed(pinfo->pool, tvb, offset<<3, (length*8)/7);
- tvb_out = tvb_new_child_real_data(tvb, text, (guint)strlen(text), (guint)strlen(text));
+ tvb_out = tvb_new_child_real_data(tvb, text, (unsigned)strlen(text), (unsigned)strlen(text));
add_new_data_source(pinfo, tvb_out, "unpacked 7 bit data");
break;
@@ -250,14 +250,14 @@ tvbuff_t * dissect_cbs_data(guint8 sms_encoding, tvbuff_t *tvb, proto_tree *tree
* XXX - encoding is "user-defined". Have a preference?
*/
text = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_ASCII|ENC_NA);
- tvb_out = tvb_new_child_real_data(tvb, text, (guint)strlen(text), (guint)strlen(text));
+ tvb_out = tvb_new_child_real_data(tvb, text, (unsigned)strlen(text), (unsigned)strlen(text));
add_new_data_source(pinfo, tvb_out, "8 bit data");
break;
case SMS_ENCODING_UCS2:
case SMS_ENCODING_UCS2_LANG:
text = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_UCS_2|ENC_BIG_ENDIAN);
- tvb_out = tvb_new_child_real_data(tvb, text, (guint)strlen(text), (guint)strlen(text));
+ tvb_out = tvb_new_child_real_data(tvb, text, (unsigned)strlen(text), (unsigned)strlen(text));
add_new_data_source(pinfo, tvb_out, "UCS-2 data");
break;
@@ -272,13 +272,13 @@ tvbuff_t * dissect_cbs_data(guint8 sms_encoding, tvbuff_t *tvb, proto_tree *tree
static int
dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
- guint8 sms_encoding, total_pages, current_page;
- guint32 offset = 0;
- guint len, text_len;
- guint32 msg_key;
+ uint8_t sms_encoding, total_pages, current_page;
+ uint32_t offset = 0;
+ unsigned len, text_len;
+ uint32_t msg_key;
proto_item *cbs_page_item = NULL;
proto_tree *cbs_page_tree = NULL;
- guint16 serial_number, message_id;
+ uint16_t serial_number, message_id;
tvbuff_t *cbs_page_tvb = NULL;
tvbuff_t *cbs_msg_tvb = NULL;
fragment_head * frag_data = NULL;
@@ -296,7 +296,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
message_id = tvb_get_ntohs(tvb, offset);
offset = dissect_cbs_message_identifier(tvb, cbs_page_tree, offset);
sms_encoding = dissect_cbs_data_coding_scheme(tvb, pinfo, cbs_page_tree, offset++);
- total_pages = tvb_get_guint8(tvb, offset);
+ total_pages = tvb_get_uint8(tvb, offset);
current_page = (total_pages & 0xF0) >> 4;
total_pages &= 0x0F;
proto_tree_add_item(cbs_page_tree, hf_gsm_cbs_current_page, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -306,7 +306,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (cbs_page_tvb != NULL)
{
text_len = tvb_reported_length(cbs_page_tvb);
- while (text_len && (tvb_get_guint8(cbs_page_tvb, text_len-1) == '\r')) {
+ while (text_len && (tvb_get_uint8(cbs_page_tvb, text_len-1) == '\r')) {
text_len--;
}
if (tree != NULL)
@@ -362,13 +362,13 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int dissect_umts_cell_broadcast_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
- guint8 sms_encoding;
- guint32 offset = 0;
- guint32 len;
+ uint8_t sms_encoding;
+ uint32_t offset = 0;
+ uint32_t len;
proto_item *cbs_item;
proto_tree *cbs_tree, *cbs_subtree;
- guint msg_len;
- guint8 *msg;
+ unsigned msg_len;
+ uint8_t *msg;
tvbuff_t * cbs_msg_tvb = NULL;
len = tvb_reported_length(tvb);
@@ -529,7 +529,7 @@ proto_register_cbs(void)
};
/* Setup protocol subtree array */
- static gint *ett[] = {
+ static int *ett[] = {
&ett_cbs_msg,
&ett_cbs_serial_no,
&ett_cbs_coding,