summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-logcat-text.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
commita86c5f7cae7ec9a3398300555a0b644689d946a1 (patch)
tree39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/packet-logcat-text.c
parentReleasing progress-linux version 4.2.6-1~progress7.99u1. (diff)
downloadwireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz
wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-logcat-text.c')
-rw-r--r--epan/dissectors/packet-logcat-text.c106
1 files changed, 53 insertions, 53 deletions
diff --git a/epan/dissectors/packet-logcat-text.c b/epan/dissectors/packet-logcat-text.c
index dd895a69..a0e01b7c 100644
--- a/epan/dissectors/packet-logcat-text.c
+++ b/epan/dissectors/packet-logcat-text.c
@@ -22,19 +22,19 @@
extern const value_string priority_vals[];
-static int proto_logcat_text = -1;
+static int proto_logcat_text;
-static int hf_logcat_text_pid = -1;
-static int hf_logcat_text_tid = -1;
-static int hf_logcat_text_timestamp = -1;
-static int hf_logcat_text_priority = -1;
-static int hf_logcat_text_tag = -1;
-static int hf_logcat_text_log = -1;
+static int hf_logcat_text_pid;
+static int hf_logcat_text_tid;
+static int hf_logcat_text_timestamp;
+static int hf_logcat_text_priority;
+static int hf_logcat_text_tag;
+static int hf_logcat_text_log;
-static gint ett_logcat = -1;
+static int ett_logcat;
-static expert_field ei_malformed_time = EI_INIT;
-static expert_field ei_malformed_token = EI_INIT;
+static expert_field ei_malformed_time;
+static expert_field ei_malformed_token;
static dissector_handle_t logcat_text_brief_handle;
static dissector_handle_t logcat_text_tag_handle;
@@ -44,35 +44,35 @@ static dissector_handle_t logcat_text_thread_handle;
static dissector_handle_t logcat_text_threadtime_handle;
static dissector_handle_t logcat_text_long_handle;
-static gint exported_pdu_tap = -1;
+static int exported_pdu_tap = -1;
-static GRegex *special_regex = NULL;
-static GRegex *brief_regex = NULL;
-static GRegex *tag_regex = NULL;
-static GRegex *time_regex = NULL;
-static GRegex *process_regex = NULL;
-static GRegex *thread_regex = NULL;
-static GRegex *threadtime_regex = NULL;
-static GRegex *long_regex = NULL;
+static GRegex *special_regex;
+static GRegex *brief_regex;
+static GRegex *tag_regex;
+static GRegex *time_regex;
+static GRegex *process_regex;
+static GRegex *thread_regex;
+static GRegex *threadtime_regex;
+static GRegex *long_regex;
-static const gchar dissector_name[] = "Logcat Text";
+static const char dissector_name[] = "Logcat Text";
-typedef int (*tGETTER) (const gchar *frame, const gchar *token, tvbuff_t *tvb,
- proto_tree *maintree, gint start_offset, packet_info *pinfo);
+typedef int (*tGETTER) (const char *frame, const char *token, tvbuff_t *tvb,
+ proto_tree *maintree, int start_offset, packet_info *pinfo);
typedef struct {
GRegex **regex;
const tGETTER *getters;
- guint no_of_getters;
+ unsigned no_of_getters;
} dissect_info_t;
void proto_register_logcat_text(void);
void proto_reg_handoff_logcat_text(void);
-static int get_priority(const gchar *frame, const gchar *token, tvbuff_t *tvb,
- proto_tree *maintree, gint start_offset, packet_info *pinfo _U_) {
+static int get_priority(const char *frame, const char *token, tvbuff_t *tvb,
+ proto_tree *maintree, int start_offset, packet_info *pinfo _U_) {
int prio;
- gchar *p = g_strstr_len(frame + start_offset, -1, token);
+ char *p = g_strstr_len(frame + start_offset, -1, token);
int offset = (int)(p - frame);
switch (*p) {
@@ -102,12 +102,12 @@ static int get_priority(const gchar *frame, const gchar *token, tvbuff_t *tvb,
return offset + 1;
}
-static int get_tag(const gchar *frame, const gchar *token, tvbuff_t *tvb,
- proto_tree *maintree, gint start_offset, packet_info *pinfo) {
- gchar *p = g_strstr_len(frame + start_offset, -1, token);
+static int get_tag(const char *frame, const char *token, tvbuff_t *tvb,
+ proto_tree *maintree, int start_offset, packet_info *pinfo) {
+ char *p = g_strstr_len(frame + start_offset, -1, token);
int offset = (int)(p - frame);
- guint8 *src_addr = wmem_strdup(pinfo->pool, token);
- gint tok_len = (gint)strlen(token);
+ uint8_t *src_addr = wmem_strdup(pinfo->pool, token);
+ int tok_len = (int)strlen(token);
proto_tree_add_string(maintree, hf_logcat_text_tag, tvb, offset, tok_len,
token);
@@ -116,29 +116,29 @@ static int get_tag(const gchar *frame, const gchar *token, tvbuff_t *tvb,
return offset + tok_len;
}
-static int get_ptid(const gchar *frame, const gchar *token, tvbuff_t *tvb,
- proto_tree *maintree, gint header_field, gint start_offset) {
- gchar *p = g_strstr_len(frame + start_offset, -1, token);
+static int get_ptid(const char *frame, const char *token, tvbuff_t *tvb,
+ proto_tree *maintree, int header_field, int start_offset) {
+ char *p = g_strstr_len(frame + start_offset, -1, token);
int offset = (int)(p - frame);
- proto_tree_add_uint(maintree, header_field, tvb, offset, (gint)strlen(token),
- (guint32)g_ascii_strtoull(token, NULL, 10));
+ proto_tree_add_uint(maintree, header_field, tvb, offset, (int)strlen(token),
+ (uint32_t)g_ascii_strtoull(token, NULL, 10));
return offset + (int)strlen(token);
}
-static int get_pid(const gchar *frame, const gchar *token, tvbuff_t *tvb,
- proto_tree *maintree, gint start_offset, packet_info *pinfo _U_) {
+static int get_pid(const char *frame, const char *token, tvbuff_t *tvb,
+ proto_tree *maintree, int start_offset, packet_info *pinfo _U_) {
return get_ptid(frame, token, tvb, maintree, hf_logcat_text_pid, start_offset);
}
-static int get_tid(const gchar *frame, const gchar *token, tvbuff_t *tvb,
- proto_tree *maintree, gint start_offset, packet_info *pinfo _U_) {
+static int get_tid(const char *frame, const char *token, tvbuff_t *tvb,
+ proto_tree *maintree, int start_offset, packet_info *pinfo _U_) {
return get_ptid(frame, token, tvb, maintree, hf_logcat_text_tid, start_offset);
}
-static int get_log(const gchar *frame, const gchar *token, tvbuff_t *tvb,
- proto_tree *maintree, gint start_offset, packet_info *pinfo) {
- gchar *p = g_strstr_len(frame + start_offset, -1, token);
+static int get_log(const char *frame, const char *token, tvbuff_t *tvb,
+ proto_tree *maintree, int start_offset, packet_info *pinfo) {
+ char *p = g_strstr_len(frame + start_offset, -1, token);
int offset = (int)(p - frame);
proto_tree_add_string(maintree, hf_logcat_text_log, tvb, offset,
@@ -147,11 +147,11 @@ static int get_log(const gchar *frame, const gchar *token, tvbuff_t *tvb,
return offset + (int)strlen(token);
}
-static int get_time(const gchar *frame, const gchar *token, tvbuff_t *tvb,
- proto_tree *maintree, gint start_offset, packet_info *pinfo) {
- gint offset;
- gchar *p;
- gint ms;
+static int get_time(const char *frame, const char *token, tvbuff_t *tvb,
+ proto_tree *maintree, int start_offset, packet_info *pinfo) {
+ int offset;
+ char *p;
+ int ms;
struct tm date;
time_t seconds;
nstime_t ts;
@@ -177,13 +177,13 @@ static int get_time(const gchar *frame, const gchar *token, tvbuff_t *tvb,
static int dissect_logcat_text(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
const dissect_info_t *dinfo) {
- gchar **tokens;
- guint i;
- gchar *frame = tvb_get_string_enc(pinfo->pool, tvb, 0, tvb_captured_length(tvb),
+ char **tokens;
+ unsigned i;
+ char *frame = tvb_get_string_enc(pinfo->pool, tvb, 0, tvb_captured_length(tvb),
ENC_UTF_8);
proto_item *mainitem = proto_tree_add_item(tree, proto_logcat_text, tvb, 0, -1, ENC_NA);
proto_tree *maintree = proto_item_add_subtree(mainitem, ett_logcat);
- gint offset = 0;
+ int offset = 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, dissector_name);
@@ -355,7 +355,7 @@ void proto_register_logcat_text(void) {
{ &ei_malformed_token, { "logcat_text.malformed_token", PI_PROTOCOL, PI_ERROR, "Failed to decode one or more tokens", EXPFILL }},
};
- static gint *ett[] = { &ett_logcat};
+ static int *ett[] = { &ett_logcat};
proto_logcat_text = proto_register_protocol("Android Logcat Text", dissector_name,
"logcat_text");