This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Dissector on top of CCSDS Space Packet

0

Hello,

I have written a dissector that works on top of the Space Packet protocol (packet-ccsds) that at the same time works on top UDP in my application. My question is: As the protocol is not working neither on top of UDP nor on TCP how should I code the protocol registration in this case? More specifically, how should be the "proto_reg_handoff" routine?

This routine for CCSDS is the following:

proto_reg_handoff_ccsds(void){
dissector_add_handle ( "udp.port", find_dissector("ccsds") ); /* for 'decode as' */
data_handle = find_dissector("data");}

But as this protocol works on top of CCSDS I do not know how to modify it.

Thank you!

asked 16 Jul '13, 00:59

Juan_Kash's gravatar image

Juan_Kash
6113
accept rate: 0%


One Answer:

2

I have no idea how CCSDS works but how does the actual protocol stack find the next protocol to hand off to? You will have to add code to the CCSDS dissector to hand of to the next protocol either by a preferense or by adding a register table where sub dissector can register or some other method.(register_dissector_table())

answered 16 Jul '13, 01:26

Anders's gravatar image

Anders ♦
4.6k952
accept rate: 17%

Thank you for the answer! I added a register table to ccsds:

ccsds_dissector_table = register_dissector_table("ccsds.apid", "CCSDS apid", FT_UINT16, BASE_DEC);

And also modify the proto_reg_handoff of my protocol this way:

void proto_reg_handoff_cfdp(void) { dissector_handle_t cfdp_handle; cfdp_handle = create_dissector_handle(dissect_cfdp, proto_cfdp);
dissector_add_uint("ccsds.apid", 2045, cfdp_handle); }

I can see it in the menu Internal-> Dissector tables but still does not work. By doing it this way the protocol is supposed to be dissected automatically or do I have to use the menu Decode as...?

(16 Jul '13, 05:00) Juan_Kash
1

In the CCDSDS dissector do you use the dissector table to call the "next" dissetor for the payload? Something like this from the GTP dissector: if (length > 2) { next_tvb = tvb_new_subset(tvb, offset, length-2, length-2); if(!dissector_try_uint(gtp_priv_ext_dissector_table, ext_id, next_tvb, pinfo, ext_tree_priv_ext)){ proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_val, tvb, offset, length - 2, ENC_NA); } }

(16 Jul '13, 05:06) Anders ♦

Ok, now the protocol gets called from CCSDS. Thank you!

(16 Jul '13, 08:04) Juan_Kash

If an answer has solved your issue, please accept the answer for the benefit of other users by clicking the checkmark icon next to the answer. Please read the FAQ for more information.

(16 Jul '13, 08:06) grahamb ♦