summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nlm.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-nlm.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-nlm.c')
-rw-r--r--epan/dissectors/packet-nlm.c120
1 files changed, 60 insertions, 60 deletions
diff --git a/epan/dissectors/packet-nlm.c b/epan/dissectors/packet-nlm.c
index 1b7251d0..e0b1d316 100644
--- a/epan/dissectors/packet-nlm.c
+++ b/epan/dissectors/packet-nlm.c
@@ -39,39 +39,39 @@ void proto_reg_handoff_nlm(void);
* and follow the links to the HTML version of the document.
*/
-static int proto_nlm = -1;
-static int hf_nlm_procedure_v1 = -1;
-static int hf_nlm_procedure_v2 = -1;
-static int hf_nlm_procedure_v3 = -1;
-static int hf_nlm_procedure_v4 = -1;
-static int hf_nlm_cookie = -1;
-static int hf_nlm_block = -1;
-static int hf_nlm_exclusive = -1;
-static int hf_nlm_lock = -1;
-static int hf_nlm_lock_caller_name = -1;
-static int hf_nlm_lock_owner = -1;
-static int hf_nlm_lock_svid = -1;
-static int hf_nlm_lock_l_offset = -1;
-static int hf_nlm_lock_l_offset64 = -1;
-static int hf_nlm_lock_l_len = -1;
-static int hf_nlm_lock_l_len64 = -1;
-static int hf_nlm_reclaim = -1;
-static int hf_nlm_stat = -1;
-static int hf_nlm_state = -1;
-static int hf_nlm_test_stat = -1;
-static int hf_nlm_test_stat_stat = -1;
-static int hf_nlm_holder = -1;
-static int hf_nlm_share = -1;
-static int hf_nlm_share_mode = -1;
-static int hf_nlm_share_access = -1;
-static int hf_nlm_share_name = -1;
-static int hf_nlm_sequence = -1;
-static int hf_nlm_request_in = -1;
-static int hf_nlm_reply_in = -1;
-static int hf_nlm_time = -1;
-
-static gint ett_nlm = -1;
-static gint ett_nlm_lock = -1;
+static int proto_nlm;
+static int hf_nlm_procedure_v1;
+static int hf_nlm_procedure_v2;
+static int hf_nlm_procedure_v3;
+static int hf_nlm_procedure_v4;
+static int hf_nlm_cookie;
+static int hf_nlm_block;
+static int hf_nlm_exclusive;
+static int hf_nlm_lock;
+static int hf_nlm_lock_caller_name;
+static int hf_nlm_lock_owner;
+static int hf_nlm_lock_svid;
+static int hf_nlm_lock_l_offset;
+static int hf_nlm_lock_l_offset64;
+static int hf_nlm_lock_l_len;
+static int hf_nlm_lock_l_len64;
+static int hf_nlm_reclaim;
+static int hf_nlm_stat;
+static int hf_nlm_state;
+static int hf_nlm_test_stat;
+static int hf_nlm_test_stat_stat;
+static int hf_nlm_holder;
+static int hf_nlm_share;
+static int hf_nlm_share_mode;
+static int hf_nlm_share_access;
+static int hf_nlm_share_name;
+static int hf_nlm_sequence;
+static int hf_nlm_request_in;
+static int hf_nlm_reply_in;
+static int hf_nlm_time;
+
+static int ett_nlm;
+static int ett_nlm_lock;
@@ -79,9 +79,9 @@ static gint ett_nlm_lock = -1;
* stuff to match MSG and RES packets for async NLM
*/
-static gboolean nlm_match_msgres = FALSE;
-static wmem_map_t *nlm_msg_res_unmatched = NULL;
-static wmem_map_t *nlm_msg_res_matched = NULL;
+static bool nlm_match_msgres;
+static wmem_map_t *nlm_msg_res_unmatched;
+static wmem_map_t *nlm_msg_res_matched;
/* XXX when matching the packets we should really check the conversation (only address
NOT ports) and command type as well. I am lazy and thinks the cookie itself is
@@ -91,7 +91,7 @@ typedef struct _nlm_msg_res_unmatched_data {
int req_frame;
nstime_t ns;
int cookie_len;
- const guint8 *cookie;
+ const uint8_t *cookie;
} nlm_msg_res_unmatched_data;
typedef struct _nlm_msg_res_matched_data {
@@ -100,11 +100,11 @@ typedef struct _nlm_msg_res_matched_data {
nstime_t ns;
} nlm_msg_res_matched_data;
-static guint
-nlm_msg_res_unmatched_hash(gconstpointer k)
+static unsigned
+nlm_msg_res_unmatched_hash(const void *k)
{
const nlm_msg_res_unmatched_data *umd = (const nlm_msg_res_unmatched_data *)k;
- guint8 hash=0;
+ uint8_t hash=0;
int i;
for(i=0;i<umd->cookie_len;i++){
@@ -113,16 +113,16 @@ nlm_msg_res_unmatched_hash(gconstpointer k)
return hash;
}
-static guint
-nlm_msg_res_matched_hash(gconstpointer k)
+static unsigned
+nlm_msg_res_matched_hash(const void *k)
{
- guint hash = GPOINTER_TO_UINT(k);
+ unsigned hash = GPOINTER_TO_UINT(k);
return hash;
}
-static gint
-nlm_msg_res_unmatched_equal(gconstpointer k1, gconstpointer k2)
+static int
+nlm_msg_res_unmatched_equal(const void *k1, const void *k2)
{
const nlm_msg_res_unmatched_data *umd1 = (const nlm_msg_res_unmatched_data *)k1;
const nlm_msg_res_unmatched_data *umd2 = (const nlm_msg_res_unmatched_data *)k2;
@@ -131,15 +131,15 @@ nlm_msg_res_unmatched_equal(gconstpointer k1, gconstpointer k2)
return 0;
}
- return( memcmp(umd1->cookie, umd2->cookie, umd1->cookie_len) == 0);
+ return (memcmp(umd1->cookie, umd2->cookie, umd1->cookie_len) == 0);
}
-static gint
-nlm_msg_res_matched_equal(gconstpointer k1, gconstpointer k2)
+static int
+nlm_msg_res_matched_equal(const void *k1, const void *k2)
{
- guint mk1 = GPOINTER_TO_UINT(k1);
- guint mk2 = GPOINTER_TO_UINT(k2);
+ unsigned mk1 = GPOINTER_TO_UINT(k1);
+ unsigned mk2 = GPOINTER_TO_UINT(k2);
- return( mk1==mk2 );
+ return mk1==mk2;
}
static void
@@ -199,7 +199,7 @@ nlm_register_unmatched_res(packet_info *pinfo, tvbuff_t *tvb, int offset)
umd.cookie=tvb_get_ptr(tvb, offset+4, -1);
/* have we seen this cookie before? */
- old_umd=(nlm_msg_res_unmatched_data *)wmem_map_lookup(nlm_msg_res_unmatched, (gconstpointer)&umd);
+ old_umd=(nlm_msg_res_unmatched_data *)wmem_map_lookup(nlm_msg_res_unmatched, (const void *)&umd);
if(old_umd){
nlm_msg_res_matched_data *md_req, *md_rep;
@@ -226,12 +226,12 @@ nlm_register_unmatched_msg(packet_info *pinfo, tvbuff_t *tvb, int offset)
umd->req_frame = pinfo->num;
umd->ns = pinfo->abs_ts;
umd->cookie_len = tvb_get_ntohl(tvb, offset);
- umd->cookie = (const guint8 *)tvb_memdup(wmem_file_scope(), tvb, offset+4, umd->cookie_len);
+ umd->cookie = (const uint8_t *)tvb_memdup(wmem_file_scope(), tvb, offset+4, umd->cookie_len);
/* remove any old duplicates */
old_umd=(nlm_msg_res_unmatched_data *)wmem_map_lookup(nlm_msg_res_unmatched, umd);
if(old_umd){
- wmem_map_remove(nlm_msg_res_unmatched, (gconstpointer)old_umd);
+ wmem_map_remove(nlm_msg_res_unmatched, (const void *)old_umd);
}
/* add new one */
@@ -311,8 +311,8 @@ dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, i
{
proto_item* lock_item = NULL;
proto_tree* lock_tree = NULL;
- guint32 fh_hash, svid;
- guint64 start_offset=0, end_offset=0;
+ uint32_t fh_hash, svid;
+ uint64_t start_offset=0, end_offset=0;
if (tree) {
lock_item = proto_tree_add_item(tree, hf_nlm_lock, tvb,
@@ -557,7 +557,7 @@ dissect_nlm_share(tvbuff_t *tvb, int offset, packet_info *pinfo,
{
proto_item* lock_item = NULL;
proto_tree* lock_tree = NULL;
- guint32 fh_hash;
+ uint32_t fh_hash;
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
@@ -589,7 +589,7 @@ static int
dissect_nlm_shareres(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, int version _U_)
{
- guint32 nlm_stat;
+ uint32_t nlm_stat;
offset = dissect_rpc_data(tvb, tree, hf_nlm_cookie, offset);
nlm_stat = tvb_get_ntohl(tvb, offset);
@@ -623,7 +623,7 @@ static int
dissect_nlm_gen_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, void* data)
{
- guint32 nlm_stat;
+ uint32_t nlm_stat;
int offset = 0;
if(nlm_match_msgres){
@@ -1148,7 +1148,7 @@ proto_register_nlm(void)
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_nlm,
&ett_nlm_lock,
};