Wireshark-dev: Re: [Wireshark-dev] Reassembling: pinfo and 2 functions

Date: Tue, 28 Apr 2009 23:17:13 +0000
Hello all, 
 
You are probably all sick of me. Which is understandable, i ask an obnoxious 
amount of questions. However, i'm very close to being done and if you can help 
me the sooner you get rid of me. 
 
 
Right now i have a switch case for telling which bnp type i have. if 3 i have: 
save_fragmented = pinfo->fragmented; 
pinfo->fragmented = TRUE; 
frag_msg = fragment_add_seq_next(tvb, 3, pinfo, 
			 multiMessageID,			/* ID for fragments belonging together */ 
			 icom_fragment_table,	/* list of message fragments */ 
			 icom_reassembled_table,	/* list of reassembled messages */ 
			 bnpLength,/* fragment length - to the end */ 
			 TRUE);				/* More fragments? */ 
 
next_tvb = process_reassembled_data(tvb, 3, pinfo, 
				   "Reassembled ICom Message", frag_msg, 
				   &icom_fragment_items, NULL, 
				   bnp_tree); 
pinfo->fragmented = save_fragmented; 
 
4: 
save_fragmented = pinfo->fragmented; 
pinfo->fragmented = TRUE; 
frag_msg = fragment_add_seq_next(tvb, 3, pinfo, 
		 multiMessageID,			/* ID for fragments belonging together */ 
		 icom_fragment_table,	/* list of message fragments */ 
		 icom_reassembled_table,	/* list of reassembled messages */ 
		 bnpLength,/* fragment length - to the end */ 
		 TRUE);				/* More fragments? */ 
 
next_tvb = process_reassembled_data(tvb, 3, pinfo, 
			   "Reassembled ICom Message", frag_msg, 
			   &icom_fragment_items, NULL, 
			   bnp_tree); 
pinfo->fragmented = save_fragmented; 
 
5: 
save_fragmented = pinfo->fragmented; 
pinfo->fragmented = TRUE; 
frag_msg = fragment_add_seq_next(tvb, 3, pinfo, 
			 multiMessageID,			/* ID for fragments belonging together */ 
			 icom_fragment_table,	/* list of message fragments */ 
			 icom_reassembled_table,	/* list of reassembled messages */ 
			 bnpLength,/* fragment length - to the end */ 
			 FALSE);				/* More fragments? */ 
 
next_tvb = process_reassembled_data(tvb, 3, pinfo, 
				   "Reassembled ICom Message", frag_msg, 
				   &icom_fragment_items, NULL, 
				   bnp_tree); 
pinfo->fragmented = save_fragmented; 
multiMessageID++; 
if(next_tvb) 
	dissectPacket( next_tvb, bnp_tree, pinfo ); 
 
Now i'm having trouble with what to make the "ID for fragments" sections as 
having an incremented variable i now realize was stupid. 
Also, on the initial dissecting, next_tvb for case 5 appears to have a value, 
however, when i click on it after, it is NULL. 
 
Any ideas for why it is NULL / a way to ID? 
 
Thanks, 
Greg