if (ue->engine.data) g_free(ue->engine.data);
}
-static void snmp_users_update_cb(void* p _U_, char** err) {
+static void snmp_users_update_cb(void* p _U_, const char** err) {
snmp_ue_assoc_t* ue = p;
GString* es = g_string_new("");
wireshark_extra_gcc_flags=$enableval
if test $enableval != no
then
- AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-qual)
- AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
- AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wbad-function-cast)
- AC_WIRESHARK_GCC_CFLAGS_CHECK(-pedantic)
- AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wstrict-prototypes)
- AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wmissing-declarations)
- AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wwrite-strings)
+ AC_WIRESHARK_GCC_CFLAGS_CHECK(-pedantic)
+ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-long-long)
+ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wbad-function-cast)
+ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-qual)
+ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wwrite-strings)
+ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshorten-64-to-32)
+ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wstrict-prototypes)
+ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wmissing-declarations)
fi
],)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wall -W)
-AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpointer-arith)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdeclaration-after-statement)
+AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wendif-labels)
+AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpointer-arith)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-pointer-sign)
+AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
#
# If we're running gcc add '-D_U_="__attribute__((unused))"' to CFLAGS as well,
#define SET_ADDRESS(addr, addr_type, addr_len, addr_data) { \
(addr)->type = (addr_type); \
(addr)->len = (addr_len); \
- (addr)->data = (void *)(addr_data); \
+ (addr)->data = (const void *)(addr_data); \
}
/*
#endif
}
-static gchar* dfilter_macro_resolve(gchar* name, gchar** args, gchar** error) {
+static gchar* dfilter_macro_resolve(gchar* name, gchar** args, const gchar** error) {
GString* text;
int argc = 0;
dfilter_macro_t* m = NULL;
}
-gchar* dfilter_macro_apply(const gchar* text, guint depth, gchar** error) {
+gchar* dfilter_macro_apply(const gchar* text, guint depth, const gchar** error) {
enum { OUTSIDE, STARTING, NAME, ARGS } state = OUTSIDE;
GString* out;
GString* name = NULL;
}
}
-static void macro_update(void* mp, gchar** error) {
+static void macro_update(void* mp, const gchar** error) {
dfilter_macro_t* m = mp;
GPtrArray* parts;
GArray* args_pos;
}
-gboolean macro_name_chk(void* r _U_, const char* in_name, unsigned name_len, void* u1 _U_, void* u2 _U_, char** error) {
+static gboolean macro_name_chk(void* r _U_, const char* in_name, unsigned name_len, void* u1 _U_, void* u2 _U_, const char** error) {
guint i;
for (i=0; i < name_len; i++) {
typedef void (*dfilter_macro_cb_t)(dfilter_macro_t*, void*);
void dfilter_macro_foreach(dfilter_macro_cb_t, void*);
+/* save dfilter macros to a file */
+void dfilter_macro_save(const gchar*, gchar**);
+
/* dumps the macros in the list (debug info, not formated as in the macros file) */
void dfilter_macro_dump(void);
/* applies all macros to the given text and returns the resulting string or NULL on failure */
-gchar* dfilter_macro_apply(const gchar* text, guint depth, gchar** error);
+gchar* dfilter_macro_apply(const gchar* text, guint depth, const gchar** error);
void dfilter_macro_init(void);
/* Global error message space for dfilter_compile errors */
static gchar dfilter_error_msg_buf[1024];
-gchar *dfilter_error_msg; /* NULL when no error resulted */
+const gchar *dfilter_error_msg; /* NULL when no error resulted */
/* From scanner.c */
void df_scanner_text(const char *text);
* libwireshark.dll, we need a special declaration.
*/
-WS_VAR_IMPORT gchar *dfilter_error_msg;
+WS_VAR_IMPORT const gchar *dfilter_error_msg;
/* Apply compiled dfilter */
/* This is a "function definition" record, holding everything
* we need to know about a function */
typedef struct {
- char *name;
+ const char *name;
DFFuncType function;
ftenum_t retval_ftype;
guint min_nargs;
guint8 msid_num_digits = 0;
guint8 msid_index = 0;
guint8 msid_digits[A11_MSG_MSID_LEN_MAX+2];
- guint8* p_msid = 0;
+ const guint8* p_msid = 0;
gboolean odd_even_ind = 0;
/* Decode Protocol Type */
emem_tree_t* legs_by_osaid = NULL;
emem_tree_t* legs_by_bearer = NULL;
-static gchar* dissect_fields_unknown(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_unknown(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
proto_item* pi = proto_tree_add_item(tree,hf_alcap_unknown,tvb,offset,len,FALSE);
proto_item_set_expert_flags(pi, PI_UNDECODED, PI_WARN);
return NULL;
}
-static gchar* dissect_fields_cau(packet_info* pinfo, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info) {
+static const gchar* dissect_fields_cau(packet_info* pinfo, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info) {
/*
* Q.2630.1 -> 7.3.1 Cause
*
return ret_str;
}
-static gchar* dissect_fields_ceid(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info) {
+static const gchar* dissect_fields_ceid(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info) {
/*
* Q.2630.1 -> 7.3.2 Connection Element Identifier
*
}
}
-static gchar* dissect_fields_desea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_desea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.1 -> 7.3.3 Destination E.164 service endpoint address
*
return NULL;
}
-static gchar* dissect_fields_oesea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_oesea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.23 Origination E.164 service endpoint address
*
return NULL;
}
-static gchar* dissect_fields_dnsea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_dnsea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.1 -> 7.3.4 Destination NSAP service endpoint address
*
return NULL;
}
-static gchar* dissect_fields_onsea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_onsea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.24 Origination NSAP service endpoint address
*
return NULL;
}
-static gchar* dissect_fields_alc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_alc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.1 -> 7.3.5 Link characteristics
*
return NULL;
}
-static gchar* dissect_fields_plc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_plc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.2 -> 7.3.19 Preferred Link characteristics
*
return NULL;
}
-static gchar* dissect_fields_osaid(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_osaid(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.1 -> 7.3.6 Originating signalling association identifier
*
return NULL;
}
-static gchar* dissect_fields_sugr(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_sugr(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.1 -> 7.3.7 Served user generated reference
*
return NULL;
}
-static gchar* dissect_fields_suci(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_suci(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.2 -> 7.3.22 Served user correlation ID
*
return NULL;
}
-static gchar* dissect_fields_ssia(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_ssia(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.2 -> 7.3.9 Service specific information (Audio)
*
return NULL;
}
-static gchar* dissect_fields_ssim(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_ssim(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.1 -> 7.3.10 Service specific information (Multirate)
*
return NULL;
}
-static gchar* dissect_fields_ssisa(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_ssisa(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.1 -> 7.3.11 Service specific information (SAR-assured)
*
return NULL;
}
-static gchar* dissect_fields_ssisu(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_ssisu(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.1 -> 7.3.12 Service specific information (SAR-unassured)
*
return NULL;
}
-static gchar* dissect_fields_none(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_none(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* used for parameters that have no fields, just checks if len==0
*
return NULL;
}
-static gchar* dissect_fields_ssiae(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_ssiae(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.2 -> 7.3.15 Service specific information (Audio Extended)
*
return NULL;
}
-static gchar* dissect_fields_pssiae(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_pssiae(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.2 -> 7.3.17 Preferred service specific information (Audio Extended)
*
return NULL;
}
-static gchar* dissect_fields_ssime(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_ssime(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.2 -> 7.3.16 Service specific information (Multirate Extended)
*
return NULL;
}
-static gchar* dissect_fields_pssime(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_pssime(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.2 -> 7.3.18 Preferred service specific information (Multirate Extended)
*
return NULL;
}
-static gchar* dissect_fields_acc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_acc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.25 Automatic congestion control
*
}
-static gchar* dissect_fields_cp(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_cp(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.26 Connection Priority
*
return NULL;
}
-static gchar* dissect_fields_pt(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_pt(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.2 -> 7.3.14 Path Type
*
}
-static gchar* dissect_fields_hc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_hc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.27 Hop counter
*
}
-static gchar* dissect_fields_fbw(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_fbw(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.32 Fixed bandwidth transfer capability
*
return NULL;
}
-static gchar* dissect_fields_pfbw(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_pfbw(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.29 Preferred fixed bandwidth transfer capability
*
return NULL;
}
-static gchar* dissect_fields_vbws(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_vbws(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.33 Variable bandwidth stringent transfer capability
*
return NULL;
}
-static gchar* dissect_fields_pvbws(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_pvbws(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.30 Preferred variable bandwidth stringent transfer capability
*
}
-static gchar* dissect_fields_pvbwt(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_pvbwt(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.31 Preferred variable bandwidth tolerant transfer capability
*
return NULL;
}
-static gchar* dissect_fields_vbwt(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_vbwt(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.3 -> 7.3.34 Variable bandwidth tolerant transfer capability
*
return NULL;
}
-static gchar* dissect_fields_sut(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+static const gchar* dissect_fields_sut(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
/*
* Q.2630.1 -> 7.3.8 Served user transport
*
return NULL;
}
-typedef gchar* (*alcap_parameter_dissector_t) (packet_info* pinfo, tvbuff_t*, proto_tree*, int, int, alcap_message_info_t*);
+typedef const gchar* (*alcap_parameter_dissector_t) (packet_info* pinfo, tvbuff_t*, proto_tree*, int, int, alcap_message_info_t*);
typedef struct _alcap_param_info_t {
gint ett;
guint param_len = tvb_get_guint8(tvb,offset+2);
const alcap_param_info_t* param_info = GET_PARAM_INFO(param_id);
proto_tree* param_tree;
- gchar* colinfo_str = NULL;
+ const gchar* colinfo_str = NULL;
pi = proto_tree_add_item(alcap_tree,hf_alcap_param_id,tvb,offset,1,FALSE);
param_tree = proto_item_add_subtree(pi,param_info->ett);
guint8 tag_no, tag_info;
guint32 lvt;
guint tag_len;
- gfloat f_val = 0.0;
+ gfloat f_val;
proto_item *ti;
proto_tree *subtree;
guint8 tag_no, tag_info;
guint32 lvt;
guint tag_len;
- gdouble d_val = 0.0;
+ gdouble d_val;
proto_item *ti;
proto_tree *subtree;
{
if(syntax && *syntax)
- g_hash_table_insert(syntax_table, (gpointer)oid, (gpointer)syntax);
+ g_hash_table_insert(syntax_table, (const gpointer)oid, (const gpointer)syntax);
if(name && *name)
register_ber_oid_name(oid, name);
}
-void ber_decode_as(gchar *syntax)
+void ber_decode_as(const gchar *syntax)
{
if(decode_as_syntax) {
}
/* Get oid syntax from hash table to get translation in proto dissection(packet-per.c) */
-const gchar *
+static const gchar *
get_ber_oid_syntax(const char *oid)
{
return g_hash_table_lookup(syntax_table, oid);
if((ptr = strrchr(ber_filename, '.')) != NULL) {
- ber_decode_as((gchar *)get_ber_oid_syntax(ptr));
+ ber_decode_as(get_ber_oid_syntax(ptr));
}
}
proto_item *cause;
proto_tree *tree = NULL;
const asn_namedbit *nb;
- char *sep;
+ const char *sep;
gboolean term;
if(!implicit_tag){
guint32 val;
int **bf;
header_field_info *hfi;
- char *sep;
+ const char *sep;
gboolean term;
unsigned int i, tvb_len;
void dissect_ber_oid_NULL_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
void ber_decode_as_foreach(GHFunc func, gpointer user_data); /* iterate through known syntaxes */
-void ber_decode_as(gchar *syntax); /* decode the current capture as this syntax */
+void ber_decode_as(const gchar *syntax); /* decode the current capture as this syntax */
void ber_set_filename(gchar *filename); /* name of current BER-encoded file */
gboolean oid_has_dissector(const char *oid);
struct amp_message {
- char *name;
+ const char *name;
guint32 value;
};
struct client_information {
char id[4];
- char *name;
+ const char *name;
};
static struct client_information peer_id[] = {
/* PXE protocol 2.1 as described in the intel specs */
if (*vendor_class_id_p != NULL &&
- strncmp((gchar*)*vendor_class_id_p, "PXEClient", strlen((gchar*)"PXEClient")) == 0) {
+ strncmp((const gchar*)*vendor_class_id_p, "PXEClient", strlen("PXEClient")) == 0) {
proto_item_append_text(vti, " (PXEClient)");
v_tree = proto_item_add_subtree(vti, ett_bootp_option);
tvb, optoff, optend);
}
} else if (*vendor_class_id_p != NULL &&
- ((strncmp((gchar*)*vendor_class_id_p, "pktc", strlen((gchar*)"pktc")) == 0) ||
- (strncmp((gchar*)*vendor_class_id_p, "docsis", strlen((gchar*)"docsis")) == 0) ||
- (strncmp((gchar*)*vendor_class_id_p, "CableHome", strlen((gchar*)"CableHome")) == 0))) {
+ ((strncmp((const gchar*)*vendor_class_id_p, "pktc", strlen("pktc")) == 0) ||
+ (strncmp((const gchar*)*vendor_class_id_p, "docsis", strlen("docsis")) == 0) ||
+ (strncmp((const gchar*)*vendor_class_id_p, "CableHome", strlen("CableHome")) == 0))) {
/* CableLabs standard - see www.cablelabs.com/projects */
proto_item_append_text(vti, " (CableLabs)");
*/
proto_item_append_text(vti, " = \"%s\"",
tvb_format_stringzpad(tvb, optoff, consumed-2));
- if ((tvb_memeql(tvb, optoff, (guint8*)PACKETCABLE_MTA_CAP10,
+ if ((tvb_memeql(tvb, optoff, (const guint8*)PACKETCABLE_MTA_CAP10,
strlen(PACKETCABLE_MTA_CAP10)) == 0)
||
- (tvb_memeql(tvb, optoff, (guint8*)PACKETCABLE_MTA_CAP15,
+ (tvb_memeql(tvb, optoff, (const guint8*)PACKETCABLE_MTA_CAP15,
strlen(PACKETCABLE_MTA_CAP10)) == 0))
{
dissect_packetcable_mta_cap(v_tree, tvb, optoff, optlen);
}
else {
- if (tvb_memeql(tvb, optoff, (guint8*)PACKETCABLE_CM_CAP11,
+ if (tvb_memeql(tvb, optoff, (const guint8*)PACKETCABLE_CM_CAP11,
strlen(PACKETCABLE_CM_CAP11)) == 0
||
- tvb_memeql(tvb, optoff, (guint8*)PACKETCABLE_CM_CAP20,
+ tvb_memeql(tvb, optoff, (const guint8*)PACKETCABLE_CM_CAP20,
strlen(PACKETCABLE_CM_CAP20)) == 0 )
{
dissect_docsis_cm_cap(v_tree, tvb, optoff, optlen);
proto_tree *pkt_s_tree;
proto_item *vti;
int max_timer_val = 255, i;
- char *dns_name, bit_fld[24];
+ const char *dns_name;
+ char bit_fld[24];
subopt = tvb_get_guint8(tvb, suboptoff);
suboptoff++;
}
/* The server host name is optional */
- if (tvb_get_guint8(tvb, 44) != '\0') {
+ if (tvb_get_guint8(tvb, SERVER_NAME_OFFSET) != '\0') {
proto_tree_add_item(bp_tree, hf_bootp_server, tvb,
SERVER_NAME_OFFSET,
SERVER_NAME_LEN, FALSE);
proto_tree_add_string_format(bp_tree, hf_bootp_server, tvb,
SERVER_NAME_OFFSET,
SERVER_NAME_LEN,
- (gchar*)tvb_get_ptr(tvb, SERVER_NAME_OFFSET, 1),
+ (const gchar*)tvb_get_ptr(tvb, SERVER_NAME_OFFSET, 1),
"Server host name not given");
}
/* Boot file */
- if (tvb_get_guint8(tvb, 108) != '\0') {
+ if (tvb_get_guint8(tvb, FILE_NAME_OFFSET) != '\0') {
proto_tree_add_item(bp_tree, hf_bootp_file, tvb,
FILE_NAME_OFFSET,
FILE_NAME_LEN, FALSE);
proto_tree_add_string_format(bp_tree, hf_bootp_file, tvb,
FILE_NAME_OFFSET,
FILE_NAME_LEN,
- (gchar*)tvb_get_ptr(tvb, FILE_NAME_OFFSET, 1),
+ (const gchar*)tvb_get_ptr(tvb, FILE_NAME_OFFSET, 1),
"Boot file name not given");
}
}
};
/* Assumes the rest of the tvb contains the digits to be turned into a string
*/
-static char*
+static const char*
unpack_digits(tvbuff_t *tvb, int offset,dgt_set_t *dgt,gboolean skip_first){
int length;
static int
dissect_bssap_imei(tvbuff_t *tvb, proto_tree *tree, int offset)
{
- proto_item *item = NULL;
- proto_tree *ie_tree = NULL;
+ proto_item *item = NULL;
+ proto_tree *ie_tree = NULL;
guint8 ie_len;
tvbuff_t *ie_tvb;
- char *digit_str;
+ const char *digit_str;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_imei_ie, tvb, offset, ie_len+2, FALSE);
static int
dissect_bssap_imesiv(tvbuff_t *tvb, proto_tree *tree, int offset)
{
- proto_item *item = NULL;
- proto_tree *ie_tree = NULL;
+ proto_item *item = NULL;
+ proto_tree *ie_tree = NULL;
guint8 ie_len;
tvbuff_t *ie_tvb;
- char *digit_str;
+ const char *digit_str;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_imesiv_ie, tvb, offset, ie_len+2, FALSE);
static int
dissect_bssap_imsi(tvbuff_t *tvb, proto_tree *tree, int offset)
{
- proto_item *item = NULL;
- proto_tree *ie_tree = NULL;
+ proto_item *item = NULL;
+ proto_tree *ie_tree = NULL;
guint8 ie_len;
tvbuff_t *ie_tvb;
- char *digit_str;
+ const char *digit_str;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_imsi_ie, tvb, offset, ie_len+2, FALSE);
static int
dissect_bssap_sgsn_number(tvbuff_t *tvb, proto_tree *tree, int offset)
{
- proto_item *item = NULL;
- proto_tree *ie_tree = NULL;
+ proto_item *item = NULL;
+ proto_tree *ie_tree = NULL;
guint8 ie_len;
tvbuff_t *number_tvb;
- char *digit_str;
+ const char *digit_str;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_sgsn_nr_ie, tvb, offset, ie_len+2, FALSE);
static int
dissect_bssap_vlr_number(tvbuff_t *tvb, proto_tree *tree, int offset)
{
- proto_item *item = NULL;
- proto_tree *ie_tree = NULL;
+ proto_item *item = NULL;
+ proto_tree *ie_tree = NULL;
guint8 ie_len;
tvbuff_t *number_tvb;
- char *digit_str;
+ const char *digit_str;
ie_len = tvb_get_guint8(tvb,offset+1);
item = proto_tree_add_item(tree, hf_bssap_vlr_number_ie, tvb, offset, ie_len+2, FALSE);
static void
decode_ie(bssgp_ie_t *ie, build_info_t *bi) {
int org_offset = bi->offset;
- const char *iename = val_to_str(ie->iei, tab_bssgp_ie_types, "Unknown");
- gboolean use_default_ie_name = (ie->name == NULL);
if (tvb_length_remaining(bi->tvb, bi->offset) < 1) {
/* TODO This code does not work well with omitted Optional elements
;
}
- if (use_default_ie_name) {
- ie->name = g_strdup(iename);
- }
-
switch (ie->iei) {
case BSSGP_IEI_ALIGNMENT_OCTETS:
decode_iei_alignment_octets(ie, bi, org_offset);
default:
;
}
- if (use_default_ie_name) {
- /* Memory has been allocated; free it */
- g_free( (gpointer) ie->name);
- ie->name = NULL;
- }
}
static void
}
}
-static void
-decode_pdu_dl_unitdata(build_info_t *bi) {
- bssgp_ie_t ies[] = {
+static bssgp_ie_t ies[] = {
{ BSSGP_IEI_TLLI, "TLLI (current)",
BSSGP_IE_PRESENCE_M, BSSGP_IE_FORMAT_V, BSSGP_UNKNOWN, 4 },
{ BSSGP_IEI_LLC_PDU, NULL,
BSSGP_IE_PRESENCE_M, BSSGP_IE_FORMAT_TLV, BSSGP_UNKNOWN, BSSGP_UNKNOWN},
- };
+};
+
+static void
+decode_pdu_dl_unitdata(build_info_t *bi) {
bi->dl_data = TRUE;
bi->ul_data = FALSE;
void
proto_register_bssgp(void)
{
+ size_t i;
static hf_register_info hf[] = {
{ &hf_bssgp_pdu_type,
{ "PDU Type", "bssgp.pdu_type",
&ett_bssgp_tmsi_ptmsi,
};
+ /* Fill in name field of the the IE table */
+ for (i = 0; i < (sizeof ies / sizeof ies[0]); i++) {
+ if (ies[i].name == NULL)
+ ies[i].name = match_strval(ies[i].iei, tab_bssgp_ie_types);
+ g_assert(ies[i].name != NULL);
+ }
+
/* Register the protocol name and description */
proto_bssgp = proto_register_protocol("Base Station Subsystem GPRS Protocol", "BSSGP", "bssgp");
gint g_offset, g_size;
gchar token[4];
gchar ch;
- char* mapping[128] = {
+ const char* mapping[128] = {
"_Oa","_L-", "", "_Y-", "_e`", "_e'", "_u`", "_i`", "_o`","_C,", /*10*/
"", "_O/", "_o/", "", "_A*", "_a*","_gd", "_--", "_gf", "_gg", "_gl", /*21*/
"_go", "_gp","_gi", "_gs", "_gt", "_gx", "_XX","_AE","_ae", "_ss","_E'", /*32*/
guint l = 0;
gint o;
- o = tvb_pbrk_guint8(tvb, offset, -1, (guint8*)" \t\r\n");
+ o = tvb_pbrk_guint8(tvb, offset, -1, (const guint8*)" \t\r\n");
if (o != -1) {
l = o - offset;
s = tvb_get_ptr(tvb, offset, l);
hf_samr_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
{
dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
- char *sn;
+ const char *sn;
/* ServerName */
dcv->private_data=NULL;
{
dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
- char *sn;
+ const char *sn;
/* ServerName */
dcv->private_data=NULL;
hf_samr_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
hf_samr_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
hf_samr_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
{
dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
- char *sid;
+ const char *sid;
offset = dissect_nt_policy_hnd(tvb, offset, pinfo, tree, drep,
hf_samr_hnd, NULL, NULL, FALSE, FALSE);
hf_samr_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
hf_samr_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
hf_samr_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
{
dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
- char *sn;
+ const char *sn;
/* ServerName */
dcv->private_data=NULL;
hf_samr_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
tvb, offset, pinfo, tree, drep, hf_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
tvb, offset, pinfo, tree, drep, hf_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
tvb, offset, pinfo, tree, drep, hf_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
{
dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
- char *mn, *dn;
+ const char *mn, *dn;
/* MachineName */
dcv->private_data=NULL;
tvb, offset, pinfo, tree, drep, hf_svcctl_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
{
dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
- char *mn, *dn;
+ const char *mn, *dn;
/* MachineName */
dcv->private_data=NULL;
tvb, offset, pinfo, tree, drep, hf_svcctl_rc, &status);
if( status == 0 ){
- char *pol_name;
+ const char *pol_name;
if (dcv->se_data){
pol_name = ep_strdup_printf(
static GHashTable *dcm_tagTable = NULL;
-dcmItem_t * lookupCtx(dcmState_t *dd, guint8 ctx);
+static dcmItem_t * lookupCtx(dcmState_t *dd, guint8 ctx);
static dcmTag_t tagData[] = {
{ 0x1, DCM_TRET, "(Ret) Length to End" },
}
}
-dcmItem_t *
+static dcmItem_t *
lookupCtx(dcmState_t *dd, guint8 ctx)
{
dcmItem_t *di = dd->first;
- static dcmItem_t dunk = { NULL, NULL, 0, -1,
- "not found - click on ASSOC Request",
- "not found - click on ASSOC Request", DCM_UNK };
+ static char notfound[] = "not found - click on ASSOC Request";
+ static dcmItem_t dunk = { NULL, NULL, 0, -1, notfound, notfound, DCM_UNK };
while (di) {
if (ctx == di->id)
break;
dcmState_t *dcm_data;
proto_tree *dcm_tree;
conversation_t *conv;
- char *buf=NULL;
+ char *buf;
+ const char *info_str = NULL;
int offset = 0;
if (NULL == (conv = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
buf = ep_alloc(128);
g_snprintf(buf, 128, "DCM ASSOC Request %s <-- %s",
dcm_data->orig, dcm_data->targ);
+ info_str = buf;
offset = 74;
break;
case 2: /* ASSOC Accept */
buf = ep_alloc(128);
g_snprintf(buf, 128, "DCM ASSOC Accept %s <-- %s (%s)",
dcm_data->orig, dcm_data->targ, dcm_data->resp);
+ info_str = buf;
offset = 74;
break;
case 3: /* ASSOC Reject */
dcm_result2str(dcm_data->result),
dcm_source2str(dcm_data->source),
dcm_reason2str(dcm_data->source, dcm_data->reason));
+ info_str = buf;
offset = 10;
break;
case 4: /* DATA */
offset = 6;
- buf="DCM Data";
+ info_str="DCM Data";
break;
case 5: /* RELEASE Request */
- buf="DCM RELEASE Request";
+ info_str="DCM RELEASE Request";
offset = 6;
break;
case 6: /* RELEASE Response */
- buf="DCM RELEASE Response";
+ info_str="DCM RELEASE Response";
offset = 6;
break;
case 7: /* ABORT */
(dcm_data->source == 1) ? "USER" :
(dcm_data->source == 2) ? "PROVIDER" : "",
dcm_data->source == 1 ? dcm_abort2str(dcm_data->reason) : "");
+ info_str = buf;
break;
default:
- buf="DCM Continuation";
+ info_str="DCM Continuation";
offset = -1; /* cannot continue parsing */
break;
}
if (check_col(pinfo->cinfo, COL_INFO))
- col_set_str(pinfo->cinfo, COL_INFO, buf);
+ col_set_str(pinfo->cinfo, COL_INFO, info_str);
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
case 5: /* RELEASE Request */
case 6: /* RELEASE Response */
case 7: /* ABORT */
- tf = proto_tree_add_string(dcm_tree, hf_dcm_pdu_type, tvb, 0, dcm_data->tlen, buf);
+ tf = proto_tree_add_string(dcm_tree, hf_dcm_pdu_type, tvb, 0, dcm_data->tlen, info_str);
dissect_dcm_assoc(dcm_data, tf, tvb, offset);
break;
case 4: /* DATA */
- tf = proto_tree_add_string(dcm_tree, hf_dcm_pdu_type, tvb, 0, dcm_data->tlen, buf);
+ tf = proto_tree_add_string(dcm_tree, hf_dcm_pdu_type, tvb, 0, dcm_data->tlen, info_str);
dissect_dcm_data(dcm_data, tf, tvb);
break;
default:
/* create new machine if not found */
if(dcom_iter == NULL) {
machine = se_alloc(sizeof(dcom_machine_t));
- memcpy( (void *) (machine->ip), ip, 4);
+ memcpy(machine->ip, ip, 4);
machine->objects = NULL;
machine->first_packet = pinfo->fd->num;
dcom_machines = g_list_append(dcom_machines, machine);
GList *objects;
gint first_packet;
- const guint8 ip[4];
+ guint8 ip[4];
} dcom_machine_t;
typedef struct dcom_object_s {
int BadPacket = FALSE;
guint32 commandCode=0, pktLength=0;
guint8 version=0, flags=0;
- gchar *flagstr="<None>";
+ const gchar *flagstr="<None>";
const gchar *fstr[] = {"RSVD7", "RSVD6", "RSVD5", "RSVD4", "RSVD3", "Error", "Proxyable", "Request" };
- gchar *commandString=NULL, *vendorName=NULL, *applicationName=NULL, *commandStringType=NULL;
+ const gchar *commandString=NULL, *vendorName=NULL, *applicationName=NULL, *commandStringType=NULL;
gint i;
guint bpos;
static int initialized=FALSE;
/* Set up our flags */
if (check_col(pinfo->cinfo, COL_INFO) || tree) {
+ char *flagbuf;
int fslen;
#define FLAG_STR_LEN 64
- flagstr=ep_alloc(FLAG_STR_LEN);
- flagstr[0]=0;
+ flagbuf=ep_alloc(FLAG_STR_LEN);
+ flagbuf[0]=0;
fslen=0;
for (i = 0; i < 8; i++) {
bpos = 1 << i;
if (flags & bpos) {
- if (flagstr[0]) {
+ if (flagbuf[0]) {
fslen+=MIN(FLAG_STR_LEN-fslen,
- g_snprintf(flagstr+fslen, FLAG_STR_LEN-fslen, ", "));
+ g_snprintf(flagbuf+fslen, FLAG_STR_LEN-fslen, ", "));
}
fslen+=MIN(FLAG_STR_LEN-fslen,
- g_snprintf(flagstr+fslen, FLAG_STR_LEN-fslen, "%s", fstr[i]));
+ g_snprintf(flagbuf+fslen, FLAG_STR_LEN-fslen, "%s", fstr[i]));
}
}
+ flagstr = flagbuf;
if (flagstr[0] == 0) {
flagstr="<None>";
}
const gchar *avpNameString;
const gchar *valstr;
guint32 vendorId=0;
- gchar *vendorName;
+ const gchar *vendorName;
int hdrLength;
int fixAmt;
proto_tree *avpi_tree;
gint32 packetLength;
size_t avpDataLength;
int avpType;
- gchar *flagstr="<None>";
+ const gchar *flagstr="<None>";
const gchar *fstr[] = {"RSVD7", "RSVD6", "RSVD5", "RSVD4", "RSVD3", "Protected", "Mandatory", "Vendor-Specific" };
gint i;
guint bpos;
/* Set up our flags string */
if (check_col(pinfo->cinfo, COL_INFO) || avp_tree) {
+ char *flagbuf;
int fslen;
#define FLAG_STR_LEN 64
- flagstr=ep_alloc(FLAG_STR_LEN);
- flagstr[0]=0;
+ flagbuf=ep_alloc(FLAG_STR_LEN);
+ flagbuf[0]=0;
fslen=0;
for (i = 0; i < 8; i++) {
bpos = 1 << i;
if (flags & bpos) {
- if (flagstr[0]) {
+ if (flagbuf[0]) {
fslen+=MIN(FLAG_STR_LEN-fslen,
- g_snprintf(flagstr+fslen, FLAG_STR_LEN-fslen, ", "));
+ g_snprintf(flagbuf+fslen, FLAG_STR_LEN-fslen, ", "));
}
fslen+=MIN(FLAG_STR_LEN-fslen,
- g_snprintf(flagstr+fslen, FLAG_STR_LEN-fslen, "%s", fstr[i]));
+ g_snprintf(flagbuf+fslen, FLAG_STR_LEN-fslen, "%s", fstr[i]));
}
}
+ flagstr = flagbuf;
if (flagstr[0] == 0) {
flagstr="<None>";
}
*/
int
get_dns_name(tvbuff_t *tvb, int offset, int dns_data_offset,
- char **name)
+ const char **name)
{
int start_offset = offset;
char *np;
* to put the dissector into a loop. Instead we throw an exception */
maxname=MAXDNAME;
- *name=ep_alloc(maxname);
- np=*name;
+ np=ep_alloc(maxname);
+ *name=np;
maxname--; /* reserve space for the trailing '\0' */
for (;;) {
static int
get_dns_name_type_class(tvbuff_t *tvb, int offset, int dns_data_offset,
- char **name_ret, int *name_len_ret, int *type_ret, int *class_ret)
+ const char **name_ret, int *name_len_ret, int *type_ret, int *class_ret)
{
int len;
int name_len;
column_info *cinfo, proto_tree *dns_tree, gboolean is_mdns)
{
int len;
- char *name;
+ const char *name;
char *name_out;
int name_len;
int type;
gboolean is_mdns)
{
int len;
- char *name;
+ const char *name;
char *name_out;
int name_len;
int type;
case T_NS:
{
- char *ns_name;
+ const char *ns_name;
int ns_name_len;
ns_name_len = get_dns_name(tvb, cur_offset, dns_data_offset, &ns_name);
case T_CNAME:
{
- char *cname;
+ const char *cname;
int cname_len;
cname_len = get_dns_name(tvb, cur_offset, dns_data_offset, &cname);
case T_SOA:
{
- char *mname;
+ const char *mname;
int mname_len;
- char *rname;
+ const char *rname;
int rname_len;
guint32 serial;
guint32 refresh;
case T_PTR:
{
- char *pname;
+ const char *pname;
int pname_len;
pname_len = get_dns_name(tvb, cur_offset, dns_data_offset, &pname);
case T_MX:
{
guint16 preference = 0;
- char *mx_name;
+ const char *mx_name;
int mx_name_len;
preference = tvb_get_ntohs(tvb, cur_offset);
int rr_len = data_len;
guint16 type_covered;
nstime_t nstime;
- char *signer_name;
+ const char *signer_name;
int signer_name_len;
if (dns_tree != NULL) {
int rr_len = data_len;
guint8 gw_type, algo;
const guint8 *addr;
- char *gw;
+ const char *gw;
int gw_name_len;
static const value_string gw_algo[] = {
{ 1, "DSA" },
unsigned short pre_len;
unsigned short suf_len;
unsigned short suf_octet_count;
- char *pname;
+ const char *pname;
int pname_len;
int a6_offset;
int suf_offset;
case T_DNAME:
{
- char *dname;
+ const char *dname;
int dname_len;
dname_len = get_dns_name(tvb, cur_offset, dns_data_offset,
case T_NSEC:
{
int rr_len = data_len;
- char *next_domain_name;
+ const char *next_domain_name;
int next_domain_name_len;
int rr_type;
guint8 bits;
case T_NXT:
{
int rr_len = data_len;
- char *next_domain_name;
+ const char *next_domain_name;
int next_domain_name_len;
int rr_type;
guint8 bits;
case T_KX:
{
guint16 preference = 0;
- char *kx_name;
+ const char *kx_name;
int kx_name_len;
preference = tvb_get_ntohs(tvb, cur_offset);
case T_TKEY:
{
- char *tkey_algname;
+ const char *tkey_algname;
int tkey_algname_len;
guint16 tkey_mode, tkey_error, tkey_keylen, tkey_otherlen;
int rr_len = data_len;
{
guint16 tsig_error, tsig_timehi, tsig_siglen, tsig_otherlen;
guint32 tsig_timelo;
- char *tsig_raw_algname, *tsig_algname;
+ const char *tsig_raw_algname;
+ char *tsig_algname;
int tsig_algname_len;
nstime_t nstime;
int rr_len = data_len;
guint32 local_flag;
guint32 lookup_timeout;
guint32 cache_timeout;
- char *dname;
+ const char *dname;
int dname_len;
if (rr_len < 4)
guint16 priority = 0;
guint16 weight = 0;
guint16 port = 0;
- char *target;
+ const char *target;
int target_len;
priority = tvb_get_ntohs(tvb, cur_offset);
const char *dns_class_name(int class);
-int get_dns_name(tvbuff_t *, int, int, char **);
+int get_dns_name(tvbuff_t *, int, int, const char **);
#define MAXDNAME 1025 /* maximum domain name length */
tmp2_length = ( length * 2 ) + 1;
}
- tmp = (char *)tvb_get_ptr( tvb, start, tmp_length );
+ tmp = (const char *)tvb_get_ptr( tvb, start, tmp_length );
tmp2 = (char *)ep_alloc( tmp2_length );
tmp2start = tmp2;
{
int packet_type;
guint16 encap_cmd, encap_data_length;
- char *pkt_type_str = "";
+ const char *pkt_type_str = "";
guint32 ifacehndl;
/* Set up structures needed to add the protocol subtree and manage it */
/* Set up structures needed to add the protocol subtree and manage it */
int offset = 0;
- gchar *flags;
+ const gchar *flags;
fcswils_elp elp;
/* Response i.e. SW_ACC for an ELP has the same format as the request */
flags="";
if (elp.cls1_svcparm[0] & 0x80) {
#define MAX_FLAGS_LEN 40
+ char *flagsbuf;
size_t stroff, returned_length;
- flags=ep_alloc(MAX_FLAGS_LEN);
+ flagsbuf=ep_alloc(MAX_FLAGS_LEN);
stroff = 0;
- flags[stroff]=0;
+ flagsbuf[stroff]=0;
- returned_length = g_snprintf (flags+stroff, MAX_FLAGS_LEN-stroff,
+ returned_length = g_snprintf (flagsbuf+stroff, MAX_FLAGS_LEN-stroff,
"Class 1 Valid");
stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
if (elp.cls1_svcparm[0] & 0x40) {
- returned_length = g_snprintf (flags+stroff, MAX_FLAGS_LEN-stroff, " | IMX");
+ returned_length = g_snprintf (flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IMX");
stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
}
if (elp.cls1_svcparm[0] & 0x20) {
- returned_length = g_snprintf (flags+stroff, MAX_FLAGS_LEN-stroff, " | IPS");
+ returned_length = g_snprintf (flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IPS");
stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
}
if (elp.cls1_svcparm[0] & 0x10) {
- returned_length = g_snprintf (flags+stroff, MAX_FLAGS_LEN-stroff, " | LKS");
+ returned_length = g_snprintf (flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | LKS");
stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
}
+ flags=flagsbuf;
}
else {
flags="Class 1 Invalid";
g_datalist_set_data(&msg_types, "BE", "User Request");
g_datalist_set_data(&msg_types, "BF", "User Response");
g_datalist_set_data(&msg_types, "BG", "Collateral Inquiry Ack");
- g_datalist_set_data(&msg_types, "BH", "Confirmation Request");
+ g_datalist_set_data(&msg_types, "BH", (gpointer)(void *)"Confirmation Request");
}
unsigned int j;
int i, n, l, p;
guint16 flags;
- char *dname;
+ const char *dname;
guint32 ipaddr;
ni = &icmp6_nodeinfo;
}
static int msg_stats_tree_packet(stats_tree *st , packet_info *pinfo, epan_dissect_t *edt _U_, const void *p ) {
- const gchar* msg = match_strval(((isup_tap_rec_t*)p)->message_type, isup_message_type_value_acro);
+ const gchar* msg = match_strval(((const isup_tap_rec_t*)p)->message_type, isup_message_type_value_acro);
gchar src[MAX_ADDR_STR_LEN];
gchar dst[MAX_ADDR_STR_LEN];
gchar dir[MAX_ADDR_STR_LEN];
call_dissector(sub_handle, tvb, pinfo, tree);
}
-static void k12_update_cb(void* r, char** err) {
+static void k12_update_cb(void* r, const char** err) {
k12_handles_t* h = r;
gchar** protos;
guint num_protos, i;
}
-static gboolean protos_chk_cb(void* r _U_, const char* p, unsigned len, void* u1 _U_, void* u2 _U_, char** err) {
+static gboolean protos_chk_cb(void* r _U_, const char* p, unsigned len, void* u1 _U_, void* u2 _U_, const char** err) {
gchar** protos;
gchar* line = ep_strndup(p,len);
guint num_protos, i;
char *name_ret, int name_ret_len, int *name_type_ret)
{
int name_len;
- char *name;
+ const char *name;
char *nbname;
- char *pname, cname, cnbname;
+ const char *pname;
+ char cname, cnbname;
int name_type;
char *pname_ret;
size_t index = 0;
const mtp3_addr_pc_t* dpc;
const mtp3_addr_pc_t* opc;
- if (trace_sccp && assoc && assoc != &no_assoc) {
- pinfo->sccp_info = assoc->curr_msg;
- } else {
- pinfo->sccp_info = NULL;
- }
+ if (trace_sccp && assoc && assoc != &no_assoc) {
+ pinfo->sccp_info = assoc->curr_msg;
+ } else {
+ pinfo->sccp_info = NULL;
+ }
- switch (pinfo->p2p_dir) {
- case P2P_DIR_SENT:
- ssn = assoc->calling_ssn;
- dpc = (mtp3_addr_pc_t*)pinfo->dst.data;
- opc = (mtp3_addr_pc_t*)pinfo->src.data;
- break;
- case P2P_DIR_RECV:
- ssn = assoc->called_ssn;
- dpc = (mtp3_addr_pc_t*)pinfo->src.data;
- opc = (mtp3_addr_pc_t*)pinfo->dst.data;
- break;
- default:
- ssn = assoc->called_ssn;
- other_ssn = assoc->calling_ssn;
- dpc = (mtp3_addr_pc_t*)pinfo->dst.data;
- opc = (mtp3_addr_pc_t*)pinfo->src.data;
- break;
- }
+ switch (pinfo->p2p_dir) {
+ case P2P_DIR_SENT:
+ ssn = assoc->calling_ssn;
+ dpc = (const mtp3_addr_pc_t*)pinfo->dst.data;
+ opc = (const mtp3_addr_pc_t*)pinfo->src.data;
+ break;
+ case P2P_DIR_RECV:
+ ssn = assoc->called_ssn;
+ dpc = (const mtp3_addr_pc_t*)pinfo->src.data;
+ opc = (const mtp3_addr_pc_t*)pinfo->dst.data;
+ break;
+ default:
+ ssn = assoc->called_ssn;
+ other_ssn = assoc->calling_ssn;
+ dpc = (const mtp3_addr_pc_t*)pinfo->dst.data;
+ opc = (const mtp3_addr_pc_t*)pinfo->src.data;
+ break;
+ }
if (num_sccp_users && pinfo->src.type == AT_SS7PC) {
{0,FALSE,NULL}
};
-static void sccp_users_update_cb(void* r, char** err _U_) {
+static void sccp_users_update_cb(void* r, const char** err _U_) {
sccp_user_t* u = r;
struct _sccp_ul* c;
typedef struct _attribute_page_numbers_t {
guint32 number;
- char *name;
+ const char *name;
attribute_dissector dissector;
} attribute_page_numbers_t;
static const attribute_page_numbers_t user_object_info_attributes[] = {
if (ue->engine.data) g_free(ue->engine.data);
}
-static void snmp_users_update_cb(void* p _U_, char** err) {
+static void snmp_users_update_cb(void* p _U_, const char** err) {
snmp_ue_assoc_t* ue = p;
GString* es = g_string_new("");
ssl_hash (gconstpointer v)
{
guint l,hash;
- StringInfo* id;
- guint* cur;
+ const StringInfo* id;
+ const guint* cur;
hash = 0;
- id = (StringInfo*) v;
- cur = (guint*) id->data;
+ id = (const StringInfo*) v;
+ cur = (const guint*) id->data;
for (l=4; (l<id->data_len); l+=4, cur++)
hash = hash ^ (*cur);
{
const SslService *key;
guint l, hash, len ;
- guint* cur;
+ const guint* cur;
key = (const SslService *)v;
hash = key->port;
len = key->addr.len;
- cur = (guint*) key->addr.data;
+ cur = (const guint*) key->addr.data;
for (l=4; (l<len); l+=4, cur++)
hash = hash ^ (*cur);
}
}
-static void user_update_cb(void* r _U_, char** err _U_) {
+static void user_update_cb(void* r _U_, const char** err _U_) {
}
UAT_VS_DEF(user_encap, encap, user_encap_t, WTAP_ENCAP_USER0, ENCAP0_STR)
emem_tree_t *se_trees=NULL;
emem_tree_t *
-se_tree_create(int type, char *name)
+se_tree_create(int type, const char *name)
{
emem_tree_t *tree_list;
* never existed including all metadata associated with the tree.
*/
emem_tree_t *
-se_tree_create_non_persistent(int type, char *name)
+se_tree_create_non_persistent(int type, const char *name)
{
emem_tree_t *tree_list;
typedef struct _emem_tree_t {
struct _emem_tree_t *next;
int type;
- char *name; /* just a string to make debugging easier */
+ const char *name; /* just a string to make debugging easier */
emem_tree_node_t *tree;
void *(*malloc)(size_t);
} emem_tree_t;
*
* type is : EMEM_TREE_TYPE_RED_BLACK for a standard red/black tree.
*/
-emem_tree_t *se_tree_create(int type, char *name);
+emem_tree_t *se_tree_create(int type, const char *name);
/* This function is similar to the se_tree_create() call but with the
* difference that when the se memory is release everything including the
* another structure that is also se allocated so that when the structure is
* released, the tree will be completely released as well.
*/
-emem_tree_t *se_tree_create_non_persistent(int type, char *name);
+emem_tree_t *se_tree_create_non_persistent(int type, const char *name);
/* se_tree_insert32
* Insert data into the tree and key it by a 32bit integer value
void (*retap_packets)(void);
void (*copy_to_clipboard)(GString *str);
void (*set_filter)(const char*);
- gboolean (*open_file)(const char* fname, const char* filter, char** error);
+ gboolean (*open_file)(const char* fname, const char* filter, const char** error);
void (*reload)(void);
void (*apply_filter)(void);
gboolean (*browser_open_url)(const gchar *url);
gpointer caller_data;
DATFunc caller_func;
GHFunc next_func;
- gchar *table_name;
+ const gchar *table_name;
ftenum_t selector_type;
} dissector_foreach_info_t;
* on each entry.
*/
void
-dissector_table_foreach (char *name,
+dissector_table_foreach (const char *name,
DATFunc func,
gpointer user_data)
{
* any entry that has been changed from its original state.
*/
void
-dissector_table_foreach_changed (char *name,
+dissector_table_foreach_changed (const char *name,
DATFunc func,
gpointer user_data)
{
typedef gboolean (*heur_dissector_t)(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree);
-typedef void (*DATFunc) (gchar *table_name, ftenum_t selector_type,
+typedef void (*DATFunc) (const gchar *table_name, ftenum_t selector_type,
gpointer key, gpointer value, gpointer user_data);
typedef void (*DATFunc_handle) (const gchar *table_name, gpointer value,
gpointer user_data);
-typedef void (*DATFunc_table) (gchar *table_name, const gchar *ui_name,
+typedef void (*DATFunc_table) (const gchar *table_name, const gchar *ui_name,
gpointer user_data);
/* Opaque structure - provides type checking but no access to components */
extern dissector_handle_t dtbl_entry_get_handle (dtbl_entry_t *dtbl_entry);
extern dissector_handle_t dtbl_entry_get_initial_handle (dtbl_entry_t * entry);
-extern void dissector_table_foreach_changed (char *name, DATFunc func,
+extern void dissector_table_foreach_changed (const char *name, DATFunc func,
gpointer user_data);
-extern void dissector_table_foreach (char *name, DATFunc func,
+extern void dissector_table_foreach (const char *name, DATFunc func,
gpointer user_data);
extern void dissector_all_tables_foreach_changed (DATFunc func,
gpointer user_data);
* in that case, -1 will be returned if the boundary is reached before
* finding needle. */
gint
-tvb_pbrk_guint8(tvbuff_t *tvb, gint offset, gint maxlength, guint8 *needles)
+tvb_pbrk_guint8(tvbuff_t *tvb, gint offset, gint maxlength, const guint8 *needles)
{
const guint8 *result;
guint abs_offset, junk_length;
/*
* Look either for a CR or an LF.
*/
- eol_offset = tvb_pbrk_guint8(tvb, offset, len, (guint8 *)"\r\n");
+ eol_offset = tvb_pbrk_guint8(tvb, offset, len, (const guint8 *)"\r\n");
if (eol_offset == -1) {
/*
* No CR or LF - line is presumably continued in next packet.
* Look either for a CR, an LF, or a '"'.
*/
char_offset = tvb_pbrk_guint8(tvb, cur_offset, len,
- (guint8 *)"\r\n\"");
+ (const guint8 *)"\r\n\"");
}
if (char_offset == -1) {
/*
* maxlength exceeds boundary of tvbuff; in that case, -1 will be returned if
* the boundary is reached before finding needle. */
extern gint tvb_pbrk_guint8(tvbuff_t *, gint offset, gint maxlength,
- guint8 *needles);
+ const guint8 *needles);
/** Find size of stringz (NUL-terminated string) by looking for terminating
* NUL. The size of the string includes the terminating NUL.
} fld_data_t;
struct _uat_t {
- char* name;
+ const char* name;
size_t record_size;
- char* filename;
- char* help;
- char* category;
+ const char* filename;
+ const char* help;
+ const char* category;
void** user_ptr;
guint* nrows_p;
uat_copy_cb_t copy_cb;
uat_t* uat_new(const char* name,
size_t size,
- char* filename,
+ const char* filename,
void** data_ptr,
guint* numitems_ptr,
- char* category,
- char* help,
+ const char* category,
+ const char* help,
uat_copy_cb_t copy_cb,
uat_update_cb_t update_cb,
uat_free_cb_t free_cb,
static void putfld(FILE* fp, void* rec, uat_field_t* f) {
guint fld_len;
- char* fld_ptr;
+ const char* fld_ptr;
f->cb.tostr(rec,&fld_ptr,&fld_len,f->cbdata.tostr,f->fld_data);
}
-gboolean uat_fld_chk_str(void* u1 _U_, const char* strptr, unsigned len _U_, void* u2 _U_, void* u3 _U_, char** err) {
+gboolean uat_fld_chk_str(void* u1 _U_, const char* strptr, unsigned len _U_, void* u2 _U_, void* u3 _U_, const char** err) {
if (strptr == NULL) {
*err = "NULL pointer";
return FALSE;
return TRUE;
}
-gboolean uat_fld_chk_proto(void* u1 _U_, const char* strptr, unsigned len, void* u2 _U_, void* u3 _U_, char** err) {
+gboolean uat_fld_chk_proto(void* u1 _U_, const char* strptr, unsigned len, void* u2 _U_, void* u3 _U_, const char** err) {
if (len) {
char* name = ep_strndup(strptr,len);
g_strdown(name);
}
}
-gboolean uat_fld_chk_num_dec(void* u1 _U_, const char* strptr, unsigned len, void* u2 _U_, void* u3 _U_, char** err) {
+gboolean uat_fld_chk_num_dec(void* u1 _U_, const char* strptr, unsigned len, void* u2 _U_, void* u3 _U_, const char** err) {
char* str = ep_strndup(strptr,len);
long i = strtol(str,&str,10);
return TRUE;
}
-gboolean uat_fld_chk_num_hex(void* u1 _U_, const char* strptr, unsigned len, void* u2 _U_, void* u3 _U_, char** err) {
+gboolean uat_fld_chk_num_hex(void* u1 _U_, const char* strptr, unsigned len, void* u2 _U_, void* u3 _U_, const char** err) {
char* str = ep_strndup(strptr,len);
long i = strtol(str,&str,16);
return TRUE;
}
-gboolean uat_fld_chk_enum(void* u1 _U_, const char* strptr, unsigned len, void* v, void* u3 _U_, char** err) {
+gboolean uat_fld_chk_enum(void* u1 _U_, const char* strptr, unsigned len, void* v, void* u3 _U_, const char** err) {
char* str = ep_strndup(strptr,len);
guint i;
value_string* vs = v;
return FALSE;
}
-gboolean uat_fld_chk_range(void* u1 _U_, const char* strptr, unsigned len, void* v _U_, void* u3, char** err) {
+gboolean uat_fld_chk_range(void* u1 _U_, const char* strptr, unsigned len, void* v _U_, void* u3, const char** err) {
char* str = ep_strndup(strptr,len);
range_t* r = NULL;
convert_ret_t ret = range_convert_str(&r, str,GPOINTER_TO_UINT(u3));
* optional, record will be updated always if not given
* update(record,&error)
*/
-typedef void (*uat_update_cb_t)(void* , char** );
+typedef void (*uat_update_cb_t)(void* , const char** );
/*******
* optional, if not given any input is considered OK and the set cb will be called
* chk(record, ptr, len, chk_data, fld_data, &error)
*/
-typedef gboolean (*uat_fld_chk_cb_t)(void*, const char*, unsigned, void*, void*, char**);
+typedef gboolean (*uat_fld_chk_cb_t)(void*, const char*, unsigned, void*, void*, const char**);
/*
* Set Field CB
* mandatory
* tostr(record, &out_ptr, &out_len, tostr_data, fld_data)
*/
-typedef void (*uat_fld_tostr_cb_t)(void*, char**, unsigned*, void*, void*);
+typedef void (*uat_fld_tostr_cb_t)(void*, const char**, unsigned*, void*, void*);
/***********
* Text Mode
void* fld_data;
- char* desc;
+ const char* desc;
struct _fld_data_t* priv;
} uat_field_t;
*/
uat_t* uat_new(const char* name,
size_t size,
- char* filename,
+ const char* filename,
void** data_ptr,
guint* num_items,
- char* category,
- char* help,
+ const char* category,
+ const char* help,
uat_copy_cb_t copy_cb,
uat_update_cb_t update_cb,
uat_free_cb_t free_cb,
/*
* Some common uat_fld_chk_cbs
*/
-gboolean uat_fld_chk_str(void*, const char*, unsigned, void*,void*, char** err);
-gboolean uat_fld_chk_proto(void*, const char*, unsigned, void*,void*, char** err);
-gboolean uat_fld_chk_num_dec(void*, const char*, unsigned, void*, void*, char** err);
-gboolean uat_fld_chk_num_hex(void*, const char*, unsigned, void*, void*, char** err);
-gboolean uat_fld_chk_enum(void*, const char*, unsigned, void*, void*, char**);
-gboolean uat_fld_chk_range(void*, const char*, unsigned, void*, void*, char**);
+gboolean uat_fld_chk_str(void*, const char*, unsigned, void*,void*, const char** err);
+gboolean uat_fld_chk_proto(void*, const char*, unsigned, void*,void*, const char** err);
+gboolean uat_fld_chk_num_dec(void*, const char*, unsigned, void*, void*, const char** err);
+gboolean uat_fld_chk_num_hex(void*, const char*, unsigned, void*, void*, const char** err);
+gboolean uat_fld_chk_enum(void*, const char*, unsigned, void*, void*, const char**);
+gboolean uat_fld_chk_range(void*, const char*, unsigned, void*, void*, const char**);
#define CHK_STR_IS_DECL(what) \
-gboolean uat_fld_chk_str_ ## what (void*, const char*, unsigned, void*, void*, char**)
+gboolean uat_fld_chk_str_ ## what (void*, const char*, unsigned, void*, void*, const char**)
typedef void (*uat_cb_t)(void* uat,void* user_data);
void uat_foreach_table(uat_cb_t cb,void* user_data);
CHK_STR_IS_DECL(isxdigit);
#define CHK_STR_IS_DEF(what) \
-gboolean uat_fld_chk_str_ ## what (void* u1 _U_, const char* strptr, unsigned len, void* u2 _U_, void* u3 _U_, char** err) { \
+gboolean uat_fld_chk_str_ ## what (void* u1 _U_, const char* strptr, unsigned len, void* u2 _U_, void* u3 _U_, const char** err) { \
guint i; for (i=0;i<len;i++) { \
char c = strptr[i]; \
if (! what((int)c)) { \
static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, void* u1 _U_, void* u2 _U_) {\
if ((((rec_t*)rec)->field_name)) g_free((((rec_t*)rec)->field_name)); \
(((rec_t*)rec)->field_name) = g_strndup(buf,len); } \
-static void basename ## _ ## field_name ## _tostr_cb(void* rec, char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
+static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
if (((rec_t*)rec)->field_name ) { \
*out_ptr = (((rec_t*)rec)->field_name); *out_len = strlen((((rec_t*)rec)->field_name)); \
} else { \
static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, void* u1 _U_, void* u2 _U_) {\
if ((((rec_t*)rec)->ptr_element)) g_free((((rec_t*)rec)->ptr_element)); \
(((rec_t*)rec)->ptr_element) = uat_unesc(buf,len,&(((rec_t*)rec)->len_element)); }\
-static void basename ## _ ## field_name ## _tostr_cb(void* rec, char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
+static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
if (((rec_t*)rec)->ptr_element ) { \
*out_ptr = uat_esc(((rec_t*)rec)->ptr_element, (((rec_t*)rec)->len_element)); \
*out_len = strlen(*out_ptr); \
if ((((rec_t*)rec)->ptr_element) ) g_free((((rec_t*)rec)->ptr_element)); \
(((rec_t*)rec)->ptr_element) = len ? g_memdup(buf,len) : NULL; \
(((rec_t*)rec)->len_element) = len; } \
-static void basename ## _ ## field_name ## _tostr_cb(void* rec, char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
+static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
*out_ptr = ((rec_t*)rec)->ptr_element ? ep_memdup(((rec_t*)rec)->ptr_element,((rec_t*)rec)->len_element) : ""; \
*out_len = ((rec_t*)rec)->len_element; }
#define UAT_DEC_CB_DEF(basename,field_name,rec_t) \
static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, void* u1 _U_, void* u2 _U_) {\
((rec_t*)rec)->field_name = strtol(ep_strndup(buf,len),NULL,10); } \
-static void basename ## _ ## field_name ## _tostr_cb(void* rec, char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
+static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
*out_ptr = ep_strdup_printf("%d",((rec_t*)rec)->field_name); \
*out_len = strlen(*out_ptr); }
#define UAT_HEX_CB_DEF(basename,field_name,rec_t) \
static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, void* u1 _U_, void* u2 _U_) {\
((rec_t*)rec)->field_name = strtol(ep_strndup(buf,len),NULL,16); } \
-static void basename ## _ ## field_name ## _tostr_cb(void* rec, char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
+static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
*out_ptr = ep_strdup_printf("%x",((rec_t*)rec)->field_name); \
*out_len = strlen(*out_ptr); }
for(i=0; ( cstr = ((value_string*)vs)[i].strptr ) ;i++) { \
if (g_str_equal(cstr,str)) { \
((rec_t*)rec)->field_name = ((value_string*)vs)[i].value; return; } } } \
-static void basename ## _ ## field_name ## _tostr_cb(void* rec, char** out_ptr, unsigned* out_len, void* vs, void* u2 _U_) {\
+static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, void* vs, void* u2 _U_) {\
guint i; \
*out_ptr = ep_strdup(default_str); *out_len = strlen(default_str);\
for(i=0;((value_string*)vs)[i].strptr;i++) { \
char* name = ep_strndup(buf,len); g_strdown(name); g_strchug(name); \
((rec_t*)rec)->field_name = find_dissector(name); \
} else { ((rec_t*)rec)->field_name = find_dissector("data"); } } \
-static void basename ## _ ## field_name ## _tostr_cb(void* rec, char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
+static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
if ( ((rec_t*)rec)->field_name ) { \
- *out_ptr = ep_strdup(dissector_handle_get_short_name(((rec_t*)rec)->field_name)); g_strdown(*out_ptr); \
+ char *name = ep_strdup(dissector_handle_get_short_name(((rec_t*)rec)->field_name)); g_strdown(name); *out_ptr = name; \
*out_len = strlen(*out_ptr); \
} else { \
*out_ptr = ""; *out_len = 0; } }
char* rng = ep_strndup(buf,len);\
range_convert_str(&(((rec_t*)rec)->field_name), rng,GPOINTER_TO_UINT(u2)); \
} \
-static void basename ## _ ## field_name ## _tostr_cb(void* rec, char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
+static void basename ## _ ## field_name ## _tostr_cb(void* rec, const char** out_ptr, unsigned* out_len, void* u1 _U_, void* u2 _U_) {\
if ( ((rec_t*)rec)->field_name ) { \
*out_ptr = range_convert_range(((rec_t*)rec)->field_name); *out_len = strlen(*out_ptr); \
} else { \
#define ERROR(fmtd) do { error = ep_strdup_printf("%s:%d: %s",uat->filename,linenum,ep_strdup_printf fmtd); yyterminate(); } while(0)
#define SET_FIELD() \
- { gchar* err; \
+ { const gchar* err; \
if (uat->fields[colnum].cb.chk) { \
if ( ! uat->fields[colnum].cb.chk(record, ptr, len, uat->fields[colnum].cbdata.chk, uat->fields[colnum].fld_data, &err) ) { \
ERROR(("%s",err)); \
}\
uat->fields[colnum].cb.set(record, ptr, len, uat->fields[colnum].cbdata.chk, uat->fields[colnum].fld_data);\
g_free(ptr);\
- colnum++; \
+ colnum++; \
} while(0)
#ifdef DEBUG_UAT_LOAD
<END_OF_RECORD>{newline} {
void* rec;
- gchar* err = NULL;
+ const gchar* err = NULL;
linenum++;
xmlNodePtr (*xmlDocGetRootElement)(xmlDocPtr);
void (*xmlFreeDoc)(xmlDocPtr);
char *(*xmlNodeListGetString)(xmlDocPtr, xmlNodePtr, int);
- char *(*xmlGetProp)(xmlNodePtr, char *);
+ char *(*xmlGetProp)(xmlNodePtr, const char *);
int (*xmlKeepBlanksDefault)(int);
int (*xmlSubstituteEntitiesDefault)(int);
#ifdef WIRESHARK_XML_DO_VALIDITY_CHECKING
* @param user_data Unused.
*/
static void
-decode_build_reset_list (gchar *table_name, ftenum_t selector_type,
+decode_build_reset_list (const gchar *table_name, ftenum_t selector_type,
gpointer key, gpointer value _U_,
gpointer user_data _U_)
{
* should be stored.
*/
static void
-decode_build_show_list (gchar *table_name, ftenum_t selector_type,
+decode_build_show_list (const gchar *table_name, ftenum_t selector_type,
gpointer key, gpointer value, gpointer user_data)
{
dissector_handle_t current, initial;
cf_retap_packets(&cfile, FALSE);
}
-static gboolean funnel_open_file(const char* fname, const char* filter, char** err_str) {
+static gboolean funnel_open_file(const char* fname, const char* filter, const char** err_str) {
int err = 0;
dfilter_t *rfcode = NULL;
static char* fld_tostr(void* rec, uat_field_t* f) {
guint len;
- char* ptr;
+ const char* ptr;
char* out;
f->cb.tostr(rec,&ptr,&len,f->cbdata.tostr,f->fld_data);
}
-static guint8* unhexbytes(const char* si, guint len, guint* len_p, char** err) {
+static guint8* unhexbytes(const char* si, guint len, guint* len_p, const char** err) {
guint8* buf;
guint8* p;
const guint8* s = (void*)si;
struct _uat_dlg_data* dd = user_data;
guint ncols = dd->uat->ncols;
uat_field_t* f = dd->uat->fields;
- char* err = NULL;
+ const char* err = NULL;
guint colnum;
for ( colnum = 0; colnum < ncols; colnum++ ) {
* descriptive name.
*/
static void
-display_dissector_table_names(char *table_name, const char *ui_name,
+display_dissector_table_names(const char *table_name, const char *ui_name,
gpointer output)
{
fprintf((FILE *)output, "\t%s (%s)\n", table_name, ui_name);