while (vs[i].strptr) {
i++;
}
- vs_ext = value_string_ext_new((value_string *)vs, i+1, wmem_strdup_printf(wmem_epan_scope(), "%s_vals_ext",name));
+ vs_ext = value_string_ext_new(vs, i+1, wmem_strdup_printf(wmem_epan_scope(), "%s_vals_ext",name));
base = (field_display_e)(base|BASE_EXT_STRING);
}
static guint dmp_id_hash (gconstpointer k)
{
- dmp_id_key *dmpx=(dmp_id_key *)k;
+ const dmp_id_key *dmpx=(const dmp_id_key *)k;
return dmpx->id;
}
static gint dmp_id_hash_equal (gconstpointer k1, gconstpointer k2)
{
- dmp_id_key *dmp1=(dmp_id_key *)k1;
- dmp_id_key *dmp2=(dmp_id_key *)k2;
+ const dmp_id_key *dmp1=(const dmp_id_key *)k1;
+ const dmp_id_key *dmp2=(const dmp_id_key *)k2;
if (dmp1->id != dmp2->id)
return 0;
}
checksum_ok = check_atn_ec_16(tvb, tpdu_len , offset,
offset_iso8073_checksum,
- pinfo->dst.len, (guint8 *)pinfo->dst.data,
- pinfo->src.len, (guint8 *)pinfo->src.data);
+ pinfo->dst.len, (const guint8 *)pinfo->dst.data,
+ pinfo->src.len, (const guint8 *)pinfo->src.data);
proto_tree_add_text(tree, tvb, offset, length,
"ATN extended checksum : 0x%04x (%s)",
tvb_get_ntohs(tvb, offset),
}
checksum_ok = check_atn_ec_32(tvb, tpdu_len , offset,
offset_iso8073_checksum,
- pinfo->dst.len, (guint8 *)pinfo->dst.data,
- pinfo->src.len, (guint8 *)pinfo->src.data);
+ pinfo->dst.len, (const guint8 *)pinfo->dst.data,
+ pinfo->src.len, (const guint8 *)pinfo->src.data);
proto_tree_add_text(tree, tvb, offset, length,
"ATN extended checksum : 0x%08x (%s)",
tvb_get_ntohl(tvb, offset),
and a prepended IPv6 pseudo-header. */
/* Set up the fields of the pseudo-header. */
- cksum_vec[0].ptr = (guint8 *)pinfo->src.data;
+ cksum_vec[0].ptr = (const guint8 *)pinfo->src.data;
cksum_vec[0].len = pinfo->src.len;
- cksum_vec[1].ptr = (guint8 *)pinfo->dst.data;
+ cksum_vec[1].ptr = (const guint8 *)pinfo->dst.data;
cksum_vec[1].len = pinfo->dst.len;
cksum_vec[2].ptr = (const guint8 *)&phdr;
phdr[0] = g_htonl(ospflen);
break;
case AT_IPv6:
/* Set up the fields of the pseudo-header. */
- cksum_vec[0].ptr = (guint8 *)pinfo->src.data;
+ cksum_vec[0].ptr = (const guint8 *)pinfo->src.data;
cksum_vec[0].len = pinfo->src.len;
- cksum_vec[1].ptr = (guint8 *)pinfo->dst.data;
+ cksum_vec[1].ptr = (const guint8 *)pinfo->dst.data;
cksum_vec[1].len = pinfo->dst.len;
cksum_vec[2].ptr = (const guint8 *)&phdr;
phdr[0] = g_htonl(pim_length);
static void* uat_key_record_copy_cb(void* n, const void* o, size_t siz _U_) {
uat_key_record_t* new_key = (uat_key_record_t *)n;
- const uat_key_record_t* old_key = (uat_key_record_t *)o;
+ const uat_key_record_t* old_key = (const uat_key_record_t *)o;
if (old_key->string) {
new_key->string = g_strdup(old_key->string);
/* store a guid to name mapping */
void
-guids_add_guid(e_guid_t *guid, const gchar *name)
+guids_add_guid(const e_guid_t *guid, const gchar *name)
{
wmem_tree_key_t guidkey[2];
guint32 g[4];
/* retrieve the registered name for this GUID */
const gchar *
-guids_get_guid_name(e_guid_t *guid)
+guids_get_guid_name(const e_guid_t *guid)
{
wmem_tree_key_t guidkey[2];
guint32 g[4];
Formats uuid number and returns the resulting string, if name is unknown.
(derived from val_to_str) */
const gchar *
-guids_resolve_guid_to_str(e_guid_t *guid)
+guids_resolve_guid_to_str(const e_guid_t *guid)
{
const gchar *name;
WS_DLL_PUBLIC void guids_init(void);
/* add a GUID */
-WS_DLL_PUBLIC void guids_add_guid(e_guid_t *guid, const gchar *name);
+WS_DLL_PUBLIC void guids_add_guid(const e_guid_t *guid, const gchar *name);
/* try to get registered name for this GUID */
-WS_DLL_PUBLIC const gchar *guids_get_guid_name(e_guid_t *guid);
+WS_DLL_PUBLIC const gchar *guids_get_guid_name(const e_guid_t *guid);
/* resolve GUID to name (or if unknown to hex string) */
/* (if you need hex string only, use guid_to_str instead) */
-WS_DLL_PUBLIC const gchar* guids_resolve_guid_to_str(e_guid_t *guid);
+WS_DLL_PUBLIC const gchar* guids_resolve_guid_to_str(const e_guid_t *guid);
/* add a UUID (dcerpc_init_uuid() will call this too) */
#define guids_add_uuid(uuid, name) guids_add_guid((e_guid_t *) (uuid), (name))
static gint
dissector_compare_filter_name(gconstpointer dissector_a, gconstpointer dissector_b)
{
- const dissector_handle_t a = (const dissector_handle_t)dissector_a;
- const dissector_handle_t b = (const dissector_handle_t)dissector_b;
+ const struct dissector_handle *a = (const struct dissector_handle *)dissector_a;
+ const struct dissector_handle *b = (const struct dissector_handle *)dissector_b;
const char *a_name, *b_name;
gint ret;
{
guint32 l, r;
- l = *(guint32*)a;
- r = *(guint32*)b;
+ l = *(const guint32*)a;
+ r = *(const guint32*)b;
return l - r;
}
$elems{$k} = $v;
}
- my $code = "static void wslua_${tname}_to_table(lua_State* L, const void* p) { $sname* v _U_; v = ($sname*)p; lua_newtable(L);\n";
+ my $code = "static void wslua_${tname}_to_table(lua_State* L, const void* p) { const $sname* v _U_; v = (const $sname*)p; lua_newtable(L);\n";
my $doc = "Tap: $tname\n";
for my $n (sort keys %elems) {
const void *data)
{
ansi_a_stat_t *stat_p = (ansi_a_stat_t *)tapdata;
- const ansi_a_tap_rec_t *data_p = (ansi_a_tap_rec_t *)data;
+ const ansi_a_tap_rec_t *data_p = (const ansi_a_tap_rec_t *)data;
switch (data_p->pdu_type)
{
const void *phi)
{
struct camelcounter_t * p_counter =(struct camelcounter_t *)phs;
- const struct camelsrt_info_t * pi=(struct camelsrt_info_t *)phi;
+ const struct camelsrt_info_t * pi=(const struct camelsrt_info_t *)phi;
if (pi->opcode != 255)
p_counter->camel_msg[pi->opcode]++;
error_packet(void *pss, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *prv)
{
expert_comp_dlg_t *ss=(expert_comp_dlg_t *)pss;
- const expert_info_t *error_pkt=(expert_info_t *)prv;
+ const expert_info_t *error_pkt=(const expert_info_t *)prv;
/* if return value is 0 then no error */
if(error_pkt==NULL){
smb2stat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
{
smb2stat_t *ss=(smb2stat_t *)pss;
- const smb2_info_t *si=(smb2_info_t *)psi;
+ const smb2_info_t *si=(const smb2_info_t *)psi;
/* we are only interested in response packets */
if(!(si->flags&SMB2_FLAGS_RESPONSE)){
smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
{
smbstat_t *ss=(smbstat_t *)pss;
- const smb_info_t *si=(smb_info_t *)psi;
+ const smb_info_t *si=(const smb_info_t *)psi;
/* we are only interested in reply packets */
if(si->request){
static int
mtp3_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *mtp3_info _U_)
{
- const mtp3_tap_rec_t *pi = (mtp3_tap_rec_t *)mtp3_info;
+ const mtp3_tap_rec_t *pi = (const mtp3_tap_rec_t *)mtp3_info;
/* keep the data in memory to use when the ISUP information arrives */
GList *list2;
h245_address_t *h245_add = NULL;
- const h245_packet_info *pi = (h245_packet_info *)H245info;
+ const h245_packet_info *pi = (const h245_packet_info *)H245info;
/* check if Tunneling is OFF and we have a call with this H245 add */
list = g_list_first(tapinfo->callsinfo_list);
SDPcalls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *SDPinfo)
{
voip_calls_tapinfo_t *tapinfo = &the_tapinfo_struct;
- const sdp_packet_info *pi = (sdp_packet_info *)SDPinfo;
+ const sdp_packet_info *pi = (const sdp_packet_info *)SDPinfo;
/* There are protocols like MGCP/SIP where the SDP is called before the tap for the
MGCP/SIP packet, in those cases we assign the SPD summary to global lastSDPsummary
gboolean fromEndpoint = FALSE; /* true for calls originated in Endpoints, false for calls from MGC */
gdouble diff_time;
- const mgcp_info_t *pi = (mgcp_info_t *)MGCPinfo;
+ const mgcp_info_t *pi = (const mgcp_info_t *)MGCPinfo;
if ((pi->mgcp_type == MGCP_REQUEST) && !pi->is_duplicate ) {
static int h248_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prot_info) {
voip_calls_tapinfo_t *tapinfo = &the_tapinfo_struct;
- const gcp_cmd_t *cmd = (gcp_cmd_t *)prot_info;
+ const gcp_cmd_t *cmd = (const gcp_cmd_t *)prot_info;
GList *list;
voip_calls_info_t *callsinfo = NULL;
address *mgw;
GList* list;
voip_calls_info_t *callsinfo = NULL;
address* phone;
- const skinny_info_t *si = (skinny_info_t *)skinny_info;
+ const skinny_info_t *si = (const skinny_info_t *)skinny_info;
skinny_calls_info_t *tmp_skinnyinfo;
gchar *comment;
GList* list;
voip_calls_info_t *callsinfo = NULL;
address* phone;
- const iax2_info_t *ii = (iax2_info_t *)iax2_info;
+ const iax2_info_t *ii = (const iax2_info_t *)iax2_info;
iax2_info_t *tmp_iax2info;
if (ii == NULL || ii->ptype != IAX2_FULL_PACKET || (ii->scallno == 0 && ii->dcallno == 0))
voip_calls_info_t *callsinfo = NULL;
voip_calls_info_t *tmp_listinfo;
GList *list = NULL;
- const voip_packet_info_t *pi = (voip_packet_info_t *)VoIPinfo;
+ const voip_packet_info_t *pi = (const voip_packet_info_t *)VoIPinfo;
if (pi->call_id)
list = g_list_first(tapinfo->callsinfo_list);
wspstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri)
{
wspstat_t *sp = (wspstat_t *)psp;
- const wsp_info_value_t *value = (wsp_info_value_t *)pri;
+ const wsp_info_value_t *value = (const wsp_info_value_t *)pri;
gint idx = pdut2index(value->pdut);
gboolean retour = FALSE;
}
-static sctp_assoc_info_t *calc_checksum(struct _sctp_info *check_data, sctp_assoc_info_t *data)
+static sctp_assoc_info_t *calc_checksum(const struct _sctp_info *check_data, sctp_assoc_info_t *data)
{
gboolean ok = FALSE;
static int
packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const void *data)
{
- struct _sctp_info *sctp_info;
+ const struct _sctp_info *sctp_info = (const struct _sctp_info *) data;
guint32 chunk_number = 0, tsnumber,framenumber;
sctp_tmp_info_t tmp_info;
sctp_assoc_info_t *info = NULL;
int i;
guint8 idx = 0;
- sctp_info = (struct _sctp_info *) data;
-
framenumber=pinfo->fd->num;
type = sctp_info->ip_src.type;
seq_analysis_tcp_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *tcp_info)
{
seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr;
- const struct tcpheader *tcph = (struct tcpheader *)tcp_info;
+ const struct tcpheader *tcph = (const struct tcpheader *)tcp_info;
if ((sainfo->all_packets)||(pinfo->fd->flags.passed_dfilter==1)){
/* copied from packet-tcp */