* Routines for ICP (internet cache protocol) packet disassembly
* RFC 2186 && RFC 2187
*
- * $Id: packet-icp.c,v 1.8 2000/05/31 05:07:06 guy Exp $
+ * $Id: packet-icp.c,v 1.9 2000/08/06 07:22:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Peter Torvals
frame_data *fd,proto_tree *pload_tree, e_icphdr *icph)
{
/* To Be Done take care of fragmentation*/
-guint32 maxlength=fd->pkt_len-offset;
+guint32 maxlength=END_OF_FRAME;
guint32 i;
guint16 objectlength;
switch(icph->opcode)
if (tree)
{
- ti = proto_tree_add_item(tree,proto_icp, NullTVB,offset,fd->pkt_len-offset, FALSE);
+ ti = proto_tree_add_item(tree,proto_icp, NullTVB,offset,END_OF_FRAME, FALSE);
icp_tree = proto_item_add_subtree(ti, ett_icp);
proto_tree_add_uint_format(icp_tree,hf_icp_opcode, NullTVB, offset, 1,
/* packet-icq.c
* Routines for ICQ packet disassembly
*
- * $Id: packet-icq.c,v 1.17 2000/08/05 00:55:55 guy Exp $
+ * $Id: packet-icq.c,v 1.18 2000/08/06 07:22:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Johan Feyaerts
seqnum1 = pletohs(&pd[ICQ5_SRV_SEQNUM1]);
seqnum2 = pletohs(&pd[ICQ5_SRV_SEQNUM2]);
if (pktsize == -1)
- pktsize = fd->pkt_len - offset;
+ pktsize = END_OF_FRAME;
decr_pd = pd;
if (changeCol && check_col(fd, COL_INFO))
* Routines for Microsoft Proxy packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-msproxy.c,v 1.4 2000/05/31 16:49:42 gram Exp $
+ * $Id: packet-msproxy.c,v 1.5 2000/08/06 07:22:34 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
# include "snprintf.h"
#endif
-#define CHECK_PACKET_LENGTH(X) if ((offset+X) > fd->cap_len){ \
+#define CHECK_PACKET_LENGTH(X) if ((offset+X) > pi.captured_len){ \
proto_tree_add_text(tree, NullTVB, offset, 0, "****FRAME TOO SHORT***"); return;}
extern void udp_hash_add(guint16 proto,
char temp[255];
- if ((offset+ 1) > fd->cap_len){
+ if ((offset+ 1) > pi.captured_len){
proto_tree_add_text(tree, NullTVB, offset, 0, "****FRAME TOO SHORT***");
return 0;
}
* Routines for nfs dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
- * $Id: packet-nfs.c,v 1.32 2000/08/03 19:27:19 guy Exp $
+ * $Id: packet-nfs.c,v 1.33 2000/08/06 07:22:35 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
/* Make use of the new tvbuf code.
There is no way to get the packet_info here. So we have to
create a totally new tvbuf. */
- realtvb = tvb_new_real_data(pd, fd->cap_len, fd->pkt_len);
+ realtvb = tvb_new_real_data(pd, pi.captured_len, pi.len);
tvb = tvb_new_subset(realtvb, offset,
- fd->cap_len - offset,
- fd->pkt_len - offset);
+ pi.captured_len - offset,
+ pi.len - offset);
/* filehandle too long */
if (fhlen>64) goto type_ready;
* Routines for unix rlogin packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-rlogin.c,v 1.4 2000/08/06 05:19:25 guy Exp $
+ * $Id: packet-rlogin.c,v 1.5 2000/08/06 07:22:37 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
# include "snprintf.h"
#endif
-#define CHECK_PACKET_LENGTH(X) if ((offset+X) > fd->cap_len){ \
+#define CHECK_PACKET_LENGTH(X) if ((offset+X) > pi.captured_len){ \
proto_tree_add_text(tree, NullTVB, offset, 0, "*** FRAME TOO SHORT ***"); \
return; }
* Routines for smb net logon packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-smb-logon.c,v 1.5 2000/05/31 05:07:41 guy Exp $
+ * $Id: packet-smb-logon.c,v 1.6 2000/08/06 07:22:37 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
proto_tree_add_text( tree, NullTVB, *offset, 2,
"LM10 Token: 0x%x (WFW Networking)", Token);
- if (( *offset + 2) > fd->cap_len)
+ if (( *offset + 2) > pi.captured_len)
proto_tree_add_text(tree, NullTVB, *offset, 0,"****FRAME TOO SHORT***");
else
*offset += 2;
proto_tree_add_text( tree, NullTVB, *offset, length, "NT Version: 0x%x ",
Version);
- if (( *offset + length) > fd->cap_len)
+ if (( *offset + length) > pi.captured_len)
proto_tree_add_text(tree, NullTVB, *offset, 0, "****FRAME TOO SHORT***");
else
*offset += length;
* Routines for socks versions 4 &5 packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-socks.c,v 1.5 2000/05/31 05:07:48 guy Exp $
+ * $Id: packet-socks.c,v 1.6 2000/08/06 07:22:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
-#define CHECK_PACKET_LENGTH(X) if ((offset+X) > fd->cap_len){ \
+#define CHECK_PACKET_LENGTH(X) if ((offset+X) > pi.captured_len){ \
proto_tree_add_text(tree, NullTVB, offset, 0, "*** FRAME TOO SHORT ***"); \
return; }
char temp[ 256];
int length = GBYTE( pd, offset);
- if ((offset + 8) > fd->cap_len){
+ if ((offset + 8) > pi.captured_len){
proto_tree_add_text(tree, NullTVB, offset, 0, "*** FRAME TOO SHORT ***");
return 0;
}
++offset;
if ( a_type == 1){ /* IPv4 address */
- if ( (offset + 4) > fd->cap_len)
+ if ( (offset + 4) > pi.captured_len)
proto_tree_add_text(tree, NullTVB, offset, 0, "*** FRAME TOO SHORT ***");
proto_tree_add_ipv4( tree, hf_socks_ip_dst, NullTVB, offset,
"Remote name");
}
else if ( a_type == 4){ /* IPv6 address */
- if ((offset + 16) > fd->cap_len)
+ if ((offset + 16) > pi.captured_len)
proto_tree_add_text(tree, NullTVB, offset, 0, "*** FRAME TOO SHORT ***");
proto_tree_add_ipv6( tree, hf_socks_ip6_dst, NullTVB, offset,
hash_info->state = Connecting; /* change state */
hash_info->connect_row = get_packet_ptr;
- if (( offset+ 1) > fd->cap_len){
+ if (( offset+ 1) > pi.captured_len){
hash_info->state = Done; /* change state */
return;
}
guint temp;
- if (( offset+ 1) > fd->cap_len){
+ if (( offset+ 1) > pi.captured_len){
hash_info->state = Done; /* change state */
return;
}
offset = get_address_v5( pd, offset, hash_info);
- if (( offset+ 1) > fd->cap_len){
+ if (( offset+ 1) > pi.captured_len){
hash_info->state = Done;
return;
}
offset = get_address_v5( pd, offset, hash_info);
/* save server udp port and create upd conversation */
- if (( offset+ 2) > fd->cap_len){
+ if (( offset+ 2) > pi.captured_len){
hash_info->state = Done;
return;
}
* Routines for v120 frame disassembly
* Bert Driehuis <driehuis@playbeing.org>
*
- * $Id: packet-v120.c,v 1.9 2000/05/31 03:58:54 gram Exp $
+ * $Id: packet-v120.c,v 1.10 2000/08/06 07:22:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
if (check_col(pinfo->fd, COL_INFO))
col_add_str(pinfo->fd, COL_INFO, "Invalid V.120 frame");
if (tree)
- ti = proto_tree_add_protocol_format(tree, proto_v120, tvb, 0, pinfo->fd->cap_len,
+ ti = proto_tree_add_protocol_format(tree, proto_v120, tvb, 0, tvb_length(tvb),
"Invalid V.120 frame");
return;
}