Ethereal-dev: [Ethereal-dev] Some static declarations

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Sun, 14 Apr 2002 14:56:25 +0200
Hello,

the following patch declares some variables static. It also creates a
new include file packet-rsvp.h, and makes use of it (changed some
extern decls to #inlcude). I also moved the file packet-pgm.h into
packet-pgm.c as it is not used by anything outside packet-pgm.c

  Ciao
          Jörg
--
Joerg Mayer                                          <jmayer@xxxxxxxxx>
I found out that "pro" means "instead of" (as in proconsul). Now I know
what proactive means.
/* packet-rsvp.h
 *
 * Ethereal - Network traffic analyzer
 * By Gerald Combs <gerald@xxxxxxxxxxxx>
 * Copyright 1998 Gerald Combs
 *
 * 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.
 */

#ifndef PACKET_RSVP_H
#define PACKET_RSVP_H

extern const value_string gmpls_switching_type_str[];
extern const value_string gmpls_lsp_enc_str[];

#endif
Index: ethereal/packet-lmp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-lmp.c,v
retrieving revision 1.1
diff -u -r1.1 packet-lmp.c
--- packet-lmp.c	2002/04/10 22:00:49	1.1
+++ packet-lmp.c	2002/04/14 11:25:35
@@ -65,6 +65,7 @@
 #include "ipproto.h"
 
 #include "packet-ip.h"
+#include "packet-rsvp.h"
 
 static int proto_lmp = -1;
 
@@ -185,12 +186,6 @@
 /*------------------------------------------------------------------------------
  * Other constants & stuff
  */
-
-/*
- * From packet-rsvp.c
- */
-extern const value_string gmpls_lsp_enc_str[];
-extern const value_string gmpls_switching_type_str[];
 
 /* Channel Status */
 static const value_string channel_status_str[] = {
Index: ethereal/packet-nlm.c
===================================================================
RCS file: /cvsroot/ethereal/packet-nlm.c,v
retrieving revision 1.24
diff -u -r1.24 packet-nlm.c
--- packet-nlm.c	2002/04/03 13:24:12	1.24
+++ packet-nlm.c	2002/04/14 11:25:42
@@ -87,7 +87,7 @@
 static gint ett_nlm_lock = -1;
 
 
-const value_string names_nlm_stats[] =
+static const value_string names_nlm_stats[] =
 {
 	/* NLM_GRANTED is the function number 5 and the state code 0.
 	 * So we use for the state the postfix _S.
@@ -116,7 +116,7 @@
 };
 
 
-const value_string names_fsh_mode[] =
+static const value_string names_fsh_mode[] =
 {
 #define FSM_DN	0
 		{	FSM_DN,		"deny none"	},
@@ -131,7 +131,7 @@
 };
 
 
-const value_string names_fsh_access[] =
+static const value_string names_fsh_access[] =
 {
 #define FSA_NONE	0
 		{	FSA_NONE,	"no access"	},
Index: ethereal/packet-osi-options.c
===================================================================
RCS file: /cvsroot/ethereal/packet-osi-options.c,v
retrieving revision 1.10
diff -u -r1.10 packet-osi-options.c
--- packet-osi-options.c	2002/04/07 21:54:48	1.10
+++ packet-osi-options.c	2002/04/14 11:25:44
@@ -165,7 +165,7 @@
         { 0,    NULL} };
      
 
-void
+static void
 dissect_option_qos( const u_char type, const u_char sub_type, int offset,
                     u_char len, tvbuff_t *tvb, proto_tree *tree ) {
 
@@ -216,7 +216,7 @@
   }
 }
 
-void
+static void
 dissect_option_route( u_char parm_type, u_char offset, u_char parm_len, 
                       tvbuff_t *tvb, proto_tree *tree ) {
 
@@ -277,7 +277,7 @@
 
 
 
-void
+static void
 dissect_option_rfd( const u_char error, const u_char field, u_char offset,
                           u_char len, tvbuff_t *tvb, proto_tree *tree ) {
   u_char error_class = 0;
Index: ethereal/packet-ospf.c
===================================================================
RCS file: /cvsroot/ethereal/packet-ospf.c,v
retrieving revision 1.58
diff -u -r1.58 packet-ospf.c
--- packet-ospf.c	2002/02/19 21:56:56	1.58
+++ packet-ospf.c	2002/04/14 11:25:52
@@ -52,6 +52,7 @@
 #include "ipproto.h"
 #include "in_cksum.h"
 #include "ieee-float.h"
+#include "packet-rsvp.h"
 
 #define OSPF_VERSION_2 2
 #define OSPF_VERSION_3 3
@@ -761,12 +762,6 @@
     {0, NULL},
 };
 
-/*
- * From packet-rsvp.c
- */
-extern const value_string gmpls_lsp_enc_str[];
-extern const value_string gmpls_switching_type_str[];
-
 /* 
  * Dissect MPLS/TE opaque LSA 
  */
@@ -981,7 +976,7 @@
 /*
  * Dissect opaque LSAs
  */
-void
+static void
 dissect_ospf_lsa_opaque(tvbuff_t *tvb, int offset, proto_tree *tree,
 			guint8 ls_id_type, guint32 length)
 {
Index: ethereal/packet-pcnfsd.c
===================================================================
RCS file: /cvsroot/ethereal/packet-pcnfsd.c,v
retrieving revision 1.6
diff -u -r1.6 packet-pcnfsd.c
--- packet-pcnfsd.c	2002/04/03 13:24:12	1.6
+++ packet-pcnfsd.c	2002/04/14 11:25:53
@@ -66,7 +66,7 @@
 static gint ett_pcnfsd_gids = -1;
 
 /* "NFS Illustrated 14.7.13 */
-void
+static void
 pcnfsd_decode_obscure(char* data, int len)
 {
 	for ( ; len>0 ; len--, data++) {
@@ -76,7 +76,7 @@
 
 
 /* "NFS Illustrated" 14.7.13 */
-int
+static int
 dissect_pcnfsd2_auth_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 	proto_tree *tree)
 {
@@ -161,7 +161,7 @@
 
 
 /* "NFS Illustrated" 14.7.13 */
-int
+static int
 dissect_pcnfsd2_auth_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 	proto_tree *tree)
 {
Index: ethereal/packet-pgm.c
===================================================================
RCS file: /cvsroot/ethereal/packet-pgm.c,v
retrieving revision 1.14
diff -u -r1.14 packet-pgm.c
--- packet-pgm.c	2002/01/21 07:36:38	1.14
+++ packet-pgm.c	2002/04/14 11:25:58
@@ -46,7 +46,6 @@
 #include <time.h>
 #include <string.h>
 #include <epan/packet.h>
-#include "packet-pgm.h"
 #include "afn.h"
 #include "ipproto.h"
 #include <epan/resolv.h>
@@ -58,6 +57,226 @@
 
 void proto_reg_handoff_pgm(void);
 static void proto_rereg_pgm(void);
+
+typedef guint8 nchar_t;
+typedef guint16 nshort_t;
+typedef guint32 nlong_t;
+
+/* The PGM main header */
+typedef struct {
+	nshort_t sport;            /* source port */
+	nshort_t dport;            /* destination port */
+	nchar_t type;              /* PGM type */
+	nchar_t opts;              /* options */
+	nshort_t cksum;            /* checksum */
+	nchar_t gsi[6];            /* Global Source ID */
+	nshort_t tsdulen;          /* TSDU length */
+} pgm_type;
+#define pgmhdr_ntoh(_p) \
+	(_p)->sport = ntohs((_p)->sport); \
+	(_p)->dport = ntohs((_p)->dport); \
+	(_p)->type = ntohs((_p)->type); \
+	(_p)->opts = ntohs((_p)->opts); \
+	(_p)->cksum = ntohs((_p)->cksum); \
+	(_p)->tsdulen = ntohs((_p)->tsdulen)
+
+/* The PGM SPM header */
+typedef struct {
+	nlong_t sqn;              /* SPM's sequence number */
+	nlong_t trail;            /* Trailing edge sequence number */
+	nlong_t lead;             /* Leading edge sequence number */
+	nshort_t path_afi;        /* NLA AFI */
+	nshort_t res;             /* reserved */
+	nlong_t path;             /* Path NLA */
+} pgm_spm_t;
+static const size_t PGM_SPM_SZ = sizeof(pgm_type)+sizeof(pgm_spm_t);
+#define spm_ntoh(_p) \
+	(_p)->sqn = ntohl((_p)->sqn); \
+	(_p)->trail = ntohl((_p)->trail); \
+	(_p)->lead = ntohl((_p)->lead); \
+	(_p)->path_afi = ntohs((_p)->path_afi); \
+	(_p)->res = ntohs((_p)->res);
+
+/* The PGM Data (ODATA/RDATA) header */
+typedef struct {
+	nlong_t sqn;              /* Data Packet sequence number */
+	nlong_t trail;            /* Trailing edge sequence number */
+} pgm_data_t;
+#define data_ntoh(_p) \
+	(_p)->sqn = ntohl((_p)->sqn); \
+	(_p)->trail = ntohl((_p)->trail)
+static const size_t PGM_DATA_HDR_SZ = sizeof(pgm_type)+sizeof(pgm_data_t);
+
+/* The PGM NAK (NAK/N-NAK/NCF) header */
+typedef struct {
+	nlong_t sqn;             /* Requested sequence number */
+	nshort_t src_afi;        /* NLA AFI for source (IPv4 is set to 1) */
+	nshort_t src_res;        /* reserved */
+	nlong_t src;             /* Source NLA  */
+	nshort_t grp_afi;        /* Multicast group AFI (IPv4 is set to 1) */
+	nshort_t grp_res;        /* reserved */
+	nlong_t grp;             /* Multicast group NLA */
+} pgm_nak_t;
+static const size_t PGM_NAK_SZ = sizeof(pgm_type)+sizeof(pgm_nak_t);
+#define nak_ntoh(_p) \
+	(_p)->sqn = ntohl((_p)->sqn); \
+	(_p)->src_afi = ntohs((_p)->src_afi); \
+	(_p)->src_res = ntohs((_p)->src_res); \
+	(_p)->grp_afi = ntohs((_p)->grp_afi); \
+	(_p)->grp_res = ntohs((_p)->grp_res)
+
+/* The PGM ACK header (PGMCC) */
+typedef struct {
+	nlong_t rx_max_sqn;      /* RX_MAX sequence number */
+	nlong_t bitmap;          /* Received Packet Bitmap */
+} pgm_ack_t;
+static const size_t PGM_ACK_SZ = sizeof(pgm_type)+sizeof(pgm_ack_t);
+#define ack_ntoh(_p) \
+	(_p)->rx_max_sqn = ntohl((_p)->rx_max_sqn); \
+	(_p)->bitmap = ntohl((_p)->bitmap)
+
+/* constants for hdr types */
+#if defined(PGM_SPEC_01_PCKTS)
+/* old spec-01 types */
+#define PGM_SPM_PCKT  0x00
+#define PGM_ODATA_PCKT  0x10
+#define PGM_RDATA_PCKT  0x11
+#define PGM_NAK_PCKT  0x20
+#define PGM_NNAK_PCKT  0x21
+#define PGM_NCF_PCKT 0x30
+#else
+/* spec-02 types (as well as spec-04+) */
+#define PGM_SPM_PCKT  0x00
+#define PGM_ODATA_PCKT  0x04
+#define PGM_RDATA_PCKT  0x05
+#define PGM_NAK_PCKT  0x08
+#define PGM_NNAK_PCKT  0x09
+#define PGM_NCF_PCKT 0x0A
+#define PGM_ACK_PCKT 0x0D
+#endif /* PGM_SPEC_01_PCKTS */
+
+/* port swapping on NAK and NNAKs or not (default is to swap) */
+/* PGM_NO_PORT_SWAP */
+
+/* option flags (main PGM header) */
+#define PGM_OPT 0x01
+#define PGM_OPT_NETSIG 0x02
+#define PGM_OPT_VAR_PKTLEN 0x40
+#define PGM_OPT_PARITY 0x80
+
+/* option types */
+#define PGM_OPT_LENGTH 0x00
+#define PGM_OPT_END 0x80
+#define PGM_OPT_FRAGMENT 0x01
+#define PGM_OPT_NAK_LIST 0x02
+#define PGM_OPT_JOIN 0x03
+#define PGM_OPT_REDIRECT 0x07
+#define PGM_OPT_SYN 0x0D
+#define PGM_OPT_FIN 0x0E
+#define PGM_OPT_RST 0x0F
+#define PGM_OPT_PARITY_PRM 0x08
+#define PGM_OPT_PARITY_GRP 0x09
+#define PGM_OPT_CURR_TGSIZE 0x0A
+#define PGM_OPT_PGMCC_DATA  0x12
+#define PGM_OPT_PGMCC_FEEDBACK  0x13
+
+static const nchar_t PGM_OPT_INVALID = 0x7F;
+
+/* OPX bit values */
+#define PGM_OPX_IGNORE	0x00
+#define PGM_OPX_INVAL	0x01
+#define PGM_OPX_DISCARD	0x10
+
+/* option formats */
+typedef struct {
+	nchar_t type;
+	nchar_t len;
+	nchar_t opx;
+	nchar_t res;
+} pgm_opt_generic_t;
+
+typedef struct {
+	nchar_t type;
+	nchar_t len;
+	nshort_t total_len;
+} pgm_opt_length_t;
+
+typedef struct {
+	nchar_t type;
+	nchar_t len;
+	nchar_t opx;
+	nchar_t res;
+} pgm_opt_nak_list_t;
+
+/* 
+ * To squeeze the whole option into 255 bytes, we
+ * can only have 62 in the list
+ */
+#define PGM_MAX_NAK_LIST_SZ (62)
+
+typedef struct {
+	nchar_t type;
+	nchar_t len;
+	nchar_t opx;
+	nchar_t res;
+	nlong_t opt_join_min;
+} pgm_opt_join_t;
+
+typedef struct {
+	nchar_t type;
+	nchar_t len;
+	nchar_t opx;
+	nchar_t po;
+	nlong_t prm_tgsz;
+} pgm_opt_parity_prm_t;
+
+/* OPT_PARITY_PRM P and O bits */
+static const nchar_t PGM_OPT_PARITY_PRM_PRO = 0x2;
+static const nchar_t PGM_OPT_PARITY_PRM_OND = 0x1;
+
+typedef struct {
+	nchar_t type;
+	nchar_t len;
+	nchar_t opx;
+	nchar_t res;
+	nlong_t prm_grp;
+} pgm_opt_parity_grp_t;
+
+typedef struct {
+	nchar_t type;
+	nchar_t len;
+	nchar_t opx;
+	nchar_t res;
+	nlong_t prm_atgsz;
+} pgm_opt_curr_tgsize_t;
+
+typedef struct {
+	nchar_t type;
+	nchar_t len;
+	nchar_t opx;
+	nchar_t res;
+	nlong_t tsp;
+	nshort_t acker_afi;
+	nshort_t res2;
+	nlong_t acker;
+} pgm_opt_pgmcc_data_t;
+
+typedef struct {
+	nchar_t type;
+	nchar_t len;
+	nchar_t opx;
+	nchar_t res;
+	nlong_t tsp;
+	nshort_t acker_afi;
+	nshort_t loss_rate;
+	nlong_t acker;
+} pgm_opt_pgmcc_feedback_t;
+
+/*
+ * Udp port for UDP encapsulation
+ */
+#define DEFAULT_UDP_ENCAP_UCAST_PORT 3055
+#define DEFAULT_UDP_ENCAP_MCAST_PORT 3056
 
 static int udp_encap_ucast_port = 0;
 static int udp_encap_mcast_port = 0;
Index: ethereal/packet-portmap.c
===================================================================
RCS file: /cvsroot/ethereal/packet-portmap.c,v
retrieving revision 1.34
diff -u -r1.34 packet-portmap.c
--- packet-portmap.c	2002/04/03 13:24:12	1.34
+++ packet-portmap.c	2002/04/14 11:26:00
@@ -68,7 +68,8 @@
 
 
 /* Dissect a getport call */
-int dissect_getport_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+static int
+dissect_getport_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 	proto_tree *tree)
 {
 	guint32 proto;
@@ -94,7 +95,8 @@
 	return offset+16;
 }
 
-int dissect_getport_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+static int
+dissect_getport_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 	proto_tree *tree)
 {
 	offset = dissect_rpc_uint32(tvb, tree, hf_portmap_port,
@@ -103,7 +105,8 @@
 }
 
 /* Dissect a 'set' call */
-int dissect_set_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+static int
+dissect_set_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 	proto_tree *tree)
 {
 	guint32 proto;
@@ -130,7 +133,8 @@
 }
 
 /* Dissect a 'unset' call */
-int dissect_unset_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+static int
+dissect_unset_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 	proto_tree *tree)
 {
 	guint32 proto;
@@ -156,7 +160,8 @@
 	return offset+16;
 }
 
-int dissect_set_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+static int
+dissect_set_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 	proto_tree *tree)
 {
 	offset = dissect_rpc_bool(tvb, tree, hf_portmap_answer,
@@ -197,7 +202,8 @@
 	return offset;
 }
 
-int dissect_dump_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_dump_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 	proto_tree *tree)
 {
 	offset = dissect_rpc_list(tvb, pinfo, tree, offset,
@@ -206,7 +212,8 @@
 }
 
 /* Dissect a callit call */
-int dissect_callit_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_callit_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
 	proto_tree *tree)
 {
 	guint32 prog, vers, proc;
@@ -247,7 +254,8 @@
 }
 
 /* Dissect a callit reply */
-int dissect_callit_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_callit_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 	proto_tree *tree)
 {
 	if ( tree )
@@ -342,7 +350,8 @@
 
 
 /* RFC 1833, Page 7 */
-int dissect_rpcb3_getaddr_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_rpcb3_getaddr_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
 	proto_tree *tree)
 {
 	offset = dissect_rpcb(tvb, offset, pinfo, tree);
@@ -352,7 +361,8 @@
 
 
 /* RFC 1833, Page 7 */
-int dissect_rpcb3_getaddr_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+static int
+dissect_rpcb3_getaddr_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 	proto_tree *tree)
 {
 	offset = dissect_rpc_string(tvb, tree,
@@ -363,7 +373,8 @@
 
 
 /* RFC 1833, Page 7 */
-int dissect_rpcb3_dump_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_rpcb3_dump_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 	proto_tree *tree)
 {
 	offset = dissect_rpc_list(tvb, pinfo, tree, offset, dissect_rpcb);
@@ -371,7 +382,8 @@
 }
 
 /* RFC 1833, page 4 */
-int dissect_rpcb_rmtcallres(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+static int
+dissect_rpcb_rmtcallres(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 	proto_tree *tree)
 {
 	/* Dissect the remote universal address. */
Index: ethereal/packet-ppp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-ppp.c,v
retrieving revision 1.89
diff -u -r1.89 packet-ppp.c
--- packet-ppp.c	2002/04/01 00:51:43	1.89
+++ packet-ppp.c	2002/04/14 11:26:13
@@ -32,6 +32,7 @@
 # include <sys/types.h>
 #endif
 
+#include <string.h>
 #include <glib.h>
 #include "prefs.h"
 #include <epan/packet.h>
@@ -1182,7 +1183,7 @@
 
 #define N_PPPMUXCP_OPTS (sizeof pppmuxcp_opts / sizeof pppmuxcp_opts[0])
 
-const unsigned int fcstab_32[256] =
+static const unsigned int fcstab_32[256] =
       {
       0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
       0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
@@ -1250,7 +1251,7 @@
       0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
       };
 
-const unsigned short fcstab_16[256] = {
+static const unsigned short fcstab_16[256] = {
         0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
         0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
         0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
@@ -1290,7 +1291,7 @@
 * DETAILS : Calculate a new FCS-16 given the current FCS-16 and the new data.
 *******************************************************************************
 */
-guint16
+static guint16
 fcs16(register guint16 fcs,
          tvbuff_t * tvbuff,
          guint32 offset,
@@ -1315,7 +1316,7 @@
 * DETAILS : Calculate a new FCS-32 given the current FCS-32 and the new data.
 *******************************************************************************
 */
-guint32
+static guint32
 fcs32(guint32 fcs,
          tvbuff_t * tvbuff,
          guint32 offset,
Index: ethereal/packet-q2931.c
===================================================================
RCS file: /cvsroot/ethereal/packet-q2931.c,v
retrieving revision 1.22
diff -u -r1.22 packet-q2931.c
--- packet-q2931.c	2002/01/24 09:20:50	1.22
+++ packet-q2931.c	2002/04/14 11:26:21
@@ -654,7 +654,7 @@
 	{ 0x00, NULL }
 };
 
-void
+static void
 dissect_q2931_bband_bearer_cap_ie(tvbuff_t *tvb, int offset, int len,
     proto_tree *tree)
 {
@@ -706,7 +706,7 @@
 	{ 0x00, NULL }
 };
 
-void
+static void
 dissect_q2931_bband_hi_layer_info_ie(tvbuff_t *tvb, int offset, int len,
     proto_tree *tree)
 {
@@ -780,7 +780,7 @@
 /*
  * Dissect a broadband low layer information information element.
  */
-void
+static void
 dissect_q2931_bband_low_layer_info_ie(tvbuff_t *tvb, int offset, int len,
     proto_tree *tree)
 {
Index: ethereal/packet-quakeworld.c
===================================================================
RCS file: /cvsroot/ethereal/packet-quakeworld.c,v
retrieving revision 1.12
diff -u -r1.12 packet-quakeworld.c
--- packet-quakeworld.c	2002/04/02 06:29:48	1.12
+++ packet-quakeworld.c	2002/04/14 11:26:25
@@ -90,7 +90,7 @@
 static	int		com_token_start;
 static	int		com_token_length;
 
-char *
+static char *
 COM_Parse (char *data)
 {
 	int	c;
@@ -160,14 +160,14 @@
 
 
 
-int
+static int
 Cmd_Argc(void)
 {
 	return cmd_argc;
 }
 
 
-char*
+static char*
 Cmd_Argv(int arg)
 {
 	if ( arg >= cmd_argc )
@@ -176,7 +176,7 @@
 }
 
 
-int
+static int
 Cmd_Argv_start(int arg)
 {
 	if ( arg >= cmd_argc )
@@ -185,7 +185,7 @@
 }
 
 
-int
+static int
 Cmd_Argv_length(int arg)
 {
 	if ( arg >= cmd_argc )
@@ -194,7 +194,7 @@
 }
 
 
-void
+static void
 Cmd_TokenizeString(char* text)
 {
 	int i;
@@ -244,7 +244,7 @@
 }
 
 			
-void
+static void
 dissect_id_infostring(tvbuff_t *tvb, proto_tree* tree, 
 	int offset, char* infostring,
 	gint ett_key_value, int hf_key_value, int hf_key, int hf_value)
Index: ethereal/packet-radius.c
===================================================================
RCS file: /cvsroot/ethereal/packet-radius.c,v
retrieving revision 1.54
diff -u -r1.54 packet-radius.c
--- packet-radius.c	2002/04/08 20:30:52	1.54
+++ packet-radius.c	2002/04/14 11:26:31
@@ -852,7 +852,7 @@
 {0,NULL},
 };
 
-guint32 match_numval(guint32 val, const value_value_pair *vs)
+static guint32 match_numval(guint32 val, const value_value_pair *vs)
 {
   guint32 i = 0;
 
@@ -867,7 +867,8 @@
 
 static gchar textbuffer[2000];
 
-gchar *rdconvertbufftostr(gchar *dest, tvbuff_t *tvb, int offset, int length)
+static gchar *
+rdconvertbufftostr(gchar *dest, tvbuff_t *tvb, int offset, int length)
 {
 /*converts the raw buffer into printable text */
 	guint32 i;
@@ -895,7 +896,7 @@
         return dest;
 }
 
-gchar *rd_match_strval(guint32 val, const value_string *vs) {
+static gchar *rd_match_strval(guint32 val, const value_string *vs) {
 	return val_to_str(val, vs, "Undefined (%u)");
 }
 
@@ -1146,7 +1147,8 @@
 }
 
 
-void dissect_attribute_value_pairs(tvbuff_t *tvb, int offset,proto_tree *tree,
+static void
+dissect_attribute_value_pairs(tvbuff_t *tvb, int offset,proto_tree *tree,
 				   int avplength,packet_info *pinfo)
 {
 /* adds the attribute value pairs to the tree */
Index: ethereal/packet-rsh.c
===================================================================
RCS file: /cvsroot/ethereal/packet-rsh.c,v
retrieving revision 1.16
diff -u -r1.16 packet-rsh.c
--- packet-rsh.c	2002/01/24 09:20:51	1.16
+++ packet-rsh.c	2002/04/14 11:26:50
@@ -44,7 +44,7 @@
 
 #define TCP_PORT_RSH			514
 
-void
+static void
 dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
 	proto_tree	*rsh_tree;
Index: ethereal/packet-rsvp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-rsvp.c,v
retrieving revision 1.58
diff -u -r1.58 packet-rsvp.c
--- packet-rsvp.c	2002/03/29 00:41:54	1.58
+++ packet-rsvp.c	2002/04/14 11:27:00
@@ -856,7 +856,7 @@
     if (tempfilt_offp) *tempfilt_offp = t_off;
 }
 
-char *summary_session (tvbuff_t *tvb, int offset)
+static char *summary_session (tvbuff_t *tvb, int offset)
 {
     static char buf[80];
 
@@ -880,7 +880,7 @@
     return buf;
 }
 
-char *summary_template (tvbuff_t *tvb, int offset)
+static char *summary_template (tvbuff_t *tvb, int offset)
 {
     static char buf[80];
     char *objtype;
Index: ethereal/packet-scsi.c
===================================================================
RCS file: /cvsroot/ethereal/packet-scsi.c,v
retrieving revision 1.8
diff -u -r1.8 packet-scsi.c
--- packet-scsi.c	2002/03/31 20:28:41	1.8
+++ packet-scsi.c	2002/04/14 11:27:18
@@ -1381,7 +1381,7 @@
     }
 }
 
-void
+static void
 dissect_scsi_inquiry (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                       guint offset, gboolean isreq, gboolean iscdb,
                       guint32 payload_len, scsi_task_data_t *cdata)
Index: ethereal/packet-smtp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-smtp.c,v
retrieving revision 1.25
diff -u -r1.25 packet-smtp.c
--- packet-smtp.c	2002/01/24 09:20:51	1.25
+++ packet-smtp.c	2002/04/14 11:27:35
@@ -84,8 +84,8 @@
   guint16 crlf_seen;     /* Have we seen a CRLF on the end of a packet */
 };
 
-GMemChunk  *smtp_request_vals = NULL;
-GMemChunk  *smtp_packet_infos = NULL;
+static GMemChunk  *smtp_request_vals = NULL;
+static GMemChunk  *smtp_packet_infos = NULL;
 
 static void
 smtp_init_protocol(void)
Index: ethereal/packet-socks.c
===================================================================
RCS file: /cvsroot/ethereal/packet-socks.c,v
retrieving revision 1.37
diff -u -r1.37 packet-socks.c
--- packet-socks.c	2002/04/11 09:38:03	1.37
+++ packet-socks.c	2002/04/14 11:27:40
@@ -450,7 +450,7 @@
 }
 
 			
-void 
+static void 
 new_udp_conversation( socks_hash_entry_t *hash_info, packet_info *pinfo){
 
 	conversation_t *conversation = conversation_new( &pinfo->src, &pinfo->dst,  PT_UDP,
Index: ethereal/packet-tr.c
===================================================================
RCS file: /cvsroot/ethereal/packet-tr.c,v
retrieving revision 1.69
diff -u -r1.69 packet-tr.c
--- packet-tr.c	2002/01/21 07:36:44	1.69
+++ packet-tr.c	2002/04/14 11:27:43
@@ -139,6 +139,7 @@
  * (And this real frame x bytes in looks like a proper TR frame that goes on the wire
  * with none of the Linux idiosyncrasies).
  */
+static
 int check_for_old_linux_tvb(tvbuff_t *tvb)
 {
 	const guint8	*data;
@@ -162,6 +163,7 @@
 	return 0;		
 }
 
+static
 int check_for_old_linux(const u_char * pd)
 {
 	int x;
Index: ethereal/packet-x11.c
===================================================================
RCS file: /cvsroot/ethereal/packet-x11.c,v
retrieving revision 1.34
diff -u -r1.34 packet-x11.c
--- packet-x11.c	2002/04/13 20:16:09	1.34
+++ packet-x11.c	2002/04/14 11:27:59
@@ -2597,9 +2597,9 @@
    started in a previous packet...
 */
 
-int numberOfBitSetTable[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 };
+static int numberOfBitSetTable[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 };
 
-int numberOfBitSet(tvbuff_t *tvb, int offset, int maskLength)
+static int numberOfBitSet(tvbuff_t *tvb, int offset, int maskLength)
 {
       int res = 0;
       while(maskLength--) {
Index: ethereal/packet-pgm.h
===================================================================
RCS file: /cvsroot/ethereal/packet-pgm.h,v
retrieving revision 1.6
diff -u -r1.6 packet-pgm.h
--- packet-pgm.h	2001/08/06 19:05:14	1.6
+++ packet-pgm.h	2002/04/14 12:20:14
@@ -1,249 +0,0 @@
-/* packet-pgm.h
- * Declarations for pgm packet disassembly
- *
- * $Id: packet-pgm.h,v 1.6 2001/08/06 19:05:14 guy Exp $
- * 
- * Copyright (c) 2000 by Talarian Corp
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@xxxxxxxxxxxx>
- * Copyright 1999 Gerald Combs
- * 
- * 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.
- */
-
-#ifndef _PACKET_PGM_H
-#define _PACKET_PGM_H
-typedef guint8 nchar_t;
-typedef guint16 nshort_t;
-typedef guint32 nlong_t;
-
-/* The PGM main header */
-typedef struct {
-	nshort_t sport;            /* source port */
-	nshort_t dport;            /* destination port */
-	nchar_t type;              /* PGM type */
-	nchar_t opts;              /* options */
-	nshort_t cksum;            /* checksum */
-	nchar_t gsi[6];            /* Global Source ID */
-	nshort_t tsdulen;          /* TSDU length */
-} pgm_type;
-#define pgmhdr_ntoh(_p) \
-	(_p)->sport = ntohs((_p)->sport); \
-	(_p)->dport = ntohs((_p)->dport); \
-	(_p)->type = ntohs((_p)->type); \
-	(_p)->opts = ntohs((_p)->opts); \
-	(_p)->cksum = ntohs((_p)->cksum); \
-	(_p)->tsdulen = ntohs((_p)->tsdulen)
-
-/* The PGM SPM header */
-typedef struct {
-	nlong_t sqn;              /* SPM's sequence number */
-	nlong_t trail;            /* Trailing edge sequence number */
-	nlong_t lead;             /* Leading edge sequence number */
-	nshort_t path_afi;        /* NLA AFI */
-	nshort_t res;             /* reserved */
-	nlong_t path;             /* Path NLA */
-} pgm_spm_t;
-const size_t PGM_SPM_SZ = sizeof(pgm_type)+sizeof(pgm_spm_t);
-#define spm_ntoh(_p) \
-	(_p)->sqn = ntohl((_p)->sqn); \
-	(_p)->trail = ntohl((_p)->trail); \
-	(_p)->lead = ntohl((_p)->lead); \
-	(_p)->path_afi = ntohs((_p)->path_afi); \
-	(_p)->res = ntohs((_p)->res);
-
-/* The PGM Data (ODATA/RDATA) header */
-typedef struct {
-	nlong_t sqn;              /* Data Packet sequence number */
-	nlong_t trail;            /* Trailing edge sequence number */
-} pgm_data_t;
-#define data_ntoh(_p) \
-	(_p)->sqn = ntohl((_p)->sqn); \
-	(_p)->trail = ntohl((_p)->trail)
-const size_t PGM_DATA_HDR_SZ = sizeof(pgm_type)+sizeof(pgm_data_t);
-
-/* The PGM NAK (NAK/N-NAK/NCF) header */
-typedef struct {
-	nlong_t sqn;             /* Requested sequence number */
-	nshort_t src_afi;        /* NLA AFI for source (IPv4 is set to 1) */
-	nshort_t src_res;        /* reserved */
-	nlong_t src;             /* Source NLA  */
-	nshort_t grp_afi;        /* Multicast group AFI (IPv4 is set to 1) */
-	nshort_t grp_res;        /* reserved */
-	nlong_t grp;             /* Multicast group NLA */
-} pgm_nak_t;
-const size_t PGM_NAK_SZ = sizeof(pgm_type)+sizeof(pgm_nak_t);
-#define nak_ntoh(_p) \
-	(_p)->sqn = ntohl((_p)->sqn); \
-	(_p)->src_afi = ntohs((_p)->src_afi); \
-	(_p)->src_res = ntohs((_p)->src_res); \
-	(_p)->grp_afi = ntohs((_p)->grp_afi); \
-	(_p)->grp_res = ntohs((_p)->grp_res)
-
-/* The PGM ACK header (PGMCC) */
-typedef struct {
-	nlong_t rx_max_sqn;      /* RX_MAX sequence number */
-	nlong_t bitmap;          /* Received Packet Bitmap */
-} pgm_ack_t;
-const size_t PGM_ACK_SZ = sizeof(pgm_type)+sizeof(pgm_ack_t);
-#define ack_ntoh(_p) \
-	(_p)->rx_max_sqn = ntohl((_p)->rx_max_sqn); \
-	(_p)->bitmap = ntohl((_p)->bitmap)
-
-/* constants for hdr types */
-#if defined(PGM_SPEC_01_PCKTS)
-/* old spec-01 types */
-#define PGM_SPM_PCKT  0x00
-#define PGM_ODATA_PCKT  0x10
-#define PGM_RDATA_PCKT  0x11
-#define PGM_NAK_PCKT  0x20
-#define PGM_NNAK_PCKT  0x21
-#define PGM_NCF_PCKT 0x30
-#else
-/* spec-02 types (as well as spec-04+) */
-#define PGM_SPM_PCKT  0x00
-#define PGM_ODATA_PCKT  0x04
-#define PGM_RDATA_PCKT  0x05
-#define PGM_NAK_PCKT  0x08
-#define PGM_NNAK_PCKT  0x09
-#define PGM_NCF_PCKT 0x0A
-#define PGM_ACK_PCKT 0x0D
-#endif /* PGM_SPEC_01_PCKTS */
-
-/* port swapping on NAK and NNAKs or not (default is to swap) */
-/* PGM_NO_PORT_SWAP */
-
-/* option flags (main PGM header) */
-#define PGM_OPT 0x01
-#define PGM_OPT_NETSIG 0x02
-#define PGM_OPT_VAR_PKTLEN 0x40
-#define PGM_OPT_PARITY 0x80
-
-/* option types */
-#define PGM_OPT_LENGTH 0x00
-#define PGM_OPT_END 0x80
-#define PGM_OPT_FRAGMENT 0x01
-#define PGM_OPT_NAK_LIST 0x02
-#define PGM_OPT_JOIN 0x03
-#define PGM_OPT_REDIRECT 0x07
-#define PGM_OPT_SYN 0x0D
-#define PGM_OPT_FIN 0x0E
-#define PGM_OPT_RST 0x0F
-#define PGM_OPT_PARITY_PRM 0x08
-#define PGM_OPT_PARITY_GRP 0x09
-#define PGM_OPT_CURR_TGSIZE 0x0A
-#define PGM_OPT_PGMCC_DATA  0x12
-#define PGM_OPT_PGMCC_FEEDBACK  0x13
-
-const nchar_t PGM_OPT_INVALID = 0x7F;
-
-/* OPX bit values */
-#define PGM_OPX_IGNORE	0x00
-#define PGM_OPX_INVAL	0x01
-#define PGM_OPX_DISCARD	0x10
-
-/* option formats */
-typedef struct {
-	nchar_t type;
-	nchar_t len;
-	nchar_t opx;
-	nchar_t res;
-} pgm_opt_generic_t;
-
-typedef struct {
-	nchar_t type;
-	nchar_t len;
-	nshort_t total_len;
-} pgm_opt_length_t;
-
-typedef struct {
-	nchar_t type;
-	nchar_t len;
-	nchar_t opx;
-	nchar_t res;
-} pgm_opt_nak_list_t;
-
-/* 
- * To squeeze the whole option into 255 bytes, we
- * can only have 62 in the list
- */
-#define PGM_MAX_NAK_LIST_SZ (62)
-
-typedef struct {
-	nchar_t type;
-	nchar_t len;
-	nchar_t opx;
-	nchar_t res;
-	nlong_t opt_join_min;
-} pgm_opt_join_t;
-
-typedef struct {
-	nchar_t type;
-	nchar_t len;
-	nchar_t opx;
-	nchar_t po;
-	nlong_t prm_tgsz;
-} pgm_opt_parity_prm_t;
-
-/* OPT_PARITY_PRM P and O bits */
-const nchar_t PGM_OPT_PARITY_PRM_PRO = 0x2;
-const nchar_t PGM_OPT_PARITY_PRM_OND = 0x1;
-
-typedef struct {
-	nchar_t type;
-	nchar_t len;
-	nchar_t opx;
-	nchar_t res;
-	nlong_t prm_grp;
-} pgm_opt_parity_grp_t;
-
-typedef struct {
-	nchar_t type;
-	nchar_t len;
-	nchar_t opx;
-	nchar_t res;
-	nlong_t prm_atgsz;
-} pgm_opt_curr_tgsize_t;
-
-typedef struct {
-	nchar_t type;
-	nchar_t len;
-	nchar_t opx;
-	nchar_t res;
-	nlong_t tsp;
-	nshort_t acker_afi;
-	nshort_t res2;
-	nlong_t acker;
-} pgm_opt_pgmcc_data_t;
-
-typedef struct {
-	nchar_t type;
-	nchar_t len;
-	nchar_t opx;
-	nchar_t res;
-	nlong_t tsp;
-	nshort_t acker_afi;
-	nshort_t loss_rate;
-	nlong_t acker;
-} pgm_opt_pgmcc_feedback_t;
-
-/*
- * Udp port for UDP encapsulation
- */
-#define DEFAULT_UDP_ENCAP_UCAST_PORT 3055
-#define DEFAULT_UDP_ENCAP_MCAST_PORT 3056
-
-#endif /* _PACKET_PGM_H */