aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-07-24 19:01:28 +0000
committerGuy Harris <guy@alum.mit.edu>2005-07-24 19:01:28 +0000
commit554f62000190dead7a2d16e272138cc6e24ee57f (patch)
treeca1693ebf1407ac544cb272dbfe175ff1ff44a39 /epan/dissectors
parent72c01a62f828e6a19a46eaa25807114fc1cca840 (diff)
Constify to remove a bunch of warnings. Add some casts to squelch
(presumably-)harmless-but-otherwise-unremovable const-to-nonconst warnings. In the TACACS dissector, clean up the variables used in option parsing to avoid some const-to-nonconst warnings. Clean up some white space. svn path=/trunk/; revision=15043
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-aim.h2
-rw-r--r--epan/dissectors/packet-dcerpc-epm.c2
-rw-r--r--epan/dissectors/packet-dcerpc-samr.c2
-rw-r--r--epan/dissectors/packet-dcerpc.c6
-rw-r--r--epan/dissectors/packet-dcerpc.h6
-rw-r--r--epan/dissectors/packet-dcom.c6
-rw-r--r--epan/dissectors/packet-dcom.h2
-rw-r--r--epan/dissectors/packet-diameter.c4
-rw-r--r--epan/dissectors/packet-giop.h2
-rw-r--r--epan/dissectors/packet-ieee80211.c4
-rw-r--r--epan/dissectors/packet-k12.c8
-rw-r--r--epan/dissectors/packet-ntlmssp.c2
-rw-r--r--epan/dissectors/packet-portmap.c3
-rw-r--r--epan/dissectors/packet-pres.c2
-rw-r--r--epan/dissectors/packet-radius.c4
-rw-r--r--epan/dissectors/packet-rpc.c6
-rw-r--r--epan/dissectors/packet-rpc.h4
-rw-r--r--epan/dissectors/packet-snmp.c4
-rw-r--r--epan/dissectors/packet-spnego.c2
-rw-r--r--epan/dissectors/packet-tacacs.c33
-rw-r--r--epan/dissectors/packet-tzsp.c2
-rw-r--r--epan/dissectors/packet-user_encap.c6
22 files changed, 56 insertions, 56 deletions
diff --git a/epan/dissectors/packet-aim.h b/epan/dissectors/packet-aim.h
index b30556173b..12f13c624c 100644
--- a/epan/dissectors/packet-aim.h
+++ b/epan/dissectors/packet-aim.h
@@ -53,7 +53,7 @@ typedef struct _aim_family {
int proto_id;
protocol_t *proto;
guint16 family;
- char *name;
+ const char *name;
const aim_subtype *subtypes;
} aim_family;
diff --git a/epan/dissectors/packet-dcerpc-epm.c b/epan/dissectors/packet-dcerpc-epm.c
index fb97716e3c..26b90c71cd 100644
--- a/epan/dissectors/packet-dcerpc-epm.c
+++ b/epan/dissectors/packet-dcerpc-epm.c
@@ -367,7 +367,7 @@ epm_dissect_tower_data (tvbuff_t *tvb, int offset,
{
guint16 version = tvb_get_ntohs(tvb, offset+17);
- char *service = dcerpc_get_proto_name(&uuid, version);
+ const char *service = dcerpc_get_proto_name(&uuid, version);
if (service)
proto_item_append_text(tr, "UUID: %s", service);
else
diff --git a/epan/dissectors/packet-dcerpc-samr.c b/epan/dissectors/packet-dcerpc-samr.c
index e32c5aff58..43634d7c0c 100644
--- a/epan/dissectors/packet-dcerpc-samr.c
+++ b/epan/dissectors/packet-dcerpc-samr.c
@@ -195,7 +195,7 @@ static e_uuid_t uuid_dcerpc_samr = {
static guint16 ver_dcerpc_samr = 1;
/* Configuration variables */
-static char *nt_password = NULL;
+static const char *nt_password = NULL;
/* Dissect connect specific access rights */
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c
index 220095290d..46db718396 100644
--- a/epan/dissectors/packet-dcerpc.c
+++ b/epan/dissectors/packet-dcerpc.c
@@ -680,7 +680,7 @@ dcerpc_init_uuid (int proto, int ett, e_uuid_t *uuid, guint16 ver,
/* try to get registered name for this uuid */
-gchar *dcerpc_get_uuid_name(e_uuid_t *uuid, guint16 ver)
+const gchar *dcerpc_get_uuid_name(e_uuid_t *uuid, guint16 ver)
{
dcerpc_uuid_key key;
dcerpc_uuid_value *sub_proto;
@@ -703,7 +703,7 @@ gchar *dcerpc_get_uuid_name(e_uuid_t *uuid, guint16 ver)
/* Function to find the name of a registered protocol
* or NULL if the protocol/version is not known to ethereal.
*/
-char *
+const char *
dcerpc_get_proto_name(e_uuid_t *uuid, guint16 ver)
{
dcerpc_uuid_key key;
@@ -2174,7 +2174,7 @@ dcerpc_try_handoff (packet_info *pinfo, proto_tree *tree,
dcerpc_uuid_value *sub_proto;
proto_tree *volatile sub_tree = NULL;
dcerpc_sub_dissector *proc;
- gchar *name = NULL;
+ const gchar *name = NULL;
dcerpc_dissect_fnct_t *volatile sub_dissect;
const char *volatile saved_proto;
void *volatile saved_private_data;
diff --git a/epan/dissectors/packet-dcerpc.h b/epan/dissectors/packet-dcerpc.h
index 0410be2b91..b3374cdb3a 100644
--- a/epan/dissectors/packet-dcerpc.h
+++ b/epan/dissectors/packet-dcerpc.h
@@ -245,7 +245,7 @@ typedef struct _dcerpc_sub_dissector {
/* registration function for subdissectors */
void dcerpc_init_uuid (int proto, int ett, e_uuid_t *uuid, guint16 ver, dcerpc_sub_dissector *procs, int opnum_hf);
-char *dcerpc_get_proto_name(e_uuid_t *uuid, guint16 ver);
+const char *dcerpc_get_proto_name(e_uuid_t *uuid, guint16 ver);
int dcerpc_get_proto_hf_opnum(e_uuid_t *uuid, guint16 ver);
dcerpc_sub_dissector *dcerpc_get_proto_sub_dissector(e_uuid_t *uuid, guint16 ver);
@@ -254,7 +254,7 @@ dcerpc_sub_dissector *dcerpc_get_proto_sub_dissector(e_uuid_t *uuid, guint16 ver
value_string *value_string_from_subdissectors(dcerpc_sub_dissector *sd);
/* try to get protocol name registered for this uuid */
-gchar *dcerpc_get_uuid_name(e_uuid_t *uuid, guint16 ver);
+const gchar *dcerpc_get_uuid_name(e_uuid_t *uuid, guint16 ver);
/* Private data passed to subdissectors from the main DCERPC dissector. */
typedef struct _dcerpc_call_value {
@@ -306,7 +306,7 @@ typedef struct _dcerpc_uuid_value {
protocol_t *proto;
int proto_id;
int ett;
- gchar *name;
+ const gchar *name;
dcerpc_sub_dissector *procs;
int opnum_hf;
} dcerpc_uuid_value;
diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c
index 23e8e65565..8c0ab83222 100644
--- a/epan/dissectors/packet-dcom.c
+++ b/epan/dissectors/packet-dcom.c
@@ -658,8 +658,8 @@ dissect_dcom_simple_resp(tvbuff_t *tvb, int offset,
Returns the associated string ptr on a match.
Formats uuid number and returns the resulting string, on failure.
(copied from val_to_str) */
-gchar* dcom_uuid_to_str(e_uuid_t *uuid) {
- gchar *ret;
+const gchar* dcom_uuid_to_str(e_uuid_t *uuid) {
+ const gchar *ret;
static gchar str[3][64];
static gchar *cur;
@@ -1154,7 +1154,7 @@ dissect_dcom_append_UUID(tvbuff_t *tvb, int offset,
int hfindex, gchar *field_name, int field_index)
{
e_uuid_t uuid;
- gchar *uuid_name;
+ const gchar *uuid_name;
offset = dissect_dcom_UUID(tvb, offset, pinfo, tree, drep,
diff --git a/epan/dissectors/packet-dcom.h b/epan/dissectors/packet-dcom.h
index cfa8072d3f..97d6fdb87d 100644
--- a/epan/dissectors/packet-dcom.h
+++ b/epan/dissectors/packet-dcom.h
@@ -60,7 +60,7 @@ extern int
dissect_dcom_append_UUID(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, guint8 *drep,
int hfindex, gchar *field_name, int field_index);
-extern gchar* dcom_uuid_to_str(e_uuid_t *uuid);
+extern const gchar* dcom_uuid_to_str(e_uuid_t *uuid);
extern int
dissect_dcom_indexed_WORD(tvbuff_t *tvb, int offset, packet_info *pinfo,
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index f2fdc99664..04117acb36 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -248,7 +248,7 @@ static gboolean allow_zero_as_app_id = FALSE;
static gboolean suppress_console_output = TRUE;
#define DICT_FN "diameter/dictionary.xml"
-static gchar *gbl_diameterDictionary;
+static const gchar *gbl_diameterDictionary;
typedef struct _e_diameterhdr_v16 {
guint32 versionLength;
@@ -316,7 +316,7 @@ static gchar *diameter_vendor_to_str(guint32 vendorId, gboolean longName);
* the xmlsoft examples.
*/
static xmlDocPtr
-xmlParseFilePush( char *filename, int checkValid
+xmlParseFilePush( const char *filename, int checkValid
#ifndef ETHEREAL_XML_DO_VALIDITY_CHECKING
_U_
#endif
diff --git a/epan/dissectors/packet-giop.h b/epan/dissectors/packet-giop.h
index e6f837f3ab..beb877ba51 100644
--- a/epan/dissectors/packet-giop.h
+++ b/epan/dissectors/packet-giop.h
@@ -105,7 +105,7 @@ typedef gboolean (giop_sub_dissector_t)(tvbuff_t *, packet_info *, proto_tree *,
typedef struct giop_sub_handle {
giop_sub_dissector_t *sub_fn; /* ptr to sub dissector function */
- gchar *sub_name; /* subdissector string name */
+ const gchar *sub_name; /* subdissector string name */
protocol_t *sub_proto; /* protocol_t for subprotocol */
} giop_sub_handle_t;
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 2dd6686e7a..9bd4d07d7d 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -110,7 +110,7 @@ static int weak_iv(guchar *iv);
*/
#ifndef USE_ENV
-static char *wep_keystr[] = {NULL, NULL, NULL, NULL};
+static const char *wep_keystr[] = {NULL, NULL, NULL, NULL};
#endif
/* ************************************************************************* */
@@ -3589,7 +3589,7 @@ static int wep_decrypt(guint8 *buf, guint32 len, int key_override) {
}
static void init_wepkeys(void) {
- char *tmp;
+ const char *tmp;
int i;
GByteArray *bytes;
gboolean res;
diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c
index 2a1f230d3c..fc561a5414 100644
--- a/epan/dissectors/packet-k12.c
+++ b/epan/dissectors/packet-k12.c
@@ -55,7 +55,7 @@ static dissector_handle_t data_handle;
static module_t *k12_module;
-static char* k12_config_filename = "";
+static const char* k12_config_filename = "";
static GHashTable* k12_cfg = NULL;
@@ -119,7 +119,7 @@ static gboolean free_just_key (gpointer k, gpointer v _U_, gpointer p _U_) {
}
-static GHashTable* k12_load_config(gchar* filename) {
+static GHashTable* k12_load_config(const gchar* filename) {
FILE* fp;
gchar buffer[0x10000];
size_t len;
@@ -193,8 +193,8 @@ static void k12_load_prefs(void) {
}
if (*k12_config_filename != '\0') {
- k12_cfg = k12_load_config(k12_config_filename);
- return;
+ k12_cfg = k12_load_config(k12_config_filename);
+ return;
}
}
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index 88fd3ad430..1a48a3ef7f 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -213,7 +213,7 @@ static gint ett_ntlmssp_ntlmv2_response = -1;
static gint ett_ntlmssp_ntlmv2_response_name = -1;
/* Configuration variables */
-static char *nt_password = NULL;
+static const char *nt_password = NULL;
#define MAX_BLOB_SIZE 256
typedef struct _ntlmssp_blob {
diff --git a/epan/dissectors/packet-portmap.c b/epan/dissectors/packet-portmap.c
index a620b7ef6f..6d938e782d 100644
--- a/epan/dissectors/packet-portmap.c
+++ b/epan/dissectors/packet-portmap.c
@@ -78,7 +78,8 @@ dissect_getport_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
{
guint32 proto, version;
guint32 prog;
- char *prog_name, *proto_name;
+ const char *prog_name;
+ char *proto_name;
/* make sure we remember protocol type until the reply packet */
if(!pinfo->fd->flags.visited){
diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c
index 8cf3721dd8..afe3ee7d34 100644
--- a/epan/dissectors/packet-pres.c
+++ b/epan/dissectors/packet-pres.c
@@ -1084,7 +1084,7 @@ static void
dissect_parse_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, const char *field_name, int ret)
{
- char *errstr;
+ const char *errstr;
errstr = asn1_err_to_str(ret);
if (tree != NULL)
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index 99d81190ff..d6bf313d63 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -134,7 +134,7 @@ radius_attr_info_t no_dictionary_entry = {"Unknown-Attribute",0,FALSE,FALSE,radi
dissector_handle_t eap_fragment_handle;
-static gchar* shared_secret = "";
+static const gchar* shared_secret = "";
static guint8 authenticator[AUTHENTICATOR_LENGTH];
@@ -201,7 +201,7 @@ radius_decrypt_avp(gchar *dest,tvbuff_t *tvb,int offset,int length)
totlen = 1;
md5_init(&md_ctx);
- md5_append(&md_ctx,(guint8*)shared_secret,strlen(shared_secret));
+ md5_append(&md_ctx,(const guint8*)shared_secret,strlen(shared_secret));
md5_append(&md_ctx,authenticator, AUTHENTICATOR_LENGTH);
md5_finish(&md_ctx,digest);
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index a26b8eae07..9999b35750 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -424,9 +424,9 @@ int rpc_prog_hf(guint32 prog, guint32 vers)
/* return the name associated with a previously registered program. This
should probably eventually be expanded to use the rpc YP/NIS map
so that it can give names for programs not handled by ethereal */
-char *rpc_prog_name(guint32 prog)
+const char *rpc_prog_name(guint32 prog)
{
- char *progname = NULL;
+ const char *progname = NULL;
rpc_prog_info_key rpc_prog_key;
rpc_prog_info_value *rpc_prog;
@@ -1657,7 +1657,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
unsigned int reject_state;
const char *msg_type_name = NULL;
- char *progname = NULL;
+ const char *progname = NULL;
const char *procname = NULL;
static char procname_static[20];
diff --git a/epan/dissectors/packet-rpc.h b/epan/dissectors/packet-rpc.h
index 3f2d97e76f..5dadf15fc8 100644
--- a/epan/dissectors/packet-rpc.h
+++ b/epan/dissectors/packet-rpc.h
@@ -120,7 +120,7 @@ extern const value_string rpc_auth_flavor[];
extern void rpc_init_proc_table(guint prog, guint vers, const vsff *proc_table,
int procedure_hf);
extern void rpc_init_prog(int proto, guint32 prog, int ett);
-extern char *rpc_prog_name(guint32 prog);
+extern const char *rpc_prog_name(guint32 prog);
extern char *rpc_proc_name(guint32 prog, guint32 vers, guint32 proc);
extern int rpc_prog_hf(guint32 prog, guint32 vers);
@@ -167,7 +167,7 @@ typedef struct _rpc_prog_info_value {
protocol_t *proto;
int proto_id;
int ett;
- char* progname;
+ const char* progname;
GArray *procedure_hfs;
} rpc_prog_info_value;
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index ba5ff32714..bd2f887d47 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -131,7 +131,7 @@ static int proto_snmp = -1;
# define DEF_MIB_MODULES "IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB:UCD-SNMP-MIB"
#endif /* _WIN32 */
-static gchar *mib_modules = DEF_MIB_MODULES;
+static const gchar *mib_modules = DEF_MIB_MODULES;
static gboolean display_oid = TRUE;
/* Subdissector tables */
@@ -534,7 +534,7 @@ static void
dissect_snmp_parse_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, const char *field_name, int ret)
{
- char *errstr;
+ const char *errstr;
errstr = asn1_err_to_str(ret);
diff --git a/epan/dissectors/packet-spnego.c b/epan/dissectors/packet-spnego.c
index 609a013d26..715adee18f 100644
--- a/epan/dissectors/packet-spnego.c
+++ b/epan/dissectors/packet-spnego.c
@@ -198,7 +198,7 @@ static void
dissect_parse_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, const char *field_name, int ret)
{
- char *errstr;
+ const char *errstr;
errstr = asn1_err_to_str(ret);
diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c
index f7a2435aa2..07c6cc02d0 100644
--- a/epan/dissectors/packet-tacacs.c
+++ b/epan/dissectors/packet-tacacs.c
@@ -69,7 +69,7 @@
#include <epan/crypt-md5.h>
#include "packet-tacacs.h"
-static void md5_xor( guint8 *data, char *key, int data_len, guint8 *session_id, guint8 version, guint8 seq_no );
+static void md5_xor( guint8 *data, const char *key, int data_len, guint8 *session_id, guint8 version, guint8 seq_no );
static int proto_tacacs = -1;
static int hf_tacacs_version = -1;
@@ -88,7 +88,7 @@ static int hf_tacacs_result3 = -1;
static gint ett_tacacs = -1;
-static char *tacplus_opt_key;
+static const char *tacplus_opt_key;
static GSList *tacplus_keys = NULL;
#define VERSION_TACACS 0x00
@@ -343,7 +343,7 @@ typedef struct _tacplus_key_entry {
} tacplus_key_entry;
static gint
-tacplus_decrypted_tvb_setup( tvbuff_t *tvb, tvbuff_t **dst_tvb, packet_info *pinfo, guint32 len, guint8 version, char *key )
+tacplus_decrypted_tvb_setup( tvbuff_t *tvb, tvbuff_t **dst_tvb, packet_info *pinfo, guint32 len, guint8 version, const char *key )
{
guint8 *buff;
guint8 session_id[4];
@@ -828,7 +828,7 @@ cmp_conv_address( gconstpointer p1, gconstpointer p2 )
return ret;
}
-static char*
+static const char*
find_key( address *srv, address *cln )
{
tacplus_key_entry data;
@@ -892,9 +892,9 @@ free_tacplus_keys( gpointer data, gpointer user_data _U_ )
static
void
-parse_tacplus_keys( char *keys_from_option )
+parse_tacplus_keys( const char *keys_from_option )
{
- char *s1,*s;
+ char *key_copy,*s,*s1;
/* Drop old keys */
if( tacplus_keys ) {
@@ -907,16 +907,15 @@ parse_tacplus_keys( char *keys_from_option )
/* option not in client/server=key format */
return ;
}
- s=strdup(keys_from_option);
- s1=s;
- keys_from_option = s;
- while(keys_from_option){
- if( (s=strchr( keys_from_option, ' ' )) != NULL )
- *s++='\0';
- parse_tuple( keys_from_option );
- keys_from_option=s;
+ key_copy=strdup(keys_from_option);
+ s=key_copy;
+ while(s){
+ if( (s1=strchr( s, ' ' )) != NULL )
+ *s1++='\0';
+ parse_tuple( s );
+ s=s1;
}
- g_free( s1 );
+ g_free( key_copy );
#ifdef DEB_TACPLUS
g_slist_foreach( tacplus_keys, tacplus_print_key_entry, GINT_TO_POINTER(1) );
#endif
@@ -934,7 +933,7 @@ dissect_tacplus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *tmp_pi;
guint32 len;
gboolean request=( pinfo->destport == TCP_PORT_TACACS );
- char *key=NULL;
+ const char *key=NULL;
if( request ) {
key=find_key( &pinfo->dst, &pinfo->src );
@@ -1111,7 +1110,7 @@ proto_reg_handoff_tacplus(void)
#define MD5_LEN 16
static void
-md5_xor( guint8 *data, char *key, int data_len, guint8 *session_id, guint8 version, guint8 seq_no )
+md5_xor( guint8 *data, const char *key, int data_len, guint8 *session_id, guint8 version, guint8 seq_no )
{
int i,j,md5_len;
md5_byte_t *md5_buff;
diff --git a/epan/dissectors/packet-tzsp.c b/epan/dissectors/packet-tzsp.c
index 79bbfe6a6c..29bb63f7cc 100644
--- a/epan/dissectors/packet-tzsp.c
+++ b/epan/dissectors/packet-tzsp.c
@@ -286,7 +286,7 @@ dissect_tzsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 encapsulation = 0;
int wtap_encap;
dissector_handle_t encap_dissector;
- char *encap_name;
+ const char *encap_name;
const char *info;
guint8 type;
diff --git a/epan/dissectors/packet-user_encap.c b/epan/dissectors/packet-user_encap.c
index d8a43c1ed1..5bdcbb3c82 100644
--- a/epan/dissectors/packet-user_encap.c
+++ b/epan/dissectors/packet-user_encap.c
@@ -42,9 +42,9 @@ typedef struct _user_encap_t {
gchar* abbr;
gchar* long_name;
- gchar* payload;
- gchar* header;
- gchar* trailer;
+ const gchar* payload;
+ const gchar* header;
+ const gchar* trailer;
guint header_size;
guint trailer_size;