*/
#define TVB_SET_ADDRESS_HF(addr, addr_type, tvb, offset, addr_len, addr_hf) \
do { \
- const void *TVB_SET_ADDRESS_data = (void *) tvb_get_ptr(tvb, offset, addr_len); \
+ const void *TVB_SET_ADDRESS_data = (const void *) tvb_get_ptr(tvb, offset, addr_len); \
set_address_hf((addr), (addr_type), (addr_len), TVB_SET_ADDRESS_data, (addr_hf)); \
} while (0)
if ((connInfo->O2T.port == 0) || (connInfo->O2T.type == CONN_TYPE_MULTICAST))
connInfo->O2T.port = ENIP_IO_PORT;
if ((connInfo->O2T.ipaddress.type == AT_NONE) ||
- ((connInfo->O2T.ipaddress.type == AT_IPv4) && ((*(guint32*)connInfo->O2T.ipaddress.data)) == 0) ||
+ ((connInfo->O2T.ipaddress.type == AT_IPv4) && ((*(const guint32*)connInfo->O2T.ipaddress.data)) == 0) ||
((connInfo->O2T.ipaddress.type == AT_IPv6) && (memcmp(connInfo->O2T.ipaddress.data, &ipv6_zero, sizeof(ipv6_zero)) == 0)) ||
(connInfo->O2T.type != CONN_TYPE_MULTICAST))
connInfo->O2T.ipaddress = pinfo->src;
if ((connInfo->T2O.port == 0) || (connInfo->T2O.type == CONN_TYPE_MULTICAST))
connInfo->T2O.port = ENIP_IO_PORT;
if ((connInfo->T2O.ipaddress.type == AT_NONE) ||
- ((connInfo->T2O.ipaddress.type == AT_IPv4) && ((*(guint32*)connInfo->T2O.ipaddress.data)) == 0) ||
+ ((connInfo->T2O.ipaddress.type == AT_IPv4) && ((*(const guint32*)connInfo->T2O.ipaddress.data)) == 0) ||
((connInfo->T2O.ipaddress.type == AT_IPv6) && (memcmp(connInfo->T2O.ipaddress.data, &ipv6_zero, sizeof(ipv6_zero)) == 0)) ||
(connInfo->T2O.type != CONN_TYPE_MULTICAST))
connInfo->T2O.ipaddress = pinfo->dst;
hartip_message_id_values,
"Unknown message %d");
- tick_stat_node(st, (guint8*)st_str_packets, 0, FALSE);
- tick_stat_node(st, (guint8*)message_type_node_str, st_node_packets, FALSE);
- tick_stat_node(st, (guint8*)message_id_node_str, message_type_node, FALSE);
+ tick_stat_node(st, st_str_packets, 0, FALSE);
+ tick_stat_node(st, message_type_node_str, st_node_packets, FALSE);
+ tick_stat_node(st, message_id_node_str, message_type_node, FALSE);
return 1;
}
static guint8 get_TypeIdLength(guint8 TypeId)
{
guint8 ret = 0;
- td_asdu_length *item;
+ const td_asdu_length *item;
- item = (td_asdu_length *)asdu_length;
+ item = asdu_length;
while (item->value)
{
if (item->value == TypeId)
guint16 it_len;
guint32 present, xpresent;
guint8 rflags;
- struct ieee80211_radiotap_header *hdr;
+ const struct ieee80211_radiotap_header *hdr;
if (!BYTES_ARE_IN_FRAME(offset, len,
sizeof(struct ieee80211_radiotap_header))) {
ld->other++;
return;
}
- hdr = (struct ieee80211_radiotap_header *)pd;
+ hdr = (const struct ieee80211_radiotap_header *)pd;
it_len = pletoh16(&hdr->it_len);
if (!BYTES_ARE_IN_FRAME(offset, len, it_len)) {
ld->other++;
static gint mac_lte_framenum_instance_hash_equal(gconstpointer v, gconstpointer v2)
{
- drx_state_key_t *p1 = (drx_state_key_t*)v;
- drx_state_key_t *p2 = (drx_state_key_t*)v2;
+ const drx_state_key_t *p1 = (const drx_state_key_t*)v;
+ const drx_state_key_t *p2 = (const drx_state_key_t*)v2;
+
return ((p1->frameNumber == p2->frameNumber) &&
(p1->pdu_instance == p2->pdu_instance));
}
static guint mac_lte_framenum_instance_hash_func(gconstpointer v)
{
- drx_state_key_t *p1 = (drx_state_key_t*)v;
+ const drx_state_key_t *p1 = (const drx_state_key_t*)v;
+
+ /* XXX which one return ? */
return p1->frameNumber + (p1->pdu_instance >> 8);
return GPOINTER_TO_UINT(v);
}
static gboolean
v9_v10_tmplt_table_equal(gconstpointer k1, gconstpointer k2)
{
- const v9_v10_tmplt_t *ta = (v9_v10_tmplt_t *)k1;
- const v9_v10_tmplt_t *tb = (v9_v10_tmplt_t *)k2;
+ const v9_v10_tmplt_t *ta = (const v9_v10_tmplt_t *)k1;
+ const v9_v10_tmplt_t *tb = (const v9_v10_tmplt_t *)k2;
return (
(CMP_ADDRESS(&ta->src_addr, &tb->src_addr) == 0) &&
static guint
v9_v10_tmplt_table_hash(gconstpointer k)
{
- const v9_v10_tmplt_t *tmplt_p = (v9_v10_tmplt_t *)k;
+ const v9_v10_tmplt_t *tmplt_p = (const v9_v10_tmplt_t *)k;
guint32 val;
val = tmplt_p->src_id + (tmplt_p->tmplt_id << 9) + tmplt_p->src_port + tmplt_p->dst_port;
epan_dissect_t *edt _U_,
const void *p) /* Used for getting SMPP command_id values */
{
- smpp_tap_rec_t* tap_rec = (smpp_tap_rec_t*)p;
+ const smpp_tap_rec_t* tap_rec = (const smpp_tap_rec_t*)p;
tick_stat_node(st, "SMPP Operations", 0, TRUE);
if (hash_info->dst_addr.type == AT_IPv4) {
ti = proto_tree_add_ipv4( socks_tree, hf_socks_ip_dst, tvb,
- offset, 0, *((guint32*)hash_info->dst_addr.data));
+ offset, 0, *((const guint32*)hash_info->dst_addr.data));
PROTO_ITEM_SET_GENERATED(ti);
} else if (hash_info->dst_addr.type == AT_IPv6) {
ti = proto_tree_add_ipv6( socks_tree, hf_socks_ip6_dst, tvb,
/* We haven't turned checksum checking off; checksum it. */
/* 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;
switch (pinfo->src.type) {
proto_tree_add_uint(bf_tree, hf_tr_fc_type, tr_tvb, 1, 1, trh->fc);
proto_tree_add_uint(bf_tree, hf_tr_fc_pcf, tr_tvb, 1, 1, trh->fc);
- proto_tree_add_ether(tr_tree, hf_tr_dst, tr_tvb, 2, 6, (guint8 *)trh->dst.data);
- proto_tree_add_ether(tr_tree, hf_tr_src, tr_tvb, 8, 6, (guint8 *)trh->src.data);
- hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 2, 6, (guint8 *)trh->dst.data);
+ proto_tree_add_ether(tr_tree, hf_tr_dst, tr_tvb, 2, 6, (const guint8 *)trh->dst.data);
+ proto_tree_add_ether(tr_tree, hf_tr_src, tr_tvb, 8, 6, (const guint8 *)trh->src.data);
+ hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 2, 6, (const guint8 *)trh->dst.data);
PROTO_ITEM_SET_HIDDEN(hidden_item);
- hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 8, 6, (guint8 *)trh->src.data);
+ hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 8, 6, (const guint8 *)trh->src.data);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_boolean(tr_tree, hf_tr_sr, tr_tvb, 8, 1, source_routed);
epan_dissect_t *edt _U_,
const void *p) /* Used for getting UCP stats */
{
- ucp_tap_rec_t *tap_rec = (ucp_tap_rec_t*)p;
+ const ucp_tap_rec_t *tap_rec = (const ucp_tap_rec_t*)p;
tick_stat_node(st, st_str_ucp, 0, TRUE);
DebugLog(("STAG: LITERAL tag (peek = 0x%02X, off = %u) - TableRef follows!\n", peek, off));
idx = tvb_get_guintvar (tvb, off+1, &tag_len);
str_len = tvb_strsize (tvb, str_tbl+idx);
- tag_new_literal = (gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len);
+ tag_new_literal = (const gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len);
tag_new_known = 0; /* invalidate known tag_new */
} else { /* Known tag */
tag_new_known = peek & 0x3F;
" - TableRef follows!\n", peek, off));
idx = tvb_get_guintvar (tvb, off+1, &tag_len);
str_len = tvb_strsize (tvb, str_tbl+idx);
- tag_new_literal = (gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len);
+ tag_new_literal = (const gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len);
tag_new_known = 0; /* invalidate known tag_new */
} else { /* Known tag */
tag_new_known = peek & 0x3F;
comparestat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg2)
{
compstat_t *cs=(compstat_t *)arg;
- const ws_ip *ci=(ws_ip *)arg2;
+ const ws_ip *ci=(const ws_ip *)arg2;
frame_info *fInfo, *fInfoTemp;
vec_t cksum_vec[3];
guint16 computed_cksum=0;
cksum_vec[1].ptr=&ci->ip_p;
cksum_vec[1].len=1;
/* skip header checksum and ip's (because of NAT)*/
- cksum_vec[2].ptr=(guint8 *)ci->ip_dst.data;
+ cksum_vec[2].ptr=(const guint8 *)ci->ip_dst.data;
cksum_vec[2].ptr=cksum_vec[2].ptr+ci->ip_dst.len;
/* dynamic computation */
cksum_vec[2].len=ci->ip_len-20;
static int
diameterstat_packet(void *pdiameter, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pdi)
{
- const diameter_req_ans_pair_t *diameter=(diameter_req_ans_pair_t *)pdi;
+ const diameter_req_ans_pair_t *diameter=(const diameter_req_ans_pair_t *)pdi;
diameterstat_t *fs=(diameterstat_t *)pdiameter;
int* idx = NULL;
const void *data)
{
gsm_a_stat_t *stat_p = (gsm_a_stat_t *)tapdata;
- const gsm_a_tap_rec_t *data_p = (gsm_a_tap_rec_t *)data;
+ const gsm_a_tap_rec_t *data_p = (const gsm_a_tap_rec_t *)data;
switch (data_p->pdu_type)
{
const void *data)
{
gsm_map_stat_t *stat_p = (gsm_map_stat_t *)tapdata;
- const gsm_map_tap_rec_t *data_p = (gsm_map_tap_rec_t *)data;
+ const gsm_map_tap_rec_t *data_p = (const gsm_map_tap_rec_t *)data;
#if 0 /* always false because message_type is 8 bit value */
if (data_p->opr_code_idx > sizeof(stat_p->opr_code))
h225counter_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *phi)
{
h225counter_t *hs=(h225counter_t *)phs;
- const h225_packet_info *pi=(h225_packet_info *)phi;
+ const h225_packet_info *pi=(const h225_packet_info *)phi;
switch (pi->msg_type) {
h225rassrt_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *phi)
{
h225rassrt_t *hs=(h225rassrt_t *)phs;
- const h225_packet_info *pi=(h225_packet_info *)phi;
+ const h225_packet_info *pi=(const h225_packet_info *)phi;
ras_type rasmsg_type = RAS_OTHER;
ras_category rascategory = RAS_OTHERS;
eth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
{
hostlist_table *hosts=(hostlist_table *)pit;
- const eth_hdr *ehdr=(eth_hdr *)vip;
+ const eth_hdr *ehdr=(const eth_hdr *)vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
{
hostlist_table *hosts=(hostlist_table *)pit;
- const wlan_hdr *whdr=(wlan_hdr *)vip;
+ const wlan_hdr *whdr=(const wlan_hdr *)vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
iax2_packet(void *user_data_arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *iax2info_arg)
{
user_data_t *user_data = (user_data_t *)user_data_arg;
- const struct _iax2_info_t *iax2info = (struct _iax2_info_t *)iax2info_arg;
+ const struct _iax2_info_t *iax2info = (const struct _iax2_info_t *)iax2info_arg;
/* we ignore packets that are not displayed */
if (pinfo->fd->flags.passed_dfilter == 0)
ncpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv)
{
ncpstat_t *ss=(ncpstat_t *)pss;
- const ncp_req_hash_value *request_val=(ncp_req_hash_value *)prv;
+ const ncp_req_hash_value *request_val=(const ncp_req_hash_value *)prv;
/* if we havent seen the request, just ignore it */
if(!request_val || request_val->ncp_rec==0){
static gboolean
rpcprogs_packet(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg)
{
- const rpc_call_info_value *ri = (rpc_call_info_value *)arg;
+ const rpc_call_info_value *ri = (const rpc_call_info_value *)arg;
nstime_t delta;
rpc_program_t *rp;
rpcstat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg2)
{
rpcstat_t *rs = (rpcstat_t *)arg;
- const rpc_call_info_value *ri = (rpc_call_info_value *)arg2;
+ const rpc_call_info_value *ri = (const rpc_call_info_value *)arg2;
/* we are only interested in reply packets */
if(ri->request){
rtp_packet(void *user_data_arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *rtpinfo_arg)
{
user_data_t *user_data = (user_data_t *)user_data_arg;
- const struct _rtp_info *rtpinfo = (struct _rtp_info *)rtpinfo_arg;
+ const struct _rtp_info *rtpinfo = (const struct _rtp_info *)rtpinfo_arg;
gboolean rtp_selected = FALSE;
/* we ignore packets that are not displayed */
/****************************************************************************/
static gint rtp_stream_info_cmp_reverse(gconstpointer aa, gconstpointer bb)
{
- const struct _rtp_stream_info* a = (struct _rtp_stream_info *)aa;
- const struct _rtp_stream_info* b = (struct _rtp_stream_info *)bb;
+ const struct _rtp_stream_info* a = (const struct _rtp_stream_info *)aa;
+ const struct _rtp_stream_info* b = (const struct _rtp_stream_info *)bb;
if (a==NULL || b==NULL)
return 1;
static int
sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri)
{
- const sip_info_value_t *value = (sip_info_value_t *)pri;
+ const sip_info_value_t *value = (const sip_info_value_t *)pri;
sipstat_t *sp = (sipstat_t *)psp;
/* Total number of packets, including continuation packets */
GString *s = g_string_sized_new( len*2 + 1 );
guint i;
- for (i=0; i<len;i++) g_string_append_printf(s, "%.2X", ((guint8*)ptr)[i]);
+ for (i=0; i<len;i++) g_string_append_printf(s, "%.2X", ((const guint8*)ptr)[i]);
out = ep_strdup(s->str);
}
case PT_TXTMOD_ENUM: {
gint idx = *(int*)e;
- text = (idx >= 0) ? ((value_string *)(f[colnum].fld_data))[idx].strptr : "";
+ text = (idx >= 0) ? ((const value_string *)(f[colnum].fld_data))[idx].strptr : "";
len = (unsigned) strlen(text);
break;
}