diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
commit | a86c5f7cae7ec9a3398300555a0b644689d946a1 (patch) | |
tree | 39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/packet-redbackli.c | |
parent | Releasing progress-linux version 4.2.6-1~progress7.99u1. (diff) | |
download | wireshark-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-redbackli.c')
-rw-r--r-- | epan/dissectors/packet-redbackli.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/epan/dissectors/packet-redbackli.c b/epan/dissectors/packet-redbackli.c index 372a178a..33157c60 100644 --- a/epan/dissectors/packet-redbackli.c +++ b/epan/dissectors/packet-redbackli.c @@ -18,20 +18,20 @@ void proto_register_redbackli(void); void proto_reg_handoff_redbackli(void); -static int proto_redbackli = -1; +static int proto_redbackli; -static int hf_redbackli_avptype = -1; -static int hf_redbackli_avplen = -1; -static int hf_redbackli_seqno = -1; /* Sequence No */ -static int hf_redbackli_liid = -1; /* LI Id */ -static int hf_redbackli_sessid = -1; /* Session Id */ -static int hf_redbackli_label = -1; /* Label */ -static int hf_redbackli_acctid = -1; /* Accounting Session Id */ -static int hf_redbackli_dir = -1; /* Direction */ -static int hf_redbackli_eohpad = -1; /* End Of Header Padding */ -static int hf_redbackli_unknownavp = -1; /* Unknown AVP */ +static int hf_redbackli_avptype; +static int hf_redbackli_avplen; +static int hf_redbackli_seqno; /* Sequence No */ +static int hf_redbackli_liid; /* LI Id */ +static int hf_redbackli_sessid; /* Session Id */ +static int hf_redbackli_label; /* Label */ +static int hf_redbackli_acctid; /* Accounting Session Id */ +static int hf_redbackli_dir; /* Direction */ +static int hf_redbackli_eohpad; /* End Of Header Padding */ +static int hf_redbackli_unknownavp; /* Unknown AVP */ -static int ett_redbackli = -1; +static int ett_redbackli; static dissector_handle_t ip_handle; static dissector_handle_t redbackli_handle; @@ -57,7 +57,7 @@ static const value_string avp_names[] = { }; static void -redbackli_dissect_avp(guint8 avptype, guint8 avplen, tvbuff_t *tvb, gint offset, proto_tree *tree) +redbackli_dissect_avp(uint8_t avptype, uint8_t avplen, tvbuff_t *tvb, int offset, proto_tree *tree) { const char *avpname; proto_tree *st = NULL; @@ -119,9 +119,9 @@ redbackli_dissect_avp(guint8 avptype, guint8 avplen, tvbuff_t *tvb, gint offset, static int redbackli_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - guint8 avptype, avplen; - gint len, offset = 0; - gboolean eoh; + uint8_t avptype, avplen; + int len, offset = 0; + bool eoh; proto_item *ti; proto_tree *redbackli_tree = NULL; tvbuff_t *next_tvb; @@ -134,10 +134,10 @@ redbackli_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat len = tvb_reported_length(tvb); offset = 0; - eoh = FALSE; + eoh = false; while (!eoh && (len > 2)) { - avptype = tvb_get_guint8(tvb, offset+0); - avplen = tvb_get_guint8(tvb, offset+1); + avptype = tvb_get_uint8(tvb, offset+0); + avplen = tvb_get_uint8(tvb, offset+1); if ((len-2) < avplen) /* AVP Complete ? */ break; @@ -146,7 +146,7 @@ redbackli_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat redbackli_dissect_avp(avptype, avplen, tvb, offset, redbackli_tree); if (avptype == RB_AVP_EOH) - eoh = TRUE; + eoh = true; offset += 2 + avplen; len -= 2 + avplen; @@ -163,17 +163,17 @@ redbackli_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat #define REDBACKLI_EOHSIZE 2 #define MIN_REDBACKLI_SIZE (3*REDBACKLI_INTSIZE+REDBACKLI_EOHSIZE) -static gboolean -redbackli_dissect_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +static bool +redbackli_dissect_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - gint len, offset = 0; - gboolean eoh = FALSE; - guint8 avptype, avplen; - guint32 avpfound = 0; + int len, offset = 0; + bool eoh = false; + uint8_t avptype, avplen; + uint32_t avpfound = 0; len = tvb_captured_length(tvb); if (len < MIN_REDBACKLI_SIZE) - return FALSE; + return false; /* * We scan the possible AVPs and look out for mismatches. @@ -182,43 +182,43 @@ redbackli_dissect_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * */ while ((len > 2) && !eoh) { - avptype = tvb_get_guint8(tvb, offset+0); - avplen = tvb_get_guint8(tvb, offset+1); + avptype = tvb_get_uint8(tvb, offset+0); + avplen = tvb_get_uint8(tvb, offset+1); switch (avptype) { case(RB_AVP_SEQNO): case(RB_AVP_LIID): case(RB_AVP_SESSID): if (avplen != 4) - return FALSE; + return false; avpfound |= 1<<avptype; break; case(RB_AVP_EOH): if (avplen > 1 || offset == 0) - return FALSE; - eoh = TRUE; + return false; + eoh = true; break; case(RB_AVP_LABEL): case(RB_AVP_DIR): /* Is this correct? the hf_ originally had FT_UINT8 for DIR */ case(RB_AVP_ACCTID): break; default: - return FALSE; + return false; } offset += 2 + avplen; len -= 2 + avplen; } if (!(avpfound & (1<<RB_AVP_SEQNO))) - return FALSE; + return false; if (!(avpfound & (1<<RB_AVP_SESSID))) - return FALSE; + return false; if (!(avpfound & (1<<RB_AVP_LIID))) - return FALSE; + return false; redbackli_dissect(tvb, pinfo, tree, data); - return TRUE; + return true; } void proto_register_redbackli(void) { static hf_register_info hf[] = { @@ -258,7 +258,7 @@ void proto_register_redbackli(void) { NULL, HFILL }} }; - static gint *ett[] = { + static int *ett[] = { &ett_redbackli }; |