* [PATCH 1/2] wireshark: fix guint64 print format handling
2013-01-24 17:21 [PATCH 0/2] two small patches for CEPH wireshark plugin Danny Al-Gaaf
@ 2013-01-24 17:21 ` Danny Al-Gaaf
2013-01-24 17:21 ` [PATCH 2/2] wireshark: fix indention Danny Al-Gaaf
2013-01-24 18:31 ` [PATCH 0/2] two small patches for CEPH wireshark plugin Sage Weil
2 siblings, 0 replies; 7+ messages in thread
From: Danny Al-Gaaf @ 2013-01-24 17:21 UTC (permalink / raw)
To: ceph-devel; +Cc: Danny Al-Gaaf, Sage Weil
Use G_GUINT64_FORMAT to handle print format of guint64 correctly.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
---
wireshark/ceph/packet-ceph.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/wireshark/ceph/packet-ceph.c b/wireshark/ceph/packet-ceph.c
index 08826fb..84bfdd1 100644
--- a/wireshark/ceph/packet-ceph.c
+++ b/wireshark/ceph/packet-ceph.c
@@ -914,7 +914,7 @@ static guint32 dissect_ceph_auth_reply(tvbuff_t *tvb, proto_tree *tree, guint32
PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letohl,"protocol: %d",protocol);
PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letohl,"result: %d",result);
- PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letoh64,"global_id: %lu", global_id);
+ PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letoh64,"global_id: %" G_GUINT64_FORMAT, global_id);
PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letohl,"payload_len: %d",payload_len);
str_len = tvb_get_letohl(tvb,offset+payload_len);
@@ -950,7 +950,7 @@ static guint32 dissect_ceph_mdsmap_node(tvbuff_t *tvb, proto_tree *tree, guint32
ceph_sub_item = proto_tree_add_item(tree, hf_ceph_mdsnode, tvb, offset, -1, TRUE );
ceph_mdsnode_tree = proto_item_add_subtree(ceph_sub_item, ett_ceph);
- PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letoh64,"Global ID: %ld",global_id);
+ PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letoh64,"Global ID: %" G_GUINT64_FORMAT, global_id);
infoversion = *tvb_get_ptr(tvb,offset,sizeof(infoversion));
offset++;
offset+=sizeof(guint64);
@@ -961,7 +961,7 @@ static guint32 dissect_ceph_mdsmap_node(tvbuff_t *tvb, proto_tree *tree, guint32
PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letohl,"mds: %d",field);
PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letohl,"inc: %d",field);
PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letohl,"state: %d",field);
- PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letoh64,"state seq: %ld",field64);
+ PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letoh64,"state seq: %" G_GUINT64_FORMAT, field64);
offset = dissect_ceph_entity_addr(tvb, ceph_mdsnode_tree, offset);
cephtime = (struct ceph_timespec *) tvb_get_ptr(tvb, offset, sizeof(struct ceph_timespec));
time = cephtime->tv_sec;
@@ -1031,7 +1031,7 @@ static guint32 dissect_ceph_mds_map(tvbuff_t *tvb, proto_tree *tree, guint32 off
PROTO_ADD_SIMPLE_TEXT(ceph_mdsmap_tree,tvb_get_letohl,"m_root: %i",plop);
PROTO_ADD_SIMPLE_TEXT(ceph_mdsmap_tree,tvb_get_letohl,"m_session_timeout: %i",plop);
PROTO_ADD_SIMPLE_TEXT(ceph_mdsmap_tree,tvb_get_letohl,"m_session_autoclose: %i",plop);
- PROTO_ADD_SIMPLE_TEXT(ceph_mdsmap_tree,tvb_get_letoh64,"m_maxfile_size: %ld",max_filesize);
+ PROTO_ADD_SIMPLE_TEXT(ceph_mdsmap_tree,tvb_get_letoh64,"m_maxfile_size: %" G_GUINT64_FORMAT, max_filesize);
PROTO_ADD_SIMPLE_TEXT(ceph_mdsmap_tree,tvb_get_letohl,"m_max_mds: %i",plop);
PROTO_ADD_SIMPLE_TEXT(ceph_mdsmap_tree,tvb_get_letohl,"n: %i",len);
--
1.8.1.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/2] wireshark: fix indention
2013-01-24 17:21 [PATCH 0/2] two small patches for CEPH wireshark plugin Danny Al-Gaaf
2013-01-24 17:21 ` [PATCH 1/2] wireshark: fix guint64 print format handling Danny Al-Gaaf
@ 2013-01-24 17:21 ` Danny Al-Gaaf
2013-01-24 18:31 ` [PATCH 0/2] two small patches for CEPH wireshark plugin Sage Weil
2 siblings, 0 replies; 7+ messages in thread
From: Danny Al-Gaaf @ 2013-01-24 17:21 UTC (permalink / raw)
To: ceph-devel; +Cc: Danny Al-Gaaf, Sage Weil
Fix indention.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
---
wireshark/ceph/packet-ceph.c | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/wireshark/ceph/packet-ceph.c b/wireshark/ceph/packet-ceph.c
index 84bfdd1..5d2c702 100644
--- a/wireshark/ceph/packet-ceph.c
+++ b/wireshark/ceph/packet-ceph.c
@@ -906,19 +906,19 @@ static guint32 dissect_ceph_auth_reply(tvbuff_t *tvb, proto_tree *tree, guint32
guint64 global_id;
proto_item *ceph_sub_item = NULL;
proto_item *ceph_item = proto_tree_get_parent(tree);
- proto_tree *ceph_auth_reply_tree;
+ proto_tree *ceph_auth_reply_tree;
- ceph_auth_reply_tree = proto_item_add_subtree(ceph_item, ett_ceph);
+ ceph_auth_reply_tree = proto_item_add_subtree(ceph_item, ett_ceph);
ceph_sub_item = proto_tree_add_item( tree, hf_ceph_auth_reply, tvb, offset, 16, TRUE );
- ceph_auth_reply_tree = proto_item_add_subtree(ceph_sub_item, ett_ceph);
+ ceph_auth_reply_tree = proto_item_add_subtree(ceph_sub_item, ett_ceph);
- PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letohl,"protocol: %d",protocol);
- PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letohl,"result: %d",result);
- PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letoh64,"global_id: %" G_GUINT64_FORMAT, global_id);
- PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letohl,"payload_len: %d",payload_len);
+ PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letohl,"protocol: %d",protocol);
+ PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letohl,"result: %d",result);
+ PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letoh64,"global_id: %" G_GUINT64_FORMAT, global_id);
+ PROTO_ADD_SIMPLE_TEXT(ceph_auth_reply_tree,tvb_get_letohl,"payload_len: %d",payload_len);
- str_len = tvb_get_letohl(tvb,offset+payload_len);
- proto_tree_add_text(ceph_auth_reply_tree, tvb, offset+payload_len, str_len,"%s",tvb_get_const_stringz(tvb,offset,&str_len));
+ str_len = tvb_get_letohl(tvb,offset+payload_len);
+ proto_tree_add_text(ceph_auth_reply_tree, tvb, offset+payload_len, str_len,"%s",tvb_get_const_stringz(tvb,offset,&str_len));
return offset;
}
@@ -930,11 +930,11 @@ static guint32 dissect_ceph_pgpools(tvbuff_t *tvb, proto_tree *tree, guint32 off
ceph_pgpools_tree = proto_item_add_subtree(ceph_item, ett_ceph);
ceph_sub_item = proto_tree_add_item(tree, hf_ceph_pgpools, tvb, offset, -1, TRUE );
ceph_pgpools_tree = proto_item_add_subtree(ceph_sub_item, ett_ceph);
- PROTO_ADD_SIMPLE_TEXT(ceph_pgpools_tree,tvb_get_letohl," %d pool(s)",n);
- for ( i = 0; i<n; i++){
- PROTO_ADD_SIMPLE_TEXT(ceph_pgpools_tree,tvb_get_letohl,"data_pg_pool: %d",pool);
- PROTO_ADD_SIMPLE_TEXT(ceph_pgpools_tree,tvb_get_letohl,"cas_pg_pool: %d",pool);
- }
+ PROTO_ADD_SIMPLE_TEXT(ceph_pgpools_tree,tvb_get_letohl," %d pool(s)",n);
+ for ( i = 0; i<n; i++){
+ PROTO_ADD_SIMPLE_TEXT(ceph_pgpools_tree,tvb_get_letohl,"data_pg_pool: %d",pool);
+ PROTO_ADD_SIMPLE_TEXT(ceph_pgpools_tree,tvb_get_letohl,"cas_pg_pool: %d",pool);
+ }
return offset;
}
static guint32 dissect_ceph_mdsmap_node(tvbuff_t *tvb, proto_tree *tree, guint32 offset){
@@ -954,14 +954,14 @@ static guint32 dissect_ceph_mdsmap_node(tvbuff_t *tvb, proto_tree *tree, guint32
infoversion = *tvb_get_ptr(tvb,offset,sizeof(infoversion));
offset++;
offset+=sizeof(guint64);
- proto_tree_add_text(ceph_mdsnode_tree, tvb, offset, sizeof(infoversion), "version: %d", infoversion);
+ proto_tree_add_text(ceph_mdsnode_tree, tvb, offset, sizeof(infoversion), "version: %d", infoversion);
PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letoh64,"Name length: %d",field);
- proto_tree_add_text(ceph_mdsnode_tree, tvb, offset, field,"MDS name: %s",tvb_get_const_stringz(tvb,offset,&field));
- offset+=field-1;
- PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letohl,"mds: %d",field);
- PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letohl,"inc: %d",field);
- PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letohl,"state: %d",field);
- PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letoh64,"state seq: %" G_GUINT64_FORMAT, field64);
+ proto_tree_add_text(ceph_mdsnode_tree, tvb, offset, field,"MDS name: %s",tvb_get_const_stringz(tvb,offset,&field));
+ offset+=field-1;
+ PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letohl,"mds: %d",field);
+ PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letohl,"inc: %d",field);
+ PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letohl,"state: %d",field);
+ PROTO_ADD_SIMPLE_TEXT(ceph_mdsnode_tree,tvb_get_letoh64,"state seq: %" G_GUINT64_FORMAT, field64);
offset = dissect_ceph_entity_addr(tvb, ceph_mdsnode_tree, offset);
cephtime = (struct ceph_timespec *) tvb_get_ptr(tvb, offset, sizeof(struct ceph_timespec));
time = cephtime->tv_sec;
--
1.8.1.1
^ permalink raw reply related [flat|nested] 7+ messages in thread