/*
- * $Id: ftype-tvbuff.c,v 1.4 2001/03/02 17:17:56 gram Exp $
+ * $Id: ftype-tvbuff.c,v 1.5 2001/03/13 21:34:28 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
static void
slice(fvalue_t *fv, GByteArray *bytes, guint offset, guint length)
{
- guint8* data;
+ const guint8* data;
if (fv->value.tvb) {
TRY {
* the data of a backing tvbuff, or can be a composite of
* other tvbuffs.
*
- * $Id: tvbuff.c,v 1.14 2000/12/27 12:48:27 guy Exp $
+ * $Id: tvbuff.c,v 1.15 2001/03/13 21:34:27 gram Exp $
*
* Copyright (c) 2000 by Gilbert Ramirez <gram@xiexie.org>
*
-guint8*
+const guint8*
tvb_get_ptr(tvbuff_t *tvb, gint offset, gint length)
{
return ensure_contiguous(tvb, offset, length);
* the data of a backing tvbuff, or can be a composite of
* other tvbuffs.
*
- * $Id: tvbuff.h,v 1.10 2000/12/27 12:48:27 guy Exp $
+ * $Id: tvbuff.h,v 1.11 2001/03/13 21:34:27 gram Exp $
*
* Copyright (c) 2000 by Gilbert Ramirez <gram@xiexie.org>
*
* and the pointer to the newly-contiguous data is returned. This dynamically-
* allocated memory will be freed when the tvbuff is freed, after the
* tvbuff_free_cb_t() is called, if any. */
-guint8* tvb_get_ptr(tvbuff_t*, gint offset, gint length);
+const guint8* tvb_get_ptr(tvbuff_t*, gint offset, gint length);
/* Find first occurence of any of the needles in tvbuff, starting at offset.
* Searches at most maxlength number of bytes; if maxlength is -1, searches
/* packet-aarp.c
* Routines for Appletalk ARP packet disassembly
*
- * $Id: packet-aarp.c,v 1.28 2001/01/22 00:20:29 guy Exp $
+ * $Id: packet-aarp.c,v 1.29 2001/03/13 21:34:23 gram Exp $
*
* Simon Wilkinson <sxw@dcs.ed.ac.uk>
*
}
static gchar *
-aarphrdaddr_to_str(guint8 *ad, int ad_len, guint16 type) {
+aarphrdaddr_to_str(const guint8 *ad, int ad_len, guint16 type) {
if ((type == AARPHRD_ETHER || type == AARPHRD_TR) && ad_len == 6) {
/* Ethernet address (or Token Ring address, which is the same type
of address). */
}
static gchar *
-aarpproaddr_to_str(guint8 *ad, int ad_len, guint16 type) {
+aarpproaddr_to_str(const guint8 *ad, int ad_len, guint16 type) {
if (type == ETHERTYPE_ATALK && ad_len == 4) {
/* IP address. */
return atalkid_to_str(ad);
proto_item *ti;
gchar *op_str;
int sha_offset, spa_offset, tha_offset, tpa_offset;
- guint8 *sha_val, *spa_val, *tha_val, *tpa_val;
+ const guint8 *sha_val, *spa_val, *tha_val, *tpa_val;
gchar *sha_str, *spa_str, *tha_str, *tpa_str;
if(check_col(pinfo->fd, COL_PROTOCOL))
/* packet-arp.c
* Routines for ARP packet disassembly
*
- * $Id: packet-arp.c,v 1.42 2001/01/09 06:31:33 guy Exp $
+ * $Id: packet-arp.c,v 1.43 2001/03/13 21:34:23 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#define ATMARP_LEN_MASK 0x3F /* length of {sub}address in type/length */
gchar *
-arphrdaddr_to_str(guint8 *ad, int ad_len, guint16 type)
+arphrdaddr_to_str(const guint8 *ad, int ad_len, guint16 type)
{
if (ad_len == 0)
return "<No address>";
}
static gchar *
-arpproaddr_to_str(guint8 *ad, int ad_len, guint16 type)
+arpproaddr_to_str(const guint8 *ad, int ad_len, guint16 type)
{
if (ad_len == 0)
return "<No address>";
#define MAX_E164_STR_LEN 20
static gchar *
-atmarpnum_to_str(guint8 *ad, int ad_tl)
+atmarpnum_to_str(const guint8 *ad, int ad_tl)
{
int ad_len = ad_tl & ATMARP_LEN_MASK;
static gchar str[N_ATMARPNUM_TO_STR_STRINGS][MAX_E164_STR_LEN+3+1];
}
static gchar *
-atmarpsubaddr_to_str(guint8 *ad, int ad_tl)
+atmarpsubaddr_to_str(const guint8 *ad, int ad_tl)
{
int ad_len = ad_tl & ATMARP_LEN_MASK;
gchar *op_str;
int sha_offset, ssa_offset, spa_offset;
int tha_offset, tsa_offset, tpa_offset;
- guint8 *sha_val, *ssa_val, *spa_val;
- guint8 *tha_val, *tsa_val, *tpa_val;
+ const guint8 *sha_val, *ssa_val, *spa_val;
+ const guint8 *tha_val, *tsa_val, *tpa_val;
gchar *sha_str, *ssa_str, *spa_str;
gchar *tha_str, *tsa_str, *tpa_str;
proto_tree *tl_tree;
proto_item *ti;
gchar *op_str;
int sha_offset, spa_offset, tha_offset, tpa_offset;
- guint8 *sha_val, *spa_val, *tha_val, *tpa_val;
+ const guint8 *sha_val, *spa_val, *tha_val, *tpa_val;
gchar *sha_str, *spa_str, *tha_str, *tpa_str;
CHECK_DISPLAY_AS_DATA(proto_arp, tvb, pinfo, tree);
/* inform resolv.c module of the new discovered addresses */
u_int ip;
- guint8 *mac;
+ const guint8 *mac;
/* add sender address in all cases */
* Definitions of routines for ARP packet disassembly that are used
* elsewhere
*
- * $Id: packet-arp.h,v 1.4 2000/11/13 07:18:40 guy Exp $
+ * $Id: packet-arp.h,v 1.5 2001/03/13 21:34:23 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#ifndef __PACKET_ARP_H__
#define __PACKET_ARP_H__
-gchar *arphrdaddr_to_str(guint8 *ad, int ad_len, guint16 type);
+gchar *arphrdaddr_to_str(const guint8 *ad, int ad_len, guint16 type);
gchar *arphrdtype_to_str(guint16 hwtype, const char *fmt);
void dissect_atm_nsap(tvbuff_t *tvb, int offset, int len, proto_tree *tree);
* Routines for BOOTP/DHCP packet disassembly
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-bootp.c,v 1.47 2001/02/13 00:01:07 guy Exp $
+ * $Id: packet-bootp.c,v 1.48 2001/03/13 21:34:23 gram Exp $
*
* The information used comes from:
* RFC 951: Bootstrap Protocol
proto_item *ti;
guint8 op;
guint8 htype, hlen;
- guint8 *haddr;
+ const guint8 *haddr;
int voff, eoff; /* vender offset, end offset */
guint32 ip_addr;
gboolean is_dhcp = FALSE;
/* packet-bpdu.c
* Routines for BPDU (Spanning Tree Protocol) disassembly
*
- * $Id: packet-bpdu.c,v 1.23 2001/02/08 07:32:11 guy Exp $
+ * $Id: packet-bpdu.c,v 1.24 2001/03/13 21:34:23 gram Exp $
*
* Copyright 1999 Christophe Tronche <ch.tronche@computer.org>
*
guint8 bpdu_type;
guint8 flags;
guint16 root_identifier_bridge_priority;
- guint8 *root_identifier_mac;
+ const guint8 *root_identifier_mac;
gchar *root_identifier_mac_str;
guint32 root_path_cost;
guint16 bridge_identifier_bridge_priority;
- guint8 *bridge_identifier_mac;
+ const guint8 *bridge_identifier_mac;
gchar *bridge_identifier_mac_str;
guint16 port_identifier;
double message_age;
/* packet-clnp.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
- * $Id: packet-clnp.c,v 1.24 2001/01/22 08:03:44 guy Exp $
+ * $Id: packet-clnp.c,v 1.25 2001/03/13 21:34:23 gram Exp $
* Laurent Deniel <deniel@worldnet.fr>
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
guint16 cnf_cksum;
int offset;
u_char src_len, dst_len, nsel, opt_len = 0;
- guint8 *dst_addr, *src_addr;
+ const guint8 *dst_addr, *src_addr;
guint len;
guint next_length;
proto_tree *discpdu_tree;
* Charles Levert <charles@comm.polymtl.ca>
* Copyright 2001 Charles Levert
*
-* $Id: packet-cups.c,v 1.1 2001/03/11 02:08:30 guy Exp $
+* $Id: packet-cups.c,v 1.2 2001/03/13 21:34:23 gram Exp $
*
*
* This program is free software; you can redistribute it and/or
gint *next_offset);
static void get_space(tvbuff_t *tvb, gint offset,
gint *next_offset);
-static guint8* get_quoted_string(tvbuff_t *tvb, gint offset,
+static const guint8* get_quoted_string(tvbuff_t *tvb, gint offset,
gint *next_offset, guint *len);
-static guint8* get_unquoted_string(tvbuff_t *tvb, gint offset,
+static const guint8* get_unquoted_string(tvbuff_t *tvb, gint offset,
gint *next_offset, guint *len);
/**********************************************************************/
gint next_offset;
guint len;
unsigned int u;
- guint8 *str;
+ const guint8 *str;
cups_ptype_t ptype;
unsigned int state;
return;
}
-static guint8*
+static const guint8*
get_quoted_string(tvbuff_t *tvb, gint offset, gint *next_offset, guint *len)
{
int c;
- guint8* s = 0;
+ const guint8* s = NULL;
guint l = 0;
gint o;
return s;
}
-static guint8*
+static const guint8*
get_unquoted_string(tvbuff_t *tvb, gint offset, gint *next_offset, guint *len)
{
- guint8* s = 0;
+ const guint8* s = NULL;
guint l = 0;
gint o;
/* packet-eth.c
* Routines for ethernet packet disassembly
*
- * $Id: packet-eth.c,v 1.60 2001/02/08 07:08:05 guy Exp $
+ * $Id: packet-eth.c,v 1.61 2001/03/13 21:34:23 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
{
int orig_captured_len;
proto_item *ti;
- guint8 *dst, *src;
+ const guint8 *dst, *src;
const guint8 *pd;
guint16 etype;
* Copyright 2000, Axis Communications AB
* Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
*
- * $Id: packet-ieee80211.c,v 1.13 2001/02/01 06:20:25 guy Exp $
+ * $Id: packet-ieee80211.c,v 1.14 2001/03/13 21:34:23 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
static void
add_fixed_field (proto_tree * tree, tvbuff_t * tvb, int offset, int lfcode)
{
- guint8 *dataptr;
+ const guint8 *dataptr;
char out_buff[SHORT_STR];
guint16 *temp16;
proto_item *cap_item;
static int
add_tagged_field (proto_tree * tree, tvbuff_t * tvb, int offset)
{
- guint8 *tag_info_ptr;
- guint8 *tag_data_ptr;
+ const guint8 *tag_info_ptr;
+ const guint8 *tag_data_ptr;
guint32 tag_no, tag_len;
int i, n;
char out_buff[SHORT_STR];
dissect_ieee80211 (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
{
guint16 fcf, flags;
- guint8 *src = NULL, *dst = NULL;
+ const guint8 *src = NULL, *dst = NULL;
proto_item *ti;
proto_item *flag_item;
proto_item *fc_item;
* Routines for NetWare's IPX
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-ipx.c,v 1.78 2001/02/27 07:28:47 guy Exp $
+ * $Id: packet-ipx.c,v 1.79 2001/03/13 21:34:23 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
proto_tree *ipx_tree;
proto_item *ti;
- guint8 *src_net_node, *dst_net_node;
+ const guint8 *src_net_node, *dst_net_node;
guint8 ipx_type, ipx_hops;
guint16 ipx_length;
* Routines for NTP packet dissection
* Copyright 1999, Nathan Neulinger <nneul@umr.edu>
*
- * $Id: packet-ntp.c,v 1.25 2001/01/22 08:03:45 guy Exp $
+ * $Id: packet-ntp.c,v 1.26 2001/03/13 21:34:23 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
* returns pointer to filled buffer.
*/
static char *
-ntp_fmt_ts(guint8 *reftime, char* buff)
+ntp_fmt_ts(const guint8 *reftime, char* buff)
{
guint32 tempstmp, tempfrac;
time_t temptime;
gint8 precision;
double rootdelay;
double rootdispersion;
- guint8 *refid;
- guint8 *reftime;
- guint8 *org;
- guint8 *rec;
- guint8 *xmt;
+ const guint8 *refid;
+ const guint8 *reftime;
+ const guint8 *org;
+ const guint8 *rec;
+ const guint8 *xmt;
gchar buff[NTP_TS_SIZE];
int i;
* Routines for RADIUS packet disassembly
* Copyright 1999 Johan Feyaerts
*
- * $Id: packet-radius.c,v 1.27 2001/02/20 08:10:14 guy Exp $
+ * $Id: packet-radius.c,v 1.28 2001/03/13 21:34:23 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
/*converts the raw buffer into printable text */
guint32 i;
guint32 totlen=0;
- guint8 *pd = tvb_get_ptr(tvb, offset, length);
+ const guint8 *pd = tvb_get_ptr(tvb, offset, length);
dest[0]='"';
dest[1]=0;
gchar *cont;
value_string *valstrarr;
guint32 intval;
- guint8 *pd;
+ const guint8 *pd;
guint8 tag;
/* prints the values of the attribute value pairs into a text buffer */
* Routines for RIPv1 and RIPv2 packet disassembly
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-rip.c,v 1.23 2001/01/22 08:03:45 guy Exp $
+ * $Id: packet-rip.c,v 1.24 2001/03/13 21:34:23 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
{
proto_item *ti;
proto_tree *rip_vektor_tree;
- guint8 *ip;
+ const guint8 *ip;
guint32 metric;
ip = tvb_get_ptr(tvb, offset+4, 4);
*
* Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-sap.c,v 1.19 2001/01/25 06:14:14 guy Exp $
+ * $Id: packet-sap.c,v 1.20 2001/03/13 21:34:23 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
guint8 vers_flags;
guint8 auth_len;
guint16 tmp1;
- guint8 *addr;
+ const guint8 *addr;
guint8 auth_flags;
tvbuff_t *next_tvb;
/* packet-sll.c
* Routines for disassembly of packets from Linux "cooked mode" captures
*
- * $Id: packet-sll.c,v 1.7 2001/01/21 22:51:46 guy Exp $
+ * $Id: packet-sll.c,v 1.8 2001/03/13 21:34:23 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
guint16 pkttype;
guint16 protocol;
guint16 hatype, halen;
- guint8 *src;
+ const guint8 *src;
proto_item *ti;
tvbuff_t *next_tvb;
proto_tree *fh_tree = NULL;
/* packet-smtp.c
* Routines for SMTP packet disassembly
*
- * $Id: packet-smtp.c,v 1.15 2001/01/25 06:14:14 guy Exp $
+ * $Id: packet-smtp.c,v 1.16 2001/03/13 21:34:23 gram Exp $
*
* Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com>
*
conversation_t *conversation;
struct smtp_request_key request_key, *new_request_key;
struct smtp_request_val *request_val;
- char *line;
+ const char *line;
int linelen;
gboolean eom_seen = FALSE;
gint next_offset;
* Routines for SNA
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-sna.c,v 1.25 2001/01/25 06:14:14 guy Exp $
+ * $Id: packet-sna.c,v 1.26 2001/03/13 21:34:24 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
proto_tree *bf_tree;
proto_item *bf_item;
guint8 th_0;
- guint8 *ptr;
+ const guint8 *ptr;
const int bytes_in_header = 10;
proto_tree *bf_tree;
proto_item *bf_item;
guint8 th_0=0, daf=0, oaf=0;
- guint8 *ptr;
+ const guint8 *ptr;
const int bytes_in_header = 6;
* Routines for Token-Ring packet disassembly
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-tr.c,v 1.60 2001/02/23 17:19:52 gram Exp $
+ * $Id: packet-tr.c,v 1.61 2001/03/13 21:34:24 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
*/
int check_for_old_linux_tvb(tvbuff_t *tvb)
{
- guint8 *data;
- int x, bytes;
+ const guint8 *data;
+ int x, bytes;
/* Restrict our looping to the boundaries of the frame */
bytes = tvb_length(tvb);
/* packet-vines.c
* Routines for Banyan VINES protocol packet disassembly
*
- * $Id: packet-vines.c,v 1.24 2001/02/04 10:29:49 guy Exp $
+ * $Id: packet-vines.c,v 1.25 2001/03/13 21:34:24 gram Exp $
*
* Don Lafontaine <lafont02@cn.ca>
*
proto_tree *vip_tree;
proto_item *ti;
/* gchar tos_str[32]; */
- guint8 *dst_addr, *src_addr;
+ const guint8 *dst_addr, *src_addr;
int is_broadcast = 0;
int hops = 0;
tvbuff_t *next_tvb;
/* packet-vtp.c
* Routines for the disassembly of Cisco's Virtual Trunking Protocol
*
- * $Id: packet-vtp.c,v 1.12 2001/02/05 02:47:31 guy Exp $
+ * $Id: packet-vtp.c,v 1.13 2001/03/13 21:34:24 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
int offset = 0;
guint8 code;
guint8 md_len;
- guint8 *upd_timestamp;
+ const guint8 *upd_timestamp;
int vlan_info_len;
if (check_col(pinfo->fd, COL_PROTOCOL))
*
* Jochen Friedrich <jochen@scram.de>
*
- * $Id: packet-zebra.c,v 1.9 2001/01/22 08:03:46 guy Exp $
+ * $Id: packet-zebra.c,v 1.10 2001/03/13 21:34:24 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
guint32 prefix4;
guint16 i;
guint8 buffer6[16], prefixlen, message;
- guint8 *prefix;
+ const guint8 *prefix;
proto_item *ti;
proto_tree *msg_tree;