/* packet-afs-macros.h * Helper macros for AFS packet dissection * Copyright 1999, Nathan Neulinger * Based on routines from tcpdump patches by * Ken Hornstein * Portions based on information retrieved from the RX definitions * in Arla, the free AFS client at http://www.stacken.kth.se/project/arla/ * Portions based on information/specs retrieved from the OpenAFS sources at * www.openafs.org, Copyright IBM. * * $Id: packet-afs-macros.h,v 1.24 2004/05/11 14:21:48 nneul Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs * Copyright 1998 Gerald Combs * * Copied from packet-tftp.c * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Macros for helper dissection routines * * The macros are here to save on coding. They assume that * the current offset is in 'offset', and that the offset * should be incremented after performing the macro's operation. */ /* Output a unsigned integer, stored into field 'field' Assumes it is in network byte order, converts to host before using */ #define OUT_UINT(field) \ proto_tree_add_uint(tree, field, tvb, offset, sizeof(guint32), tvb_get_ntohl(tvb, offset)); \ offset += 4; /* Output a unsigned integer, stored into field 'field' Assumes it is in network byte order, converts to host before using */ #define OUT_INT(field) \ proto_tree_add_int(tree, field, tvb, offset, sizeof(gint32), tvb_get_ntohl(tvb, offset)); \ offset += 4; /* Output a unsigned integer, stored into field 'field' Assumes it is in network byte order, converts to host before using */ #define OUT_UINT64(field) \ proto_tree_add_item(tree, field, tvb, offset, 8, FALSE); \ offset += 8; /* Output a unsigned integer, stored into field 'field' Assumes it is in network byte order, converts to host before using */ #define OUT_INT64(field) \ proto_tree_add_item(tree, field, tvb, offset, 8, FALSE); \ offset += 8; /* Output a unsigned integer, stored into field 'field' Assumes it is in network byte order, converts to host before using, Note - does not increment offset, so can be used repeatedly for bitfields */ #define DISP_UINT(field) \ proto_tree_add_uint(tree,field,tvb,offset,sizeof(guint32),tvb_get_ntohl(tvb, offset)); /* Output an IPv4 address, stored into field 'field' */ #define OUT_IP(field) \ proto_tree_add_ipv4(tree,field,tvb,offset,sizeof(gint32),\ tvb_get_letohl(tvb, offset));\ offset += 4; /* Output a simple rx array */ #define OUT_RXArray8(func) \ { \ unsigned int j,i; \ j = tvb_get_guint8(tvb, offset); \ offset += 1; \ for (i=0; i