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
This commit is contained in:
parent
72c01a62f8
commit
554f620001
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -937,7 +937,7 @@ dissector_add_string(const char *name, const gchar *pattern,
|
|||
dtbl_entry->initial = dtbl_entry->current;
|
||||
|
||||
/* do the table insertion */
|
||||
g_hash_table_insert( sub_dissectors->hash_table, pattern,
|
||||
g_hash_table_insert( sub_dissectors->hash_table, (gpointer)pattern,
|
||||
(gpointer)dtbl_entry);
|
||||
|
||||
/*
|
||||
|
@ -1417,7 +1417,7 @@ register_dissector_table(const char *name, const char *ui_name, ftenum_t type,
|
|||
return sub_dissectors;
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
get_dissector_table_ui_name(const char *name)
|
||||
{
|
||||
dissector_table_t sub_dissectors = find_dissector_table( name);
|
||||
|
@ -1583,7 +1583,7 @@ static GHashTable *registered_dissectors = NULL;
|
|||
|
||||
/* Get the short name of the protocol for a dissector handle, if it has
|
||||
a protocol. */
|
||||
char *
|
||||
const char *
|
||||
dissector_handle_get_short_name(dissector_handle_t handle)
|
||||
{
|
||||
if (handle->protocol == NULL) {
|
||||
|
@ -1758,7 +1758,7 @@ dissector_dump_decodes_display(gchar *table_name, ftenum_t selector_type _U_,
|
|||
dtbl_entry_t *dtbl_entry;
|
||||
dissector_handle_t handle;
|
||||
gint proto_id;
|
||||
gchar *decode_as;
|
||||
const gchar *decode_as;
|
||||
|
||||
g_assert(sub_dissectors);
|
||||
switch (sub_dissectors->type) {
|
||||
|
|
|
@ -142,7 +142,7 @@ typedef void (*DATFunc) (gchar *table_name, ftenum_t selector_type,
|
|||
gpointer key, gpointer value, gpointer user_data);
|
||||
typedef void (*DATFunc_handle) (gchar *table_name, gpointer value,
|
||||
gpointer user_data);
|
||||
typedef void (*DATFunc_table) (gchar *table_name, gchar *ui_name,
|
||||
typedef void (*DATFunc_table) (gchar *table_name, const gchar *ui_name,
|
||||
gpointer user_data);
|
||||
|
||||
/* Opaque structure - provides type checking but no access to components */
|
||||
|
@ -169,7 +169,7 @@ extern dissector_table_t register_dissector_table(const char *name,
|
|||
extern dissector_table_t find_dissector_table(const char *name);
|
||||
|
||||
/* Get the UI name for a sub-dissector table, given its internal name */
|
||||
extern char *get_dissector_table_ui_name(const char *name);
|
||||
extern const char *get_dissector_table_ui_name(const char *name);
|
||||
|
||||
/* Get the field type for values of the selector for a dissector table,
|
||||
given the table's internal name */
|
||||
|
@ -284,7 +284,7 @@ extern void new_register_dissector(const char *name, new_dissector_t dissector,
|
|||
int proto);
|
||||
|
||||
/* Get the short name of the protocol for a dissector handle. */
|
||||
extern char *dissector_handle_get_short_name(dissector_handle_t handle);
|
||||
extern const char *dissector_handle_get_short_name(dissector_handle_t handle);
|
||||
|
||||
/* Get the index of the protocol for a dissector handle. */
|
||||
extern int dissector_handle_get_protocol_index(dissector_handle_t handle);
|
||||
|
|
|
@ -67,7 +67,7 @@ struct preference {
|
|||
guint *uint;
|
||||
gboolean *boolp;
|
||||
gint *enump;
|
||||
char **string;
|
||||
const char **string;
|
||||
range_t **range;
|
||||
} varp; /* pointer to variable storing the value */
|
||||
union {
|
||||
|
|
|
@ -2046,7 +2046,7 @@ set_pref(gchar *pref_name, gchar *value)
|
|||
case PREF_STRING:
|
||||
if (strcmp(*pref->varp.string, value) != 0) {
|
||||
module->prefs_changed = TRUE;
|
||||
g_free(*pref->varp.string);
|
||||
g_free((void *)*pref->varp.string);
|
||||
*pref->varp.string = g_strdup(value);
|
||||
}
|
||||
break;
|
||||
|
|
28
epan/proto.c
28
epan/proto.c
|
@ -165,14 +165,14 @@ int hf_text_only = -1;
|
|||
|
||||
/* Structure for information about a protocol */
|
||||
struct _protocol {
|
||||
char *name; /* long description */
|
||||
char *short_name; /* short description */
|
||||
char *filter_name; /* name of this protocol in filters */
|
||||
int proto_id; /* field ID for this protocol */
|
||||
GList *fields; /* fields for this protocol */
|
||||
GList *last_field; /* pointer to end of list of fields */
|
||||
gboolean is_enabled; /* TRUE if protocol is enabled */
|
||||
gboolean can_toggle; /* TRUE if is_enabled can be changed */
|
||||
const char *name; /* long description */
|
||||
const char *short_name; /* short description */
|
||||
const char *filter_name; /* name of this protocol in filters */
|
||||
int proto_id; /* field ID for this protocol */
|
||||
GList *fields; /* fields for this protocol */
|
||||
GList *last_field; /* pointer to end of list of fields */
|
||||
gboolean is_enabled; /* TRUE if protocol is enabled */
|
||||
gboolean can_toggle; /* TRUE if is_enabled can be changed */
|
||||
};
|
||||
|
||||
/* List of all protocols */
|
||||
|
@ -2648,7 +2648,7 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi
|
|||
g_error("Duplicate protocol name \"%s\"!"
|
||||
" This might be caused by an inappropriate plugin or a development error.", name);
|
||||
}
|
||||
g_hash_table_insert(proto_names, key, name);
|
||||
g_hash_table_insert(proto_names, key, (gpointer)name);
|
||||
|
||||
key = g_malloc (sizeof(gint));
|
||||
*key = g_str_hash(short_name);
|
||||
|
@ -2657,7 +2657,7 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi
|
|||
g_error("Duplicate protocol short_name \"%s\"!"
|
||||
" This might be caused by an inappropriate plugin or a development error.", short_name);
|
||||
}
|
||||
g_hash_table_insert(proto_short_names, key, short_name);
|
||||
g_hash_table_insert(proto_short_names, key, (gpointer)short_name);
|
||||
|
||||
found_invalid = FALSE;
|
||||
for (i = 0; i < strlen(filter_name); i++) {
|
||||
|
@ -2679,7 +2679,7 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi
|
|||
g_error("Duplicate protocol filter_name \"%s\"!"
|
||||
" This might be caused by an inappropriate plugin or a development error.", filter_name);
|
||||
}
|
||||
g_hash_table_insert(proto_filter_names, key, filter_name);
|
||||
g_hash_table_insert(proto_filter_names, key, (gpointer)filter_name);
|
||||
|
||||
/* Add this protocol to the list of known protocols; the list
|
||||
is sorted by protocol short name. */
|
||||
|
@ -2813,7 +2813,7 @@ int proto_get_id_by_filter_name(const gchar* filter_name)
|
|||
return protocol->proto_id;
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
proto_get_protocol_name(int proto_id)
|
||||
{
|
||||
protocol_t *protocol;
|
||||
|
@ -2822,7 +2822,7 @@ proto_get_protocol_name(int proto_id)
|
|||
return protocol->name;
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
proto_get_protocol_short_name(protocol_t *protocol)
|
||||
{
|
||||
if (protocol == NULL)
|
||||
|
@ -2830,7 +2830,7 @@ proto_get_protocol_short_name(protocol_t *protocol)
|
|||
return protocol->short_name;
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
proto_get_protocol_filter_name(int proto_id)
|
||||
{
|
||||
protocol_t *protocol;
|
||||
|
|
|
@ -1058,7 +1058,7 @@ extern protocol_t *find_protocol_by_id(int proto_id);
|
|||
/** Get the protocol's name for the given protocol's item number.
|
||||
@param proto_id protocol id (0-indexed)
|
||||
@return its name */
|
||||
extern char *proto_get_protocol_name(int proto_id);
|
||||
extern const char *proto_get_protocol_name(int proto_id);
|
||||
|
||||
/** Get the protocol's item number, for the given protocol's "protocol_t".
|
||||
@return its proto_id */
|
||||
|
@ -1066,7 +1066,7 @@ extern int proto_get_id(protocol_t *protocol);
|
|||
|
||||
/** Get the protocol's short name, for the given protocol's "protocol_t".
|
||||
@return its short name. */
|
||||
extern char *proto_get_protocol_short_name(protocol_t *protocol);
|
||||
extern const char *proto_get_protocol_short_name(protocol_t *protocol);
|
||||
|
||||
/** Is protocol's decoding enabled ?
|
||||
@param protocol
|
||||
|
@ -1076,7 +1076,7 @@ extern gboolean proto_is_protocol_enabled(protocol_t *protocol);
|
|||
/** Get a protocol's filter name by it's item number.
|
||||
@param proto_id protocol id (0-indexed)
|
||||
@return its filter name. */
|
||||
extern char *proto_get_protocol_filter_name(int proto_id);
|
||||
extern const char *proto_get_protocol_filter_name(int proto_id);
|
||||
|
||||
/** Enable / Disable protocol of the given item number.
|
||||
@param proto_id protocol id (0-indexed)
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
typedef struct _rpcstat_t {
|
||||
GtkWidget *win;
|
||||
srt_stat_table srt_table;
|
||||
char *prog;
|
||||
const char *prog;
|
||||
e_uuid_t uuid;
|
||||
guint16 ver;
|
||||
int num_procedures;
|
||||
|
@ -193,8 +193,8 @@ gtk_dcerpcstat_init(char *optarg)
|
|||
GtkWidget *vbox;
|
||||
GtkWidget *stat_label;
|
||||
GtkWidget *filter_label;
|
||||
GtkWidget *bbox;
|
||||
GtkWidget *close_bt;
|
||||
GtkWidget *bbox;
|
||||
GtkWidget *close_bt;
|
||||
dcerpc_sub_dissector *procs;
|
||||
e_uuid_t uuid;
|
||||
guint d1,d2,d3,d40,d41,d42,d43,d44,d45,d46,d47;
|
||||
|
@ -295,7 +295,7 @@ gtk_dcerpcstat_init(char *optarg)
|
|||
|
||||
for(i=0;i<(max_procs+1);i++){
|
||||
int j;
|
||||
char *proc_name;
|
||||
const char *proc_name;
|
||||
|
||||
proc_name="unknown";
|
||||
for(j=0;procs[j].name;j++){
|
||||
|
@ -431,7 +431,7 @@ static GtkWidget *program_submenu_menu;
|
|||
static GtkWidget *program_submenu_item;
|
||||
static GtkWidget *program_submenu_label;
|
||||
static int program_subitem_index;
|
||||
static char *first_menu_name;
|
||||
static const char *first_menu_name;
|
||||
static void
|
||||
dcerpcstat_add_program_to_menu(dcerpc_uuid_key *k, dcerpc_uuid_value *v)
|
||||
{
|
||||
|
|
|
@ -97,10 +97,10 @@ decode_dcerpc_binding_free(void *binding);
|
|||
extern void
|
||||
decode_add_to_show_list (
|
||||
gpointer list_data,
|
||||
gchar *table_name,
|
||||
const gchar *table_name,
|
||||
gchar *selector_name,
|
||||
gchar *initial_proto_name,
|
||||
gchar *current_proto_name);
|
||||
const gchar *initial_proto_name,
|
||||
const gchar *current_proto_name);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -124,7 +124,7 @@ gchar *current_proto_name);
|
|||
* to store any information generated by this routine.
|
||||
*/
|
||||
extern void
|
||||
decode_add_to_list (gchar *table_name, gchar *proto_name, gpointer value, gpointer user_data);
|
||||
decode_add_to_list (gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data);
|
||||
|
||||
/*
|
||||
* This routine starts the creation of a List on a notebook page. It
|
||||
|
|
|
@ -260,10 +260,10 @@ gpointer userdata)
|
|||
void
|
||||
decode_add_to_show_list (
|
||||
gpointer list_data,
|
||||
gchar *table_name,
|
||||
const gchar *table_name,
|
||||
gchar *selector_name,
|
||||
gchar *initial_proto_name,
|
||||
gchar *current_proto_name)
|
||||
const gchar *initial_proto_name,
|
||||
const gchar *current_proto_name)
|
||||
{
|
||||
gchar *text[E_LIST_D_COLUMNS];
|
||||
#if GTK_MAJOR_VERSION < 2
|
||||
|
@ -280,10 +280,10 @@ gchar *current_proto_name)
|
|||
store = (GtkListStore *)list_data;
|
||||
#endif
|
||||
|
||||
text[E_LIST_D_TABLE] = table_name;
|
||||
text[E_LIST_D_TABLE] = (char *)table_name;
|
||||
text[E_LIST_D_SELECTOR] = selector_name;
|
||||
text[E_LIST_D_INITIAL] = initial_proto_name;
|
||||
text[E_LIST_D_CURRENT] = current_proto_name;
|
||||
text[E_LIST_D_INITIAL] = (char *)initial_proto_name;
|
||||
text[E_LIST_D_CURRENT] = (char *)current_proto_name;
|
||||
#if GTK_MAJOR_VERSION < 2
|
||||
row = gtk_clist_prepend(clist, text);
|
||||
#else
|
||||
|
@ -320,8 +320,9 @@ decode_build_show_list (gchar *table_name, ftenum_t selector_type,
|
|||
gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
dissector_handle_t current, initial;
|
||||
gchar *current_proto_name, *initial_proto_name, *selector_name;
|
||||
gchar string1[20];
|
||||
const gchar *current_proto_name, *initial_proto_name;
|
||||
gchar *selector_name;
|
||||
gchar string1[20];
|
||||
|
||||
g_assert(user_data);
|
||||
g_assert(value);
|
||||
|
@ -1229,7 +1230,7 @@ lookup_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter,
|
|||
* to store any information generated by this routine.
|
||||
*/
|
||||
void
|
||||
decode_add_to_list (gchar *table_name, gchar *proto_name, gpointer value, gpointer user_data)
|
||||
decode_add_to_list (gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data)
|
||||
{
|
||||
gchar *text[E_LIST_S_COLUMNS];
|
||||
#if GTK_MAJOR_VERSION < 2
|
||||
|
@ -1262,7 +1263,7 @@ decode_add_to_list (gchar *table_name, gchar *proto_name, gpointer value, gpoint
|
|||
if (hli.found) return;
|
||||
#endif
|
||||
|
||||
text[E_LIST_S_PROTO_NAME] = proto_name;
|
||||
text[E_LIST_S_PROTO_NAME] = (char *)proto_name;
|
||||
text[E_LIST_S_TABLE] = table_name;
|
||||
#if GTK_MAJOR_VERSION < 2
|
||||
row = gtk_clist_prepend(list, text);
|
||||
|
@ -1279,7 +1280,7 @@ decode_add_to_list (gchar *table_name, gchar *proto_name, gpointer value, gpoint
|
|||
static void
|
||||
decode_proto_add_to_list (gchar *table_name, gpointer value, gpointer user_data)
|
||||
{
|
||||
gchar *proto_name;
|
||||
const gchar *proto_name;
|
||||
gint i;
|
||||
dissector_handle_t handle;
|
||||
|
||||
|
|
|
@ -731,7 +731,7 @@ value_list_sel_cb(GtkTreeSelection *sel, gpointer value_entry_arg)
|
|||
}
|
||||
|
||||
static void
|
||||
dfilter_report_bad_value(char *format, ...)
|
||||
dfilter_report_bad_value(const char *format, ...)
|
||||
{
|
||||
char error_msg_buf[1024];
|
||||
va_list args;
|
||||
|
@ -1396,7 +1396,7 @@ dfilter_expr_dlg_new(GtkWidget *filter_te)
|
|||
|
||||
GtkTreeIter iter, child_iter;
|
||||
void *cookie, *cookie2;
|
||||
gchar *name;
|
||||
const gchar *name;
|
||||
|
||||
for (i = proto_get_first_protocol(&cookie); i != -1;
|
||||
i = proto_get_next_protocol(&cookie)) {
|
||||
|
|
|
@ -985,7 +985,7 @@ pref_fetch(pref_t *pref, gpointer user_data)
|
|||
str_val = gtk_entry_get_text(GTK_ENTRY(pref->control));
|
||||
if (strcmp(*pref->varp.string, str_val) != 0) {
|
||||
*pref_changed_p = TRUE;
|
||||
g_free(*pref->varp.string);
|
||||
g_free((void *)*pref->varp.string);
|
||||
*pref->varp.string = g_strdup(str_val);
|
||||
}
|
||||
break;
|
||||
|
@ -1319,7 +1319,7 @@ pref_revert(pref_t *pref, gpointer user_data)
|
|||
case PREF_STRING:
|
||||
if (strcmp(*pref->varp.string, pref->saved_val.string) != 0) {
|
||||
*pref_changed_p = TRUE;
|
||||
g_free(*pref->varp.string);
|
||||
g_free((void *)*pref->varp.string);
|
||||
*pref->varp.string = g_strdup(pref->saved_val.string);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -77,13 +77,13 @@ static GtkWidget *proto_w = NULL;
|
|||
static GSList *protocol_list = NULL;
|
||||
|
||||
typedef struct protocol_data {
|
||||
char *name;
|
||||
char *abbrev;
|
||||
int hfinfo_index;
|
||||
gboolean enabled;
|
||||
gboolean was_enabled;
|
||||
const char *name;
|
||||
const char *abbrev;
|
||||
int hfinfo_index;
|
||||
gboolean enabled;
|
||||
gboolean was_enabled;
|
||||
#if GTK_MAJOR_VERSION < 2
|
||||
gint row;
|
||||
gint row;
|
||||
#else
|
||||
GtkTreeIter iter;
|
||||
#endif
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
typedef struct _rpcstat_t {
|
||||
GtkWidget *win;
|
||||
srt_stat_table srt_table;
|
||||
char *prog;
|
||||
const char *prog;
|
||||
guint32 program;
|
||||
guint32 version;
|
||||
guint32 num_procedures;
|
||||
|
@ -224,8 +224,8 @@ gtk_rpcstat_init(char *optarg)
|
|||
GtkWidget *vbox;
|
||||
GtkWidget *stat_label;
|
||||
GtkWidget *filter_label;
|
||||
GtkWidget *bbox;
|
||||
GtkWidget *close_bt;
|
||||
GtkWidget *bbox;
|
||||
GtkWidget *close_bt;
|
||||
int program, version, pos;
|
||||
char *filter=NULL;
|
||||
GString *error_string;
|
||||
|
|
|
@ -277,7 +277,7 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
|
|||
const char *type_name;
|
||||
void *cookie, *cookie2;
|
||||
protocol_t *protocol;
|
||||
char *name, *short_name, *filter_name;
|
||||
const char *name, *short_name, *filter_name;
|
||||
int namel = 0, short_namel = 0, filter_namel = 0;
|
||||
int count, fcount;
|
||||
|
||||
|
@ -303,7 +303,7 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
|
|||
for (i = proto_get_first_protocol(&cookie); i != -1;
|
||||
i = proto_get_next_protocol(&cookie)) {
|
||||
count++;
|
||||
protocol = find_protocol_by_id(i);
|
||||
protocol = find_protocol_by_id(i);
|
||||
name = proto_get_protocol_name(i);
|
||||
short_name = proto_get_protocol_short_name(protocol);
|
||||
filter_name = proto_get_protocol_filter_name(i);
|
||||
|
@ -328,7 +328,7 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
|
|||
/* ok, display the correctly aligned strings */
|
||||
for (i = proto_get_first_protocol(&cookie); i != -1;
|
||||
i = proto_get_next_protocol(&cookie)) {
|
||||
protocol = find_protocol_by_id(i);
|
||||
protocol = find_protocol_by_id(i);
|
||||
name = proto_get_protocol_name(i);
|
||||
short_name = proto_get_protocol_short_name(protocol);
|
||||
filter_name = proto_get_protocol_filter_name(i);
|
||||
|
@ -391,7 +391,7 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
|
|||
fcount = 0;
|
||||
for (i = proto_get_first_protocol(&cookie); i != -1;
|
||||
i = proto_get_next_protocol(&cookie)) {
|
||||
protocol = find_protocol_by_id(i);
|
||||
protocol = find_protocol_by_id(i);
|
||||
name = proto_get_protocol_name(i);
|
||||
short_name = proto_get_protocol_short_name(protocol);
|
||||
filter_name = proto_get_protocol_filter_name(i);
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
/* used to keep track of statistics for a specific procedure */
|
||||
typedef struct _rpc_procedure_t {
|
||||
char *proc;
|
||||
const char *proc;
|
||||
int num;
|
||||
nstime_t min;
|
||||
nstime_t max;
|
||||
|
@ -49,7 +49,7 @@ typedef struct _rpc_procedure_t {
|
|||
|
||||
/* used to keep track of the statistics for an entire program interface */
|
||||
typedef struct _rpcstat_t {
|
||||
char *prog;
|
||||
const char *prog;
|
||||
char *filter;
|
||||
e_uuid_t uuid;
|
||||
guint16 ver;
|
||||
|
|
|
@ -55,7 +55,7 @@ typedef struct _rpc_procedure_t {
|
|||
|
||||
/* used to keep track of the statistics for an entire program interface */
|
||||
typedef struct _rpcstat_t {
|
||||
char *prog;
|
||||
const char *prog;
|
||||
char *filter;
|
||||
guint32 program;
|
||||
guint32 version;
|
||||
|
|
|
@ -268,7 +268,8 @@ print_usage(gboolean print_ver)
|
|||
* descriptive name.
|
||||
*/
|
||||
static void
|
||||
display_dissector_table_names(char *table_name, char *ui_name, gpointer output)
|
||||
display_dissector_table_names(char *table_name, const char *ui_name,
|
||||
gpointer output)
|
||||
{
|
||||
fprintf((FILE *)output, "\t%s (%s)\n", table_name, ui_name);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue