* to be printed.
*/
void
-handle_dashG_option(int argc, char **argv, char *progname)
+handle_dashG_option(int argc, char **argv, const char *progname)
{
char *gpf_path, *pf_path;
int gpf_open_errno, gpf_read_errno;
* Handle the "-G" option, to cause protocol field, etc. information
* to be printed.
*/
-void handle_dashG_option(int argc, char **argv, char *progname);
+void handle_dashG_option(int argc, char **argv, const char *progname);
int get_natural_int(const char *appname, const char *string, const char *name);
void
save_disabled_protos_list(char **pref_path_return, int *errno_return)
{
- gchar *ff_path, *ff_path_new, *ff_name;
- FILE *ff;
- gint i;
- protocol_t *protocol;
- void *cookie;
+ gchar *ff_path, *ff_path_new;
+ const gchar *ff_name;
+ FILE *ff;
+ gint i;
+ protocol_t *protocol;
+ void *cookie;
*pref_path_return = NULL; /* assume no error */
int hash_idx;
hashport_t *tp;
hashport_t **table;
- char *serv_proto = NULL;
+ const char *serv_proto = NULL;
struct servent *servp;
switch(proto) {
} /* host_name_lookup6 */
-const gchar *solve_address_to_name(address *addr)
+static const gchar *solve_address_to_name(address *addr)
{
guint32 ipv4_addr;
struct e_in6_addr ipv6_addr;
/*
* NAME: asn1_err_to_str [API]
- * SYNOPSIS: char *asn1_err_to_str
+ * SYNOPSIS: const char *asn1_err_to_str
* (
* int err
* )
* err: the error code
* RETURNS: string for the error
*/
-char *
+const char *
asn1_err_to_str(int err)
{
- char *errstr;
+ const char *errstr;
char errstrbuf[14+1+1+11+1+1]; /* "Unknown error (%d)\0" */
switch (err) {
guint *nbytes);
extern int asn1_sequence_decode (ASN1_SCK *asn1, guint *seq_len, guint *nbytes);
-extern char *asn1_err_to_str (int err);
+extern const char *asn1_err_to_str (int err);
#endif
/* Given a format number (as defined in packet.h), returns its equivalent
string */
-gchar *
+const gchar *
col_format_to_string(gint fmt) {
- gchar *slist[] = { "%m", "%t", "%Rt", "%At", "%Yt", "%Tt", "%s", "%rs",
- "%us","%hs", "%rhs", "%uhs", "%ns", "%rns", "%uns", "%d",
- "%rd", "%ud", "%hd", "%rhd", "%uhd", "%nd", "%rnd",
- "%und", "%S", "%rS", "%uS", "%D", "%rD", "%uD", "%p",
- "%i", "%L", "%B", "%XO", "%XR", "%I", "%c", "%Xs",
- "%Xd", "%V", "%x", "%e", "%H", "%P", "%y" };
+ const gchar *slist[] = {
+ "%m", "%t", "%Rt", "%At", "%Yt", "%Tt", "%s", "%rs",
+ "%us","%hs", "%rhs", "%uhs", "%ns", "%rns", "%uns", "%d",
+ "%rd", "%ud", "%hd", "%rhd", "%uhd", "%nd", "%rnd",
+ "%und", "%S", "%rS", "%uS", "%D", "%rD", "%uD", "%p",
+ "%i", "%L", "%B", "%XO", "%XR", "%I", "%c", "%Xs",
+ "%Xd", "%V", "%x", "%e", "%H", "%P", "%y"
+};
if (fmt < 0 || fmt >= NUM_COL_FMTS)
return NULL;
/* Given a format number (as defined in packet.h), returns its
description */
-static gchar *dlist[NUM_COL_FMTS] = {
+static const gchar *dlist[NUM_COL_FMTS] = {
"Number",
"Time (format as specified)",
"Relative time",
"DCE/RPC call (cn_call_id / dg_seqnum)",
};
-gchar *
+const gchar *
col_format_desc(gint fmt) {
g_assert((fmt >= 0) && (fmt < NUM_COL_FMTS));
return(dlist[fmt]);
is done, and given that the width for COL...SRC and COL...DST columns
is somewhat arbitrary in any case. We should probably clean
that up eventually, though. */
-char *
+const char *
get_column_longest_string(gint format)
{
switch (format) {
gchar *fmt;
} fmt_data;
-gchar *col_format_to_string(gint);
-gchar *col_format_desc(gint);
+const gchar *col_format_to_string(gint);
+const gchar *col_format_desc(gint);
gint get_column_format(gint);
void get_column_format_matches(gboolean *, gint);
gint get_column_format_from_str(gchar *);
gchar *get_column_title(gint);
-char *get_column_longest_string(gint);
+const char *get_column_longest_string(gint);
gint get_column_char_width(gint format);
#endif /* column.h */
typedef struct _dcerpc_sub_dissector {
guint16 num;
- gchar *name;
+ const gchar *name;
dcerpc_dissect_fnct_t *dissect_rqst;
dcerpc_dissect_fnct_t *dissect_resp;
} dcerpc_sub_dissector;
* and store in object key hash
*/
-static void read_IOR_strings_from_file(gchar *name, int max_iorlen) {
+static void read_IOR_strings_from_file(const gchar *name, int max_iorlen) {
guchar *buf; /* NOTE reused for every line */
int len;
int ior_val_len; /* length after unstringifying. */
*
*/
-void register_giop_user(giop_sub_dissector_t *sub, gchar *name, int sub_proto) {
+void register_giop_user(giop_sub_dissector_t *sub, const gchar *name, int sub_proto) {
giop_sub_handle_t *subh;
* This is for heuristic dissection
*/
-extern void register_giop_user(giop_sub_dissector_t *sub, gchar *name,
+extern void register_giop_user(giop_sub_dissector_t *sub, const gchar *name,
int sub_proto);
/*
char *appdatadir;
char *userprofiledir;
#else
- char *homedir;
+ const char *homedir;
struct passwd *pwd;
#endif
static char *pf_dir = NULL;
* Return an error message for UNIX-style errno indications on open or
* create operations.
*/
-char *
+const char *
file_open_error_message(int err, gboolean for_writing)
{
- char *errmsg;
+ const char *errmsg;
static char errmsg_errno[1024+1];
switch (err) {
* Return an error message for UNIX-style errno indications on write
* operations.
*/
-char *
+const char *
file_write_error_message(int err)
{
- char *errmsg;
+ const char *errmsg;
static char errmsg_errno[1024+1];
switch (err) {
* Return an error message for UNIX-style errno indications on open or
* create operations.
*/
-char *file_open_error_message(int err, gboolean for_writing);
+const char *file_open_error_message(int err, gboolean for_writing);
/*
* Return an error message for UNIX-style errno indications on write
* operations.
*/
-char *file_write_error_message(int err);
+const char *file_write_error_message(int err);
/*
* Check, if file is existing.
* the tvbuff for the data source and its name.
*/
void
-add_new_data_source(packet_info *pinfo, tvbuff_t *tvb, char *name)
+add_new_data_source(packet_info *pinfo, tvbuff_t *tvb, const char *name)
{
data_source *src;
struct dissector_table {
GHashTable *hash_table;
GSList *dissector_handles;
- char *ui_name;
+ const char *ui_name;
ftenum_t type;
int base;
};
/* Add an entry to a string dissector table. */
void
-dissector_add_string(const char *name, gchar *pattern,
+dissector_add_string(const char *name, const gchar *pattern,
dissector_handle_t handle)
{
dissector_table_t sub_dissectors = find_dissector_table( name);
}
dissector_table_t
-register_dissector_table(const char *name, char *ui_name, ftenum_t type,
+register_dissector_table(const char *name, const char *ui_name, ftenum_t type,
int base)
{
dissector_table_t sub_dissectors;
/* a protocol uses the function to register a sub-dissector table */
extern dissector_table_t register_dissector_table(const char *name,
- char *ui_name, ftenum_t type, int base);
+ const char *ui_name, ftenum_t type, int base);
/* Find a dissector table by table name. */
extern dissector_table_t find_dissector_table(const char *name);
dissector_table_t sub_dissectors, guint32 port);
/* Add an entry to a string dissector table. */
-extern void dissector_add_string(const char *name, gchar *pattern,
+extern void dissector_add_string(const char *name, const gchar *pattern,
dissector_handle_t handle);
/* Delete the entry for a dissector in a string dissector table
* the tvbuff for the data source and its name.
*/
extern void add_new_data_source(packet_info *pinfo, tvbuff_t *tvb,
- char *name);
+ const char *name);
/*
* Free up a frame's list of data sources.
guint32 ipxptype; /* IPX packet type, if this is an IPX packet */
circuit_type ctype; /* type of circuit, for protocols with a VC identifier */
guint32 circuit_id; /* circuit ID, for protocols with a VC identifier */
- char *noreassembly_reason; /* reason why reassembly wasn't done, if any */
+ const char *noreassembly_reason; /* reason why reassembly wasn't done, if any */
gboolean fragmented; /* TRUE if the protocol is only a fragment */
gboolean in_error_pkt; /* TRUE if we're inside an {ICMP,CLNP,...} error packet */
port_type ptype; /* type of the following two port numbers */
*/
void
prefs_register_string_preference(module_t *module, const char *name,
- const char *title, const char *description, char **var)
+ const char *title, const char *description, const char **var)
{
pref_t *preference;
* Register a preference with a character-string value.
*/
extern void prefs_register_string_preference(module_t *module, const char *name,
- const char *title, const char *description, char **var);
+ const char *title, const char *description, const char **var);
/*
* Register a preference with a ranged value.
proto_registrar_get_byname(const char *field_name)
{
DISSECTOR_ASSERT(field_name != NULL);
- return g_tree_lookup(gpa_name_tree, (gpointer)field_name);
+ return g_tree_lookup(gpa_name_tree, field_name);
}
/* Add a text-only node, leaving it to our caller to fill the text in */
return protocol->proto_id;
}
-int proto_get_id_by_filter_name(gchar* filter_name)
+int proto_get_id_by_filter_name(const gchar* filter_name)
{
GList *list_entry;
protocol_t *protocol;
/** Given a protocol's filter_name.
@param filter_name the filter name to search for
@return proto_id */
-extern int proto_get_id_by_filter_name(gchar* filter_name);
+extern int proto_get_id_by_filter_name(const gchar* filter_name);
/** Can item # n decoding be disabled?
@param proto_id protocol id (0-indexed)
}
/* register a new stats_tree */
-extern void stats_tree_register(guint8* tapname,
- guint8* abbr,
- guint8* name,
+extern void stats_tree_register(const guint8* tapname,
+ const guint8* abbr,
+ const guint8* name,
stat_tree_packet_cb packet,
stat_tree_init_cb init,
stat_tree_cleanup_cb cleanup) {
* packet: per packet callback
* init: tree initialization callback
*/
-extern void stats_tree_register(guint8* tapname,
- guint8* abbr,
- guint8* name,
+extern void stats_tree_register(const guint8* tapname,
+ const guint8* abbr,
+ const guint8* name,
stat_tree_packet_cb packet,
stat_tree_init_cb init,
stat_tree_cleanup_cb cleanup);
*/
typedef struct _tap_cmd_arg {
struct _tap_cmd_arg *next;
- char *cmd;
+ const char *cmd;
void (*func)(char *arg);
} tap_cmd_arg;
static tap_cmd_arg *tap_cmd_arg_list=NULL;
* and initialization routine
* ********************************************************************** */
void
-register_tap_listener_cmd_arg(char *cmd, void (*func)(char *arg))
+register_tap_listener_cmd_arg(const char *cmd, void (*func)(char *arg))
{
tap_cmd_arg *newtca;
or 0 if no such tap was found.
*/
int
-find_tap_id(char *name)
+find_tap_id(const char *name)
{
tap_dissector_t *td;
int i;
* message.
*/
GString *
-register_tap_listener(char *tapname, void *tapdata, char *fstring, tap_reset_cb reset, tap_packet_cb packet, tap_draw_cb draw)
+register_tap_listener(const char *tapname, void *tapdata, char *fstring, tap_reset_cb reset, tap_packet_cb packet, tap_draw_cb draw)
{
tap_listener_t *tl;
int tap_id;
extern void tap_init(void);
-extern void register_tap_listener_cmd_arg(char *cmd, void (*func)(char *arg));
+extern void register_tap_listener_cmd_arg(const char *cmd, void (*func)(char *arg));
extern gboolean process_tap_cmd_arg(char *optarg);
extern void list_tap_cmd_args(void);
extern void start_requested_taps(void);
extern int register_tap(const char *name);
-extern int find_tap_id(char *name);
+extern int find_tap_id(const char *name);
extern void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data);
extern void tap_queue_init(epan_dissect_t *edt);
extern void tap_push_tapped_queue(epan_dissect_t *edt);
extern void reset_tap_listeners(void);
extern void draw_tap_listeners(gboolean draw_all);
-extern GString *register_tap_listener(char *tapname, void *tapdata,
+extern GString *register_tap_listener(const char *tapname, void *tapdata,
char *fstring, tap_reset_cb tap_reset, tap_packet_cb tap_packet,
tap_draw_cb tap_draw);
extern void remove_tap_listener(void *tapdata);
{
static gchar *p;
int hours, mins, secs;
- gchar *msign = "";
+ const gchar *msign = "";
gboolean do_comma = FALSE;
if(time<0){
display_signed_time(gchar *buf, int buflen, gint32 sec, gint32 frac,
time_res_t units)
{
- char *sign;
+ const char *sign;
/* If the fractional part of the time stamp is negative,
print its absolute value and, if the seconds part isn't
{
gchar *buf;
char *p;
- char *sign;
+ const char *sign;
gint32 time;
gint32 nsec;
guint16 control;
int control_len;
const xdlc_cf_items *cf_items;
- char *control_format;
+ const char *control_format;
guint16 poll_final;
char info[80];
proto_tree *tc, *control_tree;
- gchar *frame_type = NULL;
+ const gchar *frame_type = NULL;
const gchar *modifier;
switch (tvb_get_guint8(tvb, offset) & 0x03) {
static int cmd_bits_out(tvbuff_t*, int, proto_tree*);
static int cmd_init_strat(tvbuff_t*, int, proto_tree*);
-static char *frame_type[] = {
+static const char *frame_type[] = {
"",
"Command request",
"Command response",
static int
cmd_init(tvbuff_t *tvb, int offset, proto_tree *pt)
{
- char *ptr;
+ const char *ptr;
if (tvb_get_guint8(tvb, offset) == 0)
ptr = "Always initialize";
static int
cmd_sort(tvbuff_t *tvb, int offset, proto_tree *pt)
{
- char *which;
+ const char *which;
which = tvb_get_guint8(tvb, offset) ?
"Sort into blocks of up to 16 messages" :
static int
cmd_optimize(tvbuff_t *tvb, int offset, proto_tree *pt)
{
- char *which;
+ const char *which;
which = tvb_get_guint8(tvb, offset) ?
"Optimize for latency (Nagle algorithm disabled)" :
proto_item *item;
int save_offset;
unsigned int x;
- char *type;
+ const char *type;
msglen = tvb_reported_length_remaining(tvb, offset);
x = tvb_get_ntohl(tvb, offset);
static int
resp_blm_data(tvbuff_t *tvb, int offset, proto_tree *pt)
{
- unsigned int i;
- int hours, minutes, seconds, fraction, x, fract;
- unsigned long timestamp;
- static char *fields[] = {
+ unsigned int i;
+ int hours, minutes, seconds, fraction, x, fract;
+ unsigned long timestamp;
+ static const char *fields[] = {
"Bus load average: %d.%02d%%",
"Current bus load: %d.%02d%%",
"Peak bus load: %d.%02d%%",
resp_blm_stat(tvbuff_t *tvb, int offset, proto_tree *pt)
{
unsigned int x, i;
- char *fields[] = {
+ const char *fields[] = {
"Receive frame count: %u",
"Transmit frame count: %u",
"Receive dropped frame count: %u",
proto_item *item;
proto_tree *tree;
unsigned int i, size, padding, option, option_length, option_value;
- char *string, *string1;
+ const char *string, *string1;
msglen = tvb_reported_length_remaining(tvb, offset);
item = proto_tree_add_text(pt, tvb, offset, 1, "Handle: %u",
static int
cmd_files(tvbuff_t *tvb, int offset, proto_tree *pt)
{
- int msglen;
- gchar *which;
+ int msglen;
+ const gchar *which;
msglen = tvb_reported_length_remaining(tvb, offset);
if (tvb_get_guint8(tvb, offset) == 0)
static int
resp_files(tvbuff_t *tvb, int offset, proto_tree *pt)
{
- int msglen;
- gchar *flag;
+ int msglen;
+ const gchar *flag;
msglen = tvb_reported_length_remaining(tvb, offset);
flag = tvb_get_guint8(tvb, offset) ? "Yes": "No";
static int
cmd_usdt(tvbuff_t *tvb, int offset, proto_tree *pt)
{
- int ids, id, remain, size, i, j, bytes;
- gchar *desc;
- guint8 flags;
- proto_tree *localTree;
- proto_item *localItem;
- gchar *actions[] = {"Use 11 bit headers only",
- "Use 29 bit headers only",
- "Use both 11 & 29 bit headers",
- "undefined"};
- gchar *xmit_opts[] = {"Pad messages with less than 8 data bytes with 0x00's",
- "Pad messages with less than 8 data bytes with 0xFF's",
- "Do not pad messages with less than 8 data bytes",
- "undefined"};
- gchar *recv_opts[] = {"Do not verify the integrity of long received messages and do not send them to the client",
- "Verify the integrity of long received messages and send them to the client",
- "Verify the integrity of long received messages but do not send them to the client",
- "undefined"};
- gchar *block_desc[] = {"USDT request", "USDT response", "UUDT response"};
+ int ids, id, remain, size, i, j, bytes;
+ const gchar *desc;
+ guint8 flags;
+ proto_tree *localTree;
+ proto_item *localItem;
+ const gchar *actions[] = {
+ "Use 11 bit headers only",
+ "Use 29 bit headers only",
+ "Use both 11 & 29 bit headers",
+ "undefined"
+ };
+ const gchar *xmit_opts[] = {
+ "Pad messages with less than 8 data bytes with 0x00's",
+ "Pad messages with less than 8 data bytes with 0xFF's",
+ "Do not pad messages with less than 8 data bytes",
+ "undefined"
+ };
+ const gchar *recv_opts[] = {
+ "Do not verify the integrity of long received messages and do not send them to the client",
+ "Verify the integrity of long received messages and send them to the client",
+ "Verify the integrity of long received messages but do not send them to the client",
+ "undefined"
+ };
+ const gchar *block_desc[] = {"USDT request", "USDT response", "UUDT response"};
flags = tvb_get_guint8(tvb, offset);
if (flags & 1)
proto_item *item;
proto_tree *tree;
unsigned int i;
- int msglen, mask, value;
- char *decode[] = {"Input 1", "Input 2", "Input 3", "Pushbutton"};
+ int msglen, mask, value;
+ const char *decode[] = {"Input 1", "Input 2", "Input 3", "Pushbutton"};
msglen = tvb_reported_length_remaining(tvb, offset);
value = tvb_get_guint8(tvb, offset);
proto_item *item;
proto_tree *tree;
unsigned int i;
- int msglen, mask, value;
- char *decode[] = {"Output 1", "Output 2"};
+ int msglen, mask, value;
+ const char *decode[] = {"Output 1", "Output 2"};
msglen = tvb_reported_length_remaining(tvb, offset);
value = tvb_get_guint8(tvb, offset);
static int
blm_mode(tvbuff_t *tvb, int offset, proto_tree *pt)
{
- char *mode, line[50];
+ const char *mode;
+ char line[50];
int x, y, seconds;
x = tvb_get_ntohl(tvb, offset);
typedef struct val_str_dsp {
- int value;
- char *strptr;
- int (*cmd_fnct)(tvbuff_t *, int, proto_tree*);
- int (*rsp_fnct)(tvbuff_t *, int, proto_tree*);
+ int value;
+ const char *strptr;
+ int (*cmd_fnct)(tvbuff_t *, int, proto_tree*);
+ int (*rsp_fnct)(tvbuff_t *, int, proto_tree*);
} val_str_dsp;
unsigned list_index, guint8 attr_type);
typedef const struct ias_attr_dissector {
- char* attr_name;
+ const char* attr_name;
ias_value_dissector_t value_dissector;
} ias_attr_dissector_t;
typedef const struct ias_class_dissector {
- char* class_name;
+ const char* class_name;
ias_attr_dissector_t* pattr_dissector;
} ias_class_dissector_t;
extern void mate_analyze_frame(packet_info *pinfo, proto_tree* tree);
/* from mate_setup.c */
-extern mate_config* mate_make_config(gchar* filename, int mate_hfid);
+extern mate_config* mate_make_config(const gchar* filename, int mate_hfid);
extern mate_config* mate_cfg(void);
extern mate_cfg_pdu* new_pducfg(gchar* name);
/* from mate_parser.l */
-extern gboolean mate_load_config(gchar* filename, mate_config* mc);
+extern gboolean mate_load_config(const gchar* filename, mate_config* mc);
#endif
LoAL* current_gogkeys;
} gog_statement_t;
-static void configuration_error(mate_config* mc, gchar* fmt, ...) {
+static void configuration_error(mate_config* mc, const gchar* fmt, ...) {
static gchar error_buffer[256];
- gchar* incl;
+ const gchar* incl;
gint i;
mate_config_frame* current_frame;
va_list list;
%%
-extern gboolean mate_load_config(gchar* filename, mate_config* matecfg) {
+extern gboolean mate_load_config(const gchar* filename, mate_config* matecfg) {
gboolean state;
mc = matecfg;
static mate_config* matecfg = NULL;
/* appends the formatted string to the current error log */
-static void report_error(gchar* fmt, ...) {
+static void report_error(const gchar* fmt, ...) {
static gchar error_buffer[DEBUG_BUFFER_SIZE];
va_list list;
static void print_pdu_config(mate_cfg_pdu* cfg, GString* s) {
guint i;
int hfid;
- gchar* discard;
- gchar* stop;
+ const gchar* discard;
+ const gchar* stop;
discard = cfg->discard ? "TRUE": "FALSE";
stop = cfg->last_extracted ? "TRUE" : "FALSE";
g_string_free(config_text,TRUE);
}
-extern mate_config* mate_make_config(gchar* filename, int mate_hfid) {
+extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) {
gint* ett;
avp_init();
*
* Return value: a pointer to the subscribed string.
**/
-gchar* scs_subscribe(SCS_collection* c, gchar* s) {
+gchar* scs_subscribe(SCS_collection* c, const gchar* s) {
gchar* orig = NULL;
guint* ip = NULL;
size_t len = 0;
* Return value: a pointer to the newly created avp.
*
**/
-extern AVP* new_avp_from_finfo(gchar* name, field_info* finfo) {
+extern AVP* new_avp_from_finfo(const gchar* name, field_info* finfo) {
AVP* new = g_mem_chunk_alloc(avp_chunk);
gchar* value;
* Return value: a pointer to the newly created avp.
*
**/
-extern AVP* new_avp(gchar* name, gchar* value, gchar o) {
+extern AVP* new_avp(const gchar* name, const gchar* value, gchar o) {
AVP* new = g_mem_chunk_alloc(avp_chunk);
new->n = scs_subscribe(avp_strings, name);
* Return value: a pointer to the newly created avpl.
*
**/
-extern AVPL* new_avpl(gchar* name) {
+extern AVPL* new_avpl(const gchar* name) {
AVPL* new_avpl = g_mem_chunk_alloc(avp_chunk);
#ifdef _AVP_DEBUGGING
* Return value: a pointer to the newly allocated string.
*
**/
-extern AVPL* new_avpl_from_avpl(gchar* name, AVPL* avpl, gboolean copy_avps) {
+extern AVPL* new_avpl_from_avpl(const gchar* name, AVPL* avpl, gboolean copy_avps) {
AVPL* newavpl = new_avpl(name);
void* cookie = NULL;
AVP* avp;
* Return value: a pointer to the newly created avpl containing the
* matching avps.
**/
-extern AVPL* new_avpl_loose_match(gchar* name,
+extern AVPL* new_avpl_loose_match(const gchar* name,
AVPL* src,
AVPL* op,
gboolean copy_avps) {
* Return value: a pointer to the newly created avpl containing the
* matching avps.
**/
-extern AVPL* new_avpl_every_match(gchar* name, AVPL* src, AVPL* op, gboolean copy_avps) {
+extern AVPL* new_avpl_every_match(const gchar* name, AVPL* src, AVPL* op, gboolean copy_avps) {
AVPL* newavpl;
AVPN* co = NULL;
AVPN* cs = NULL;
* Return value: a pointer to the newly created avpl containing the
* matching avps.
**/
-extern AVPL* new_avpl_exact_match(gchar* name,AVPL* src, AVPL* op, gboolean copy_avps) {
+extern AVPL* new_avpl_exact_match(const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps) {
AVPL* newavpl = new_avpl(name);
AVPN* co = NULL;
AVPN* cs = NULL;
return NULL;
}
-extern AVPL* new_avpl_from_match(avpl_match_mode mode, gchar* name,AVPL* src, AVPL* op, gboolean copy_avps) {
+extern AVPL* new_avpl_from_match(avpl_match_mode mode, const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps) {
AVPL* avpl = NULL;
switch (mode) {
*
* Return value: a pointer to the newly created loal.
**/
-extern LoAL* new_loal(gchar* name) {
+extern LoAL* new_loal(const gchar* name) {
LoAL* new_loal = g_mem_chunk_alloc(avp_chunk);
if (! name) {
* load_loal_error:
* Used by loal_from_file to handle errors while loading.
**/
-LoAL* load_loal_error(FILE* fp, LoAL* loal, AVPL* curr, int linenum, gchar* fmt, ...) {
+LoAL* load_loal_error(FILE* fp, LoAL* loal, AVPL* curr, int linenum, const gchar* fmt, ...) {
va_list list;
gchar* desc;
LoAL* ret = NULL;
extern void destroy_scs_collection(SCS_collection* c);
extern SCS_collection* scs_init(void);
-extern gchar* scs_subscribe(SCS_collection* collection, gchar* s);
+extern gchar* scs_subscribe(SCS_collection* collection, const gchar* s);
extern void scs_unsubscribe(SCS_collection* collection, gchar* s);
extern gchar* scs_subscribe_printf(SCS_collection* collection, gchar* fmt, ...);
*/
/* creates a new avp */
-extern AVP* new_avp(gchar* name, gchar* value, gchar op);
+extern AVP* new_avp(const gchar* name, const gchar* value, gchar op);
/* creates a copy od an avp */
extern AVP* avp_copy(AVP* from);
/* creates an avp from a field_info record */
-extern AVP* new_avp_from_finfo(gchar* name, field_info* finfo);
+extern AVP* new_avp_from_finfo(const gchar* name, field_info* finfo);
/*
* avp destructor
*/
/* creates an empty avp list */
-extern AVPL* new_avpl(gchar* name);
+extern AVPL* new_avpl(const gchar* name);
/* creates a copy of an avp list */
-extern AVPL* new_avpl_from_avpl(gchar* name, AVPL* avpl, gboolean copy_avps);
+extern AVPL* new_avpl_from_avpl(const gchar* name, AVPL* avpl, gboolean copy_avps);
/* creates an avp list containing any avps in src matching any avps in op
it will eventually create an empty list in none match */
-extern AVPL* new_avpl_loose_match(gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
+extern AVPL* new_avpl_loose_match(const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
/* creates an avp list containing any avps in src matching every avp in op
it will not create a list if there is not a match for every attribute in op */
-extern AVPL* new_avpl_every_match(gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
+extern AVPL* new_avpl_every_match(const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
/* creates an avp list containing every avp in src matching every avp in op
it will not create a list unless every avp in op is matched only once to avery avp in op */
-extern AVPL* new_avpl_exact_match(gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
+extern AVPL* new_avpl_exact_match(const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
/* uses mode to call one of the former matches. NO_MATCH = merge(merge(copy(src),op)) */
-extern AVPL* new_avpl_from_match(avpl_match_mode mode, gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
+extern AVPL* new_avpl_from_match(avpl_match_mode mode, const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
*/
/* creates an empty list of avp lists */
-extern LoAL* new_loal(gchar* name);
+extern LoAL* new_loal(const gchar* name);
/* given a file loads all the avpls contained in it
every line is formatted as it is the output of avplist_to_string */
static int proto_mate = -1;
-static gchar* pref_mate_config_filename = "";
-static gchar* current_mate_config_filename = NULL;
+static const gchar* pref_mate_config_filename = "";
+static const gchar* current_mate_config_filename = NULL;
static proto_item *mate_i = NULL;
float rel_time;
float gop_time;
float pdu_rel_time;
- gchar* pdu_str;
- gchar* type_str;
+ const gchar* pdu_str;
+ const gchar* type_str;
guint32 pdu_item;
gop_item = proto_tree_add_uint(tree,gop->cfg->hfid,tvb,0,0,gop->id);
static int callagent_udp_port = 0;
/* Some basic utility functions that are specific to this dissector */
-static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, gchar **verb_name);
+static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const gchar **verb_name);
static gboolean is_mgcp_rspcode(tvbuff_t *tvb, gint offset, gint maxlength);
static gint tvb_parse_param(tvbuff_t *tvb, gint offset, gint maxlength, int** hf);
guint32 num_messages;
gint tvb_sectionend,tvb_sectionbegin, tvb_len, tvb_current_len;
proto_tree *mgcp_tree, *ti;
- gchar *verb_name = "";
+ const gchar *verb_name = "";
/* Initialize variables */
tvb_sectionend = 0;
gint sectionlen;
gint tvb_sectionend,tvb_sectionbegin, tvb_len, tvb_current_len;
tvbuff_t *next_tvb;
- gchar *verb_name = "";
+ const gchar *verb_name = "";
/* Initialise stat info for passing to tap */
pi_current++;
*
* Return: TRUE if there is an MGCP verb at offset in tvb, otherwise FALSE
*/
-static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, gchar **verb_name)
+static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const gchar **verb_name)
{
int returnvalue = FALSE;
guint8 word[5];
mgcp_call_t *mgcp_call = NULL;
nstime_t delta;
gint rspcode = 0;
- gchar *verb_description = "";
+ const gchar *verb_description = "";
char code_with_verb[64] = ""; /* To fit "<4-letter-code> (<longest-verb>)" */
static address null_address = { AT_NONE, 0, NULL };
/* Internal structure to dissect attributes */
typedef struct {
- guint16 attribute_type; /* attribute code */
- char *tree_text; /* text for fold out */
- gint *tree_id; /* id for add_item */
- int* hf_type_attribute; /* id for seach option */
- void (*dissect)(tvbuff_t *tvb, proto_tree *tree, int* hfValue, int offset, int length);
+ guint16 attribute_type; /* attribute code */
+ const char *tree_text; /* text for fold out */
+ gint *tree_id; /* id for add_item */
+ int* hf_type_attribute; /* id for seach option */
+ void (*dissect)(tvbuff_t *tvb, proto_tree *tree, int* hfValue, int offset, int length);
} opsi_attribute_handle_t;
/* append the given info text */
static void
-pn_append_info(packet_info *pinfo, proto_item *dcp_item, char *text)
+pn_append_info(packet_info *pinfo, proto_item *dcp_item, const char *text)
{
if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, text);
proto_item *ti;
proto_tree *rlm_tree;
guint8 rlm_type, version;
- char *type_str = NULL;
+ const char *type_str = NULL;
if (pinfo->srcport < 3000 || pinfo->srcport > 3015
|| pinfo->destport < 3000 || pinfo->destport > 3015
{
field_info *fi = PITEM_FINFO(node);
write_pdml_data *pdata = (write_pdml_data*) data;
- gchar *label_ptr;
+ const gchar *label_ptr;
gchar label_str[ITEM_LABEL_LENGTH];
char *dfilter_string;
int chop_len;
};
typedef struct {
- char *abbrev;
- char *longname;
- int produceable_type;
- guint8 *sample_buffer;
- int sample_wtap_encap;
- int sample_length;
+ const char *abbrev;
+ const char *longname;
+ int produceable_type;
+ guint8 *sample_buffer;
+ int sample_wtap_encap;
+ int sample_length;
} pkt_example;
/* Ethernet, indicating ARP */
#include <string.h>
typedef struct _io_users_t {
- char *type;
+ const char *type;
char *filter;
struct _io_users_item_t *items;
} io_users_t;
iousers_init(char *optarg)
{
char *filter=NULL;
- char *tap_type, *tap_type_name;
+ const char *tap_type, *tap_type_name;
tap_packet_cb packet_func;
io_users_t *iu=NULL;
GString *error_string;
static gboolean write_preamble(capture_file *cf);
static gboolean print_packet(capture_file *cf, epan_dissect_t *edt);
static gboolean write_finale(void);
-static char *cf_open_error_message(int err, gchar *err_info,
+static const char *cf_open_error_message(int err, gchar *err_info,
gboolean for_writing, int file_type);
#ifdef HAVE_LIBPCAP
#ifndef _WIN32
#ifndef _WIN32
void (*oldhandler)(int);
static const char ppamsg[] = "can't find PPA for ";
- char *libpcap_warn;
+ const char *libpcap_warn;
volatile int pipe_fd = -1;
struct pcap_hdr hdr;
struct pcaprec_modified_hdr rechdr;
}
}
-static char *
+static const char *
cf_open_error_message(int err, gchar *err_info, gboolean for_writing,
int file_type)
{
- char *errmsg;
+ const char *errmsg;
static char errmsg_errno[1024+1];
if (err < 0) {
static char *ts_fmt = NULL;
/* Input file */
-static char *input_filename;
+static const char *input_filename;
static FILE *input_file = NULL;
/* Output file */
-static char *output_filename;
+static const char *output_filename;
static FILE *output_file = NULL;
/* Offset base to parse */
* Pass in TRUE if this is an offset, FALSE if not
*/
static unsigned long
-parse_num (char *str, int offset)
+parse_num (const char *str, int offset)
{
unsigned long num;
char *c;
* Write this byte into current packet
*/
static void
-write_byte (char *str)
+write_byte (const char *str)
{
unsigned long num;
/* For tracing shifts, the names of all terminals and nonterminals
** are required. The following table supplies these names */
-static char *yyTokenName[] = {
+static const char *yyTokenName[] = {
%%
};
#define YYTRACE(X) if( yyTraceFILE ) fprintf(yyTraceFILE,"%sReduce [%s].\n",yyTracePrompt,X);