Skip to contentSkip to conversation

two small patches for CEPH wireshark plugin

PATCH In review Danny Al-Gaaf 3 participants 7 messages Jan 24, 2013 – Jan 29, 2013

lore
Share & tools
lore
#0 lore raw

cover two small patches for CEPH wireshark plugin

Danny Al-Gaaf (2):
wireshark: fix guint64 print format handling
wireshark: fix indention

 wireshark/ceph/packet-ceph.c | 46 ++++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)
Signature · 1 line
1.8.1.1
#1 lore raw

PATCH 1/2 wireshark: fix guint64 print format handling

Use G_GUINT64_FORMAT to handle print format of guint64 correctly.

---
 wireshark/ceph/packet-ceph.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
wireshark/ceph/packet-ceph.c +4 -4
index 08826fb..84bfdd1 100644
@@ -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);
 
Signature · 1 line
1.8.1.1
#2 lore raw

PATCH 2/2 wireshark: fix indention

In reply to Danny Al-Gaaf

Fix indention.

---
 wireshark/ceph/packet-ceph.c | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)
wireshark/ceph/packet-ceph.c +21 -21
index 84bfdd1..5d2c702 100644
@@ -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;
Signature · 1 line
1.8.1.1
#3 lore raw
In reply to Danny Al-Gaaf

Hi Danny!

Quoted 6 lines · Danny Al-Gaaf

Danny Al-Gaaf (2):
wireshark: fix guint64 print format handling
wireshark: fix indention

 wireshark/ceph/packet-ceph.c | 46 ++++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

Since you brought up wireshark...

We would LOVE LOVE LOVE it if this plugin could get upstream into wireshark. IIRC, the problem (last time we checked, ages ago) was that there were strict coding guidelines for that project that weren't followed. I'm not sure if that is still the case, or even if that is accurate.

It would be great if someone on this list who is looking for a way to contribute could take the lead on trying to make this happen... :-)

sage

#4 lore raw

Am 24.01.2013 19:31, schrieb Sage Weil:

Quoted 1 line

Hi Danny!

[...]

Quoted 4 lines

Since you brought up wireshark...

We would LOVE LOVE LOVE it if this plugin could get upstream into wireshark.

Yes, this would be great.

Quoted 7 lines

IIRC, the problem (last time we checked, ages ago) was that there were strict coding guidelines for that project that weren't followed. I'm not sure if that is still the case, or even if that is accurate.

It would be great if someone on this list who is looking for a way to contribute could take the lead on trying to make this happen... :-)

I'll take a look at it maybe ... if I find some free time for it.

What about the patches? Can we apply them to the ceph git tree until we have another solution for the wireshark code?

Danny

#5 lore raw
Quoted 15 lines · Danny Al-Gaaf

Am 24.01.2013 19:31, schrieb Sage Weil:

Quoted 1 line

Hi Danny!

[...]

Quoted 4 lines

Since you brought up wireshark...

We would LOVE LOVE LOVE it if this plugin could get upstream into wireshark.

Yes, this would be great.

Quoted 5 lines

IIRC, the problem (last time we checked, ages ago) was that there were strict coding guidelines for that project that weren't followed. I'm not sure if that is still the case, or even if that is accurate.

Quoted 7 lines
Quoted 2 lines

It would be great if someone on this list who is looking for a way to contribute could take the lead on trying to make this happen... :-)

I'll take a look at it maybe ... if I find some free time for it.

What about the patches? Can we apply them to the ceph git tree until we have another solution for the wireshark code?

Already in master. Thanks!

sage

#6 lore raw
In reply to Danny Al-Gaaf

You could look at the wip-wireshark-zafman branch. I rebased it and force pushed it. It has changes to the wireshark.patch and a minor change I needed to get it to build. I'm surprised the recent checkin didn't include the change to packet-ceph.c which I needed to get it to build.

David Zafman
Senior Developer
[email protected]

Quoted 28 lines · Danny Al-Gaaf

Am 24.01.2013 19:31, schrieb Sage Weil:

Quoted 1 line

Hi Danny!

[...]

Quoted 4 lines

Since you brought up wireshark...

We would LOVE LOVE LOVE it if this plugin could get upstream into wireshark.

Yes, this would be great.

Quoted 7 lines

IIRC, the problem (last time we checked, ages ago) was that there were strict coding guidelines for that project that weren't followed. I'm not sure if that is still the case, or even if that is accurate.

It would be great if someone on this list who is looking for a way to contribute could take the lead on trying to make this happen... :-)

I'll take a look at it maybe ... if I find some free time for it.

What about the patches? Can we apply them to the ceph git tree until we have another solution for the wireshark code?

Danny
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html