/* packet-clnp.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
- * $Id: packet-clnp.c,v 1.50 2002/02/27 05:45:48 guy Exp $
+ * $Id: packet-clnp.c,v 1.51 2002/03/27 04:27:03 guy Exp $
* Laurent Deniel <deniel@worldnet.fr>
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
proto_tree *ft=NULL;
proto_item *fi=NULL;
- /* OK, we have the complete reassembled payload. */
+ /* OK, we have the complete reassembled payload.
+ Allocate a new tvbuff, referring to the reassembled payload. */
+ next_tvb = tvb_new_real_data(fd_head->data, fd_head->datalen,
+ fd_head->datalen);
+
+ /* Add the tvbuff to the list of tvbuffs to which the tvbuff we
+ were handed refers, so it'll get cleaned up when that tvbuff
+ is cleaned up. */
+ tvb_set_child_real_data_tvbuff(tvb, next_tvb);
+
+ /* Add the defragmented data to the data source list. */
+ add_new_data_source(pinfo->fd, next_tvb, "Reassembled CLNP");
+
+ /* It's not fragmented. */
+ pinfo->fragmented = FALSE;
+
/* show all segments */
fi = proto_tree_add_item(clnp_tree, hf_clnp_segments,
- tvb, 0, 0, FALSE);
+ next_tvb, 0, -1, FALSE);
ft = proto_item_add_subtree(fi, ett_clnp_segments);
for (fd = fd_head->next; fd != NULL; fd = fd->next){
if (fd->flags & (FD_OVERLAP|FD_OVERLAPCONFLICT
hf = hf_clnp_segment;
}
fei = proto_tree_add_none_format(ft, hf,
- tvb, 0, 0,
+ next_tvb, fd->offset, fd->len,
"Frame:%u payload:%u-%u",
fd->frame,
fd->offset,
fet = proto_item_add_subtree(fei, ett_clnp_segment);
if (fd->flags&FD_OVERLAP) {
proto_tree_add_boolean(fet,
- hf_clnp_segment_overlap, tvb, 0, 0,
+ hf_clnp_segment_overlap, next_tvb, 0, 0,
TRUE);
}
if (fd->flags&FD_OVERLAPCONFLICT) {
proto_tree_add_boolean(fet,
- hf_clnp_segment_overlap_conflict, tvb, 0, 0,
+ hf_clnp_segment_overlap_conflict, next_tvb, 0, 0,
TRUE);
}
if (fd->flags&FD_MULTIPLETAILS) {
proto_tree_add_boolean(fet,
- hf_clnp_segment_multiple_tails, tvb, 0, 0,
+ hf_clnp_segment_multiple_tails, next_tvb, 0, 0,
TRUE);
}
if (fd->flags&FD_TOOLONGFRAGMENT) {
proto_tree_add_boolean(fet,
- hf_clnp_segment_too_long_segment, tvb, 0, 0,
+ hf_clnp_segment_too_long_segment, next_tvb, 0, 0,
TRUE);
}
} else {
/* nothing of interest for this segment */
proto_tree_add_none_format(ft, hf_clnp_segment,
- tvb, 0, 0,
+ next_tvb, fd->offset, fd->len,
"Frame:%u payload:%u-%u",
fd->frame,
fd->offset,
update_col_info = FALSE;
}
}
-
- /* Allocate a new tvbuff, referring to the reassembled payload. */
- next_tvb = tvb_new_real_data(fd_head->data, fd_head->datalen,
- fd_head->datalen);
-
- /* Add the tvbuff to the list of tvbuffs to which the tvbuff we
- were handed refers, so it'll get cleaned up when that tvbuff
- is cleaned up. */
- tvb_set_child_real_data_tvbuff(tvb, next_tvb);
-
- /* Add the defragmented data to the data source list. */
- add_new_data_source(pinfo->fd, next_tvb, "Reassembled CLNP");
-
- /* It's not fragmented. */
- pinfo->fragmented = FALSE;
} else {
/* We don't have the complete reassembled payload. */
next_tvb = NULL;
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
- * $Id: packet-ip.c,v 1.163 2002/02/27 05:45:48 guy Exp $
+ * $Id: packet-ip.c,v 1.164 2002/03/27 04:27:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
proto_tree *ft=NULL;
proto_item *fi=NULL;
- /* OK, we have the complete reassembled payload. */
+ /* OK, we have the complete reassembled payload.
+ Allocate a new tvbuff, referring to the reassembled payload. */
+ next_tvb = tvb_new_real_data(ipfd_head->data, ipfd_head->datalen,
+ ipfd_head->datalen);
+
+ /* Add the tvbuff to the list of tvbuffs to which the tvbuff we
+ were handed refers, so it'll get cleaned up when that tvbuff
+ is cleaned up. */
+ tvb_set_child_real_data_tvbuff(tvb, next_tvb);
+
+ /* Add the defragmented data to the data source list. */
+ add_new_data_source(pinfo->fd, next_tvb, "Reassembled IPv4");
+
+ /* It's not fragmented. */
+ pinfo->fragmented = FALSE;
+
/* show all fragments */
fi = proto_tree_add_item(ip_tree, hf_ip_fragments,
- tvb, 0, 0, FALSE);
+ next_tvb, 0, -1, FALSE);
ft = proto_item_add_subtree(fi, ett_ip_fragments);
for (ipfd=ipfd_head->next; ipfd; ipfd=ipfd->next){
if (ipfd->flags & (FD_OVERLAP|FD_OVERLAPCONFLICT
hf = hf_ip_fragment;
}
fei = proto_tree_add_none_format(ft, hf,
- tvb, 0, 0,
+ next_tvb, ipfd->offset, ipfd->len,
"Frame:%u payload:%u-%u",
ipfd->frame,
ipfd->offset,
fet = proto_item_add_subtree(fei, ett_ip_fragment);
if (ipfd->flags&FD_OVERLAP) {
proto_tree_add_boolean(fet,
- hf_ip_fragment_overlap, tvb, 0, 0,
+ hf_ip_fragment_overlap, next_tvb, 0, 0,
TRUE);
}
if (ipfd->flags&FD_OVERLAPCONFLICT) {
proto_tree_add_boolean(fet,
- hf_ip_fragment_overlap_conflict, tvb, 0, 0,
+ hf_ip_fragment_overlap_conflict, next_tvb, 0, 0,
TRUE);
}
if (ipfd->flags&FD_MULTIPLETAILS) {
proto_tree_add_boolean(fet,
- hf_ip_fragment_multiple_tails, tvb, 0, 0,
+ hf_ip_fragment_multiple_tails, next_tvb, 0, 0,
TRUE);
}
if (ipfd->flags&FD_TOOLONGFRAGMENT) {
proto_tree_add_boolean(fet,
- hf_ip_fragment_too_long_fragment, tvb, 0, 0,
+ hf_ip_fragment_too_long_fragment, next_tvb, 0, 0,
TRUE);
}
} else {
/* nothing of interest for this fragment */
proto_tree_add_none_format(ft, hf_ip_fragment,
- tvb, 0, 0,
+ next_tvb, ipfd->offset, ipfd->len,
"Frame:%u payload:%u-%u",
ipfd->frame,
ipfd->offset,
update_col_info = FALSE;
}
}
-
- /* Allocate a new tvbuff, referring to the reassembled payload. */
- next_tvb = tvb_new_real_data(ipfd_head->data, ipfd_head->datalen,
- ipfd_head->datalen);
-
- /* Add the tvbuff to the list of tvbuffs to which the tvbuff we
- were handed refers, so it'll get cleaned up when that tvbuff
- is cleaned up. */
- tvb_set_child_real_data_tvbuff(tvb, next_tvb);
-
- /* Add the defragmented data to the data source list. */
- add_new_data_source(pinfo->fd, next_tvb, "Reassembled IPv4");
-
- /* It's not fragmented. */
- pinfo->fragmented = FALSE;
} else {
/* We don't have the complete reassembled payload. */
next_tvb = NULL;
/* packet-ipv6.c
* Routines for IPv6 packet disassembly
*
- * $Id: packet-ipv6.c,v 1.78 2002/02/27 05:45:48 guy Exp $
+ * $Id: packet-ipv6.c,v 1.79 2002/03/27 04:27:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
proto_tree *ft = NULL;
proto_item *fi = NULL;
- /* OK, we have the complete reassembled payload. */
+ /* OK, we have the complete reassembled payload.
+ Allocate a new tvbuff, referring to the reassembled payload. */
+ next_tvb = tvb_new_real_data(ipfd_head->data, ipfd_head->datalen,
+ ipfd_head->datalen);
+
+ /* Add the tvbuff to the list of tvbuffs to which the tvbuff we
+ were handed refers, so it'll get cleaned up when that tvbuff
+ is cleaned up. */
+ tvb_set_child_real_data_tvbuff(tvb, next_tvb);
+
+ /* Add the defragmented data to the data source list. */
+ add_new_data_source(pinfo->fd, next_tvb, "Reassembled IPv6");
+
+ /* It's not fragmented. */
+ pinfo->fragmented = FALSE;
+
/* show all fragments */
fi = proto_tree_add_item(ipv6_tree, hf_ipv6_fragments,
- tvb, 0, 0, FALSE);
+ next_tvb, 0, -1, FALSE);
ft = proto_item_add_subtree(fi, ett_ipv6_fragments);
for (ipfd = ipfd_head->next; ipfd; ipfd = ipfd->next){
if (ipfd->flags & (FD_OVERLAP|FD_OVERLAPCONFLICT
hf = hf_ipv6_fragment;
}
fei = proto_tree_add_none_format(ft, hf,
- tvb, 0, 0,
+ next_tvb, ipfd->offset, ipfd->len,
"Frame:%u payload:%u-%u",
ipfd->frame,
ipfd->offset,
fet = proto_item_add_subtree(fei, ett_ipv6_fragment);
if (ipfd->flags&FD_OVERLAP) {
proto_tree_add_boolean(fet,
- hf_ipv6_fragment_overlap, tvb, 0, 0,
+ hf_ipv6_fragment_overlap, next_tvb, 0, 0,
TRUE);
}
if (ipfd->flags&FD_OVERLAPCONFLICT) {
proto_tree_add_boolean(fet,
- hf_ipv6_fragment_overlap_conflict, tvb, 0, 0,
+ hf_ipv6_fragment_overlap_conflict, next_tvb, 0, 0,
TRUE);
}
if (ipfd->flags&FD_MULTIPLETAILS) {
proto_tree_add_boolean(fet,
- hf_ipv6_fragment_multiple_tails, tvb, 0, 0,
+ hf_ipv6_fragment_multiple_tails, next_tvb, 0, 0,
TRUE);
}
if (ipfd->flags&FD_TOOLONGFRAGMENT) {
proto_tree_add_boolean(fet,
- hf_ipv6_fragment_too_long_fragment, tvb, 0, 0,
+ hf_ipv6_fragment_too_long_fragment, next_tvb, 0, 0,
TRUE);
}
} else {
/* nothing of interest for this fragment */
proto_tree_add_none_format(ft, hf_ipv6_fragment,
- tvb, 0, 0,
+ next_tvb, ipfd->offset, ipfd->len,
"Frame:%u payload:%u-%u",
ipfd->frame,
ipfd->offset,
update_col_info = FALSE;
}
}
-
- /* Allocate a new tvbuff, referring to the reassembled payload. */
- next_tvb = tvb_new_real_data(ipfd_head->data, ipfd_head->datalen,
- ipfd_head->datalen);
-
- /* Add the tvbuff to the list of tvbuffs to which the tvbuff we
- were handed refers, so it'll get cleaned up when that tvbuff
- is cleaned up. */
- tvb_set_child_real_data_tvbuff(tvb, next_tvb);
-
- /* Add the defragmented data to the data source list. */
- add_new_data_source(pinfo->fd, next_tvb, "Reassembled IPv6");
-
- /* It's not fragmented. */
- pinfo->fragmented = FALSE;
} else {
/* We don't have the complete reassembled payload. */
next_tvb = NULL;
* Routines for rpc dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
- * $Id: packet-rpc.c,v 1.87 2002/02/18 23:51:55 guy Exp $
+ * $Id: packet-rpc.c,v 1.88 2002/03/27 04:27:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
/*
* Show a tree with information about all fragments.
*/
- si = proto_tree_add_text(tree, tvb, 0, 0, "Fragments");
+ si = proto_tree_add_text(tree, tvb, 0, -1, "Fragments");
st = proto_item_add_subtree(si, ett_rpc_fragments);
for (ipfd = ipfd_head->next; ipfd != NULL; ipfd = ipfd->next) {
- proto_tree_add_text(st, tvb, 0, 0,
+ proto_tree_add_text(st, tvb, ipfd->offset, ipfd->len,
"Frame:%u [%u-%u]",
ipfd->frame,
ipfd->offset,
* significant rewrite to tvbuffify the dissector, Ronnie Sahlberg and
* Guy Harris 2001
*
- * $Id: packet-smb-pipe.c,v 1.71 2002/03/16 04:39:28 sahlberg Exp $
+ * $Id: packet-smb-pipe.c,v 1.72 2002/03/27 04:27:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
d_tvb=new_tvb;
/* list what segments we have */
- it = proto_tree_add_text(tree, d_tvb, 0, 0, "Fragments");
+ it = proto_tree_add_text(tree, d_tvb, 0, -1, "Fragments");
tr = proto_item_add_subtree(it, ett_smb_pipe_fragments);
for(fd=fd_head->next;fd;fd=fd->next){
- proto_tree_add_text(tr, d_tvb, 0, 0, "Frame:%u Data:%u-%u",
- fd->frame, fd->offset, fd->offset+fd->len-1);
+ proto_tree_add_text(tr, d_tvb, fd->offset, fd->len,
+ "Frame:%u Data:%u-%u",
+ fd->frame, fd->offset,
+ fd->offset+fd->len-1);
}
}
}
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
* 2001 Rewrite by Ronnie Sahlberg and Guy Harris
*
- * $Id: packet-smb.c,v 1.236 2002/03/26 08:23:58 guy Exp $
+ * $Id: packet-smb.c,v 1.237 2002/03/27 04:27:04 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
proto_item *it;
fragment_data *fd;
- it = proto_tree_add_text(tree, tvb, 0, 0, "Fragments");
- tr = proto_item_add_subtree(it, ett_smb_segments);
- for(fd=r_fd->next;fd;fd=fd->next){
- proto_tree_add_text(tr, tvb, 0, 0, "Frame:%u Data:%u-%u",
- fd->frame, fd->offset, fd->offset+fd->len-1);
- }
-
pd_tvb = tvb_new_real_data(r_fd->data, r_fd->datalen,
r_fd->datalen);
tvb_set_child_real_data_tvbuff(tvb, pd_tvb);
add_new_data_source(pinfo->fd, pd_tvb, "Reassembled SMB");
pinfo->fragmented = FALSE;
+
+ it = proto_tree_add_text(tree, pd_tvb, 0, -1, "Fragments");
+ tr = proto_item_add_subtree(it, ett_smb_segments);
+ for(fd=r_fd->next;fd;fd=fd->next){
+ proto_tree_add_text(tr, pd_tvb, fd->offset, fd->len,
+ "Frame:%u Data:%u-%u",
+ fd->frame, fd->offset,
+ fd->offset+fd->len-1);
+ }
}
proto_tree *tr;
proto_item *it;
fragment_data *fd;
-
- it = proto_tree_add_text(tree, tvb, 0, 0, "Fragments");
- tr = proto_item_add_subtree(it, ett_smb_segments);
- for(fd=r_fd->next;fd;fd=fd->next){
- proto_tree_add_text(tr, tvb, 0, 0, "Frame:%u Data:%u-%u",
- fd->frame, fd->offset, fd->offset+fd->len-1);
- }
-
+
pd_tvb = tvb_new_real_data(r_fd->data, r_fd->datalen,
r_fd->datalen);
tvb_set_child_real_data_tvbuff(tvb, pd_tvb);
add_new_data_source(pinfo->fd, pd_tvb, "Reassembled SMB");
pinfo->fragmented = FALSE;
+
+ it = proto_tree_add_text(tree, pd_tvb, 0, -1, "Fragments");
+ tr = proto_item_add_subtree(it, ett_smb_segments);
+ for(fd=r_fd->next;fd;fd=fd->next){
+ proto_tree_add_text(tr, pd_tvb, fd->offset, fd->len,
+ "Frame:%u Data:%u-%u",
+ fd->frame, fd->offset,
+ fd->offset+fd->len-1);
+ }
}
/* packet-tcp.c
* Routines for TCP packet disassembly
*
- * $Id: packet-tcp.c,v 1.134 2002/02/24 02:59:30 guy Exp $
+ * $Id: packet-tcp.c,v 1.135 2002/03/27 04:27:05 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
* end may, in turn, require desegmentation),
* so we show a tree with all segments.
*/
- si = proto_tree_add_text(tcp_tree, tvb, 0, 0,
- "Segments");
+ si = proto_tree_add_text(tcp_tree, next_tvb,
+ 0, -1, "Segments");
st = proto_item_add_subtree(si, ett_tcp_segments);
for(ipfd=ipfd_head->next; ipfd; ipfd=ipfd->next){
- proto_tree_add_text(st, tvb, 0, 0,
+ proto_tree_add_text(st, next_tvb,
+ ipfd->offset, ipfd->len,
"Frame:%u seq#:%u-%u [%u-%u]",
ipfd->frame,
tsk->start_seq + ipfd->offset,