Wireshark-dev: Re: [Wireshark-dev] Filtering
Date: Tue, 31 Mar 2009 20:19:48 +0000
I have read through both of those, though i probably should do it again now that i know more. But maybe I'm just confused on how the others are outputted. right now i add to the tree with: 

time = (_GetMsgTime)();
pi = proto_tree_add_text(icom_message_tree, tvb, 0, 0, "Time: %s", time);

where time is a char *. in the other proto_tree_add_'s, does it go to the hf_icom_* in proto register? and output from there? That's how i output the first message:

{ &hf_icom_bnp_type,
	{ "ICom BNP Type", "icom.type",
	FT_UINT8, BASE_DEC,	
	VALS(bnp_type_names), 0x0,
	NULL, HFILL }
         },

would there be a way to put my function somewhere in these calls? such as:

{ &hf_icom_message,
	{"Message", "icom.message",
	FT_UINT16, BASE_DEC,
	(function call here?), 0x0,
	NULL, HFILL }
	}

or maybe in a value_string? all functions return a char * or int as their only types. Maybe i dont have a very understanding of how the proto_tree_add and hf[] array works and all. 

Greg

---- "Maynard wrote: 

=============
I would suggest reading through doc/README.developer and epan/proto.[h|c] and choosing the best proto_tree_add_xyz() call that meets your needs.  Maybe something like proto_tree_add_bytes() or proto_tree_add_item() will work for you, I don't know.  There are quite a number of them to choose from, so I'm pretty sure you'll find one that works for you.  And don't forget to look at other dissectors in epan/dissectors/ for some helpful examples.