From beroset:
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48426
This commit is contained in:
parent
3eb06be97d
commit
6bde918078
|
@ -579,13 +579,13 @@ lowpan_context_find(guint8 cid, guint16 pan)
|
|||
/* Lookup the context from the table. */
|
||||
key.pan = pan;
|
||||
key.cid = cid;
|
||||
data = g_hash_table_lookup(lowpan_context_table, &key);
|
||||
data = (lowpan_context_data *)g_hash_table_lookup(lowpan_context_table, &key);
|
||||
if (data) return data;
|
||||
|
||||
/* If we didn't find a match, try again with the broadcast PAN. */
|
||||
if (pan != IEEE802154_BCAST_PAN) {
|
||||
key.pan = IEEE802154_BCAST_PAN;
|
||||
data = g_hash_table_lookup(lowpan_context_table, &key);
|
||||
data = (lowpan_context_data *)g_hash_table_lookup(lowpan_context_table, &key);
|
||||
if (data) return data;
|
||||
}
|
||||
|
||||
|
@ -625,7 +625,7 @@ lowpan_context_insert(guint8 cid, guint16 pan, guint8 plen, struct e_in6_addr *p
|
|||
key.cid = cid;
|
||||
if (g_hash_table_lookup_extended(lowpan_context_table, &key, &pkey, &pdata)) {
|
||||
/* Context already exists. */
|
||||
data = pdata;
|
||||
data = (lowpan_context_data *)pdata;
|
||||
if ( (data->plen == plen) && (memcmp(&data->prefix, prefix, (plen+7)/8) == 0) ) {
|
||||
/* Context already exists with no change. */
|
||||
return;
|
||||
|
@ -636,7 +636,7 @@ lowpan_context_insert(guint8 cid, guint16 pan, guint8 plen, struct e_in6_addr *p
|
|||
}
|
||||
|
||||
/* Create a new context */
|
||||
data = se_alloc(sizeof(lowpan_context_data));
|
||||
data = se_new(lowpan_context_data);
|
||||
data->frame = frame;
|
||||
data->plen = plen;
|
||||
memset(&data->prefix, 0, sizeof(struct e_in6_addr)); /* Ensure zero paddeding */
|
||||
|
|
|
@ -1867,7 +1867,7 @@ dissect_amqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
conv = find_or_create_conversation(pinfo);
|
||||
conn = (amqp_conv *)conversation_get_proto_data(conv, proto_amqp);
|
||||
if (conn == NULL) {
|
||||
conn = se_alloc0(sizeof(amqp_conv));
|
||||
conn = se_new0(amqp_conv);
|
||||
conversation_add_proto_data(conv, proto_amqp, conn);
|
||||
}
|
||||
check_amqp_version(tvb, conn);
|
||||
|
|
|
@ -560,7 +560,7 @@ dissect_ancp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANCP");
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
|
||||
ancp_info = ep_alloc(sizeof(struct ancp_tap_t));
|
||||
ancp_info = ep_new(struct ancp_tap_t);
|
||||
ancp_info->ancp_mtype = 0;
|
||||
ancp_info->ancp_adjcode = 0;
|
||||
|
||||
|
|
|
@ -5062,7 +5062,7 @@ static void
|
|||
dissect_r3_cmd_response (tvbuff_t *tvb, guint32 start_offset, guint32 length, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
guint8 responseLen = tvb_get_guint8 (tvb, start_offset + 0);
|
||||
responseType_e responseType = tvb_get_guint8 (tvb, start_offset + 2);
|
||||
responseType_e responseType = (responseType_e)tvb_get_guint8 (tvb, start_offset + 2);
|
||||
tvbuff_t *payload_tvb = tvb_new_subset (tvb, start_offset, responseLen, responseLen);
|
||||
|
||||
if (tree)
|
||||
|
|
|
@ -179,7 +179,7 @@ static int do_auto_rp_map(tvbuff_t *tvb, int offset, proto_tree *auto_rp_tree)
|
|||
|
||||
/* sizeof map header + n * sizeof encoded group addresses */
|
||||
ti = proto_tree_add_text(auto_rp_tree, tvb, offset, 6 + group_count * 6,
|
||||
"RP %s: %u group%s", ip_to_str((void *)&rp_addr),
|
||||
"RP %s: %u group%s", ip_to_str((guint8 *)&rp_addr),
|
||||
group_count, plurality(group_count, "", "s"));
|
||||
map_tree = proto_item_add_subtree(ti, ett_auto_rp_map);
|
||||
|
||||
|
@ -200,7 +200,7 @@ static int do_auto_rp_map(tvbuff_t *tvb, int offset, proto_tree *auto_rp_tree)
|
|||
mask_len = tvb_get_guint8(tvb, offset + 1);
|
||||
group_addr = tvb_get_ipv4(tvb, offset + 2);
|
||||
gi = proto_tree_add_text(map_tree, tvb, offset, 6, "Group %s/%u (%s)",
|
||||
ip_to_str((void *)&group_addr), mask_len,
|
||||
ip_to_str((guint8 *)&group_addr), mask_len,
|
||||
val_to_str_const(sign&AUTO_RP_SIGN_MASK, auto_rp_mask_sign_vals, ""));
|
||||
grp_tree = proto_item_add_subtree(gi, ett_auto_rp_group);
|
||||
|
||||
|
|
|
@ -867,7 +867,7 @@ dissect_beep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
* elsewhere for other frames
|
||||
*/
|
||||
|
||||
beep_frame_data = se_alloc(sizeof(struct beep_proto_data));
|
||||
beep_frame_data = se_new(struct beep_proto_data);
|
||||
|
||||
beep_frame_data->pl_left = pl_left;
|
||||
beep_frame_data->pl_size = 0;
|
||||
|
|
|
@ -346,10 +346,10 @@ dissect_bencoding_str(tvbuff_t *tvb, packet_info *pinfo _U_,
|
|||
proto_tree_add_item(tree, hf_bittorrent_bstr, tvb, offset+used, stringlen, ENC_ASCII|ENC_NA);
|
||||
|
||||
if (treeadd==1) {
|
||||
proto_item_append_text(ti, " Key: %s", format_text(ep_tvb_memdup(tvb, offset+used, stringlen), stringlen));
|
||||
proto_item_append_text(ti, " Key: %s", format_text((guchar *)ep_tvb_memdup(tvb, offset+used, stringlen), stringlen));
|
||||
}
|
||||
if (treeadd==2) {
|
||||
proto_item_append_text(ti, " Value: %s", format_text(ep_tvb_memdup(tvb, offset+used, stringlen), stringlen));
|
||||
proto_item_append_text(ti, " Value: %s", format_text((guchar *)ep_tvb_memdup(tvb, offset+used, stringlen), stringlen));
|
||||
}
|
||||
}
|
||||
return used+stringlen;
|
||||
|
|
|
@ -143,7 +143,7 @@ dissect_remunk_remqueryinterface_resp(tvbuff_t *tvb, int offset,
|
|||
e_uuid_t iid;
|
||||
e_uuid_t iid_null = DCERPC_UUID_NULL;
|
||||
dcerpc_info *info = (dcerpc_info *) pinfo->private_data;
|
||||
remunk_remqueryinterface_call_t *call = info->call_data->private_data;
|
||||
remunk_remqueryinterface_call_t *call = (remunk_remqueryinterface_call_t *)info->call_data->private_data;
|
||||
guint64 oxid;
|
||||
guint64 oid;
|
||||
e_uuid_t ipid;
|
||||
|
@ -185,7 +185,7 @@ dissect_remunk_remqueryinterface_resp(tvbuff_t *tvb, int offset,
|
|||
/* add interface instance to database (we currently only handle IPv4) */
|
||||
if(pinfo->net_src.type == AT_IPv4) {
|
||||
dcom_interface_new(pinfo,
|
||||
pinfo->net_src.data,
|
||||
(guint8 *)pinfo->net_src.data,
|
||||
&iid, oxid, oid, &ipid);
|
||||
}
|
||||
|
||||
|
|
|
@ -1655,7 +1655,7 @@ static void dmp_add_seq_ack_analysis (tvbuff_t *tvb, packet_info *pinfo,
|
|||
static gchar *dissect_7bit_string (tvbuff_t *tvb, gint offset, gint length)
|
||||
{
|
||||
guchar *encoded = tvb_get_ephemeral_string (tvb, offset, length);
|
||||
guchar *decoded = ep_alloc0 ((size_t)(length * 1.2) + 1);
|
||||
guchar *decoded = (guchar *)ep_alloc0 ((size_t)(length * 1.2) + 1);
|
||||
guchar rest = 0, bits = 1;
|
||||
gint len = 0, i;
|
||||
|
||||
|
@ -1725,7 +1725,7 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo,
|
|||
gchar *sic = NULL;
|
||||
|
||||
key = tvb_get_guint8 (tvb, offset);
|
||||
sic = ep_alloc (MAX_SIC_LEN);
|
||||
sic = (gchar *)ep_alloc (MAX_SIC_LEN);
|
||||
|
||||
if (key <= 0xB6) {
|
||||
/* 2 bytes, single 3-character SIC, characters [A-Z0-9] only */
|
||||
|
@ -4970,7 +4970,7 @@ void proto_register_dmp (void)
|
|||
sizeof(dmp_security_class_t),
|
||||
"dmp_security_classifications",
|
||||
TRUE,
|
||||
(void*) &dmp_security_classes,
|
||||
(void**) &dmp_security_classes,
|
||||
&num_dmp_security_classes,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChDMPSecurityClassifications",
|
||||
|
|
|
@ -830,7 +830,7 @@ expand_dns_name(tvbuff_t *tvb, int offset, int max_len, int dns_data_offset,
|
|||
* to put the dissector into a loop. Instead we throw an exception */
|
||||
|
||||
maxname=MAXDNAME;
|
||||
np=ep_alloc(maxname);
|
||||
np=(guchar *)ep_alloc(maxname);
|
||||
*name=np;
|
||||
|
||||
maxname--; /* reserve space for the trailing '\0' */
|
||||
|
|
|
@ -1426,7 +1426,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
case ERF_TYPE_COLOR_HDLC_POS:
|
||||
case ERF_TYPE_DSM_COLOR_HDLC_POS:
|
||||
case ERF_TYPE_COLOR_MC_HDLC_POS:
|
||||
hdlc_type = erf_hdlc_type;
|
||||
hdlc_type = (erf_hdlc_type_vals)erf_hdlc_type;
|
||||
|
||||
if (hdlc_type == ERF_HDLC_GUESS) {
|
||||
/* Try to guess the type. */
|
||||
|
|
|
@ -763,7 +763,7 @@ dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
guint8 g8;
|
||||
guint16 tag;
|
||||
guint32 len;
|
||||
void *ptr = NULL;
|
||||
guint8 *ptr = NULL;
|
||||
unsigned int i;
|
||||
|
||||
tag = tvb_get_guint8(tvb, pos++) & 0x7f;
|
||||
|
|
|
@ -136,8 +136,8 @@ static dissector_handle_t data_handle;
|
|||
static gint
|
||||
fcdns_equal(gconstpointer v, gconstpointer w)
|
||||
{
|
||||
const fcdns_conv_key_t *v1 = v;
|
||||
const fcdns_conv_key_t *v2 = w;
|
||||
const fcdns_conv_key_t *v1 = (const fcdns_conv_key_t *)v;
|
||||
const fcdns_conv_key_t *v2 = (const fcdns_conv_key_t *)w;
|
||||
|
||||
return (v1->conv_idx == v2->conv_idx);
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ fcdns_equal(gconstpointer v, gconstpointer w)
|
|||
static guint
|
||||
fcdns_hash (gconstpointer v)
|
||||
{
|
||||
const fcdns_conv_key_t *key = v;
|
||||
const fcdns_conv_key_t *key = (const fcdns_conv_key_t *)v;
|
||||
guint val;
|
||||
|
||||
val = key->conv_idx;
|
||||
|
@ -1506,10 +1506,10 @@ dissect_fcdns (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
cdata->opcode = opcode;
|
||||
}
|
||||
else {
|
||||
req_key = se_alloc (sizeof(fcdns_conv_key_t));
|
||||
req_key = se_new(fcdns_conv_key_t);
|
||||
req_key->conv_idx = conversation->index;
|
||||
|
||||
cdata = se_alloc (sizeof(fcdns_conv_data_t));
|
||||
cdata = se_new(fcdns_conv_data_t);
|
||||
cdata->opcode = opcode;
|
||||
|
||||
g_hash_table_insert (fcdns_req_hash, req_key, cdata);
|
||||
|
|
|
@ -96,8 +96,8 @@ static dissector_handle_t data_handle;
|
|||
static gint
|
||||
fcfcs_equal(gconstpointer v, gconstpointer w)
|
||||
{
|
||||
const fcfcs_conv_key_t *v1 = v;
|
||||
const fcfcs_conv_key_t *v2 = w;
|
||||
const fcfcs_conv_key_t *v1 = (const fcfcs_conv_key_t *)v;
|
||||
const fcfcs_conv_key_t *v2 = (const fcfcs_conv_key_t *)w;
|
||||
|
||||
return (v1->conv_idx == v2->conv_idx);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ fcfcs_equal(gconstpointer v, gconstpointer w)
|
|||
static guint
|
||||
fcfcs_hash (gconstpointer v)
|
||||
{
|
||||
const fcfcs_conv_key_t *key = v;
|
||||
const fcfcs_conv_key_t *key = (const fcfcs_conv_key_t *)v;
|
||||
guint val;
|
||||
|
||||
val = key->conv_idx;
|
||||
|
@ -817,10 +817,10 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
cdata->opcode = opcode;
|
||||
}
|
||||
else {
|
||||
req_key = se_alloc (sizeof(fcfcs_conv_key_t));
|
||||
req_key = se_new(fcfcs_conv_key_t);
|
||||
req_key->conv_idx = conversation->index;
|
||||
|
||||
cdata = se_alloc (sizeof(fcfcs_conv_data_t));
|
||||
cdata = se_new(fcfcs_conv_data_t);
|
||||
cdata->opcode = opcode;
|
||||
|
||||
g_hash_table_insert (fcfcs_req_hash, req_key, cdata);
|
||||
|
|
|
@ -89,8 +89,8 @@ static dissector_handle_t data_handle;
|
|||
static gint
|
||||
fcfzs_equal(gconstpointer v, gconstpointer w)
|
||||
{
|
||||
const fcfzs_conv_key_t *v1 = v;
|
||||
const fcfzs_conv_key_t *v2 = w;
|
||||
const fcfzs_conv_key_t *v1 = (const fcfzs_conv_key_t *)v;
|
||||
const fcfzs_conv_key_t *v2 = (const fcfzs_conv_key_t *)w;
|
||||
|
||||
return (v1->conv_idx == v2->conv_idx);
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ fcfzs_equal(gconstpointer v, gconstpointer w)
|
|||
static guint
|
||||
fcfzs_hash(gconstpointer v)
|
||||
{
|
||||
const fcfzs_conv_key_t *key = v;
|
||||
const fcfzs_conv_key_t *key = (const fcfzs_conv_key_t *)v;
|
||||
guint val;
|
||||
|
||||
val = key->conv_idx;
|
||||
|
@ -657,10 +657,10 @@ dissect_fcfzs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
cdata->opcode = opcode;
|
||||
}
|
||||
else {
|
||||
req_key = se_alloc(sizeof(fcfzs_conv_key_t));
|
||||
req_key = se_new(fcfzs_conv_key_t);
|
||||
req_key->conv_idx = conversation->index;
|
||||
|
||||
cdata = se_alloc(sizeof(fcfzs_conv_data_t));
|
||||
cdata = se_new(fcfzs_conv_data_t);
|
||||
cdata->opcode = opcode;
|
||||
|
||||
g_hash_table_insert(fcfzs_req_hash, req_key, cdata);
|
||||
|
|
|
@ -1822,9 +1822,9 @@ static const true_false_string tfs_do_not_clear_clear = { "Do not clear", "Clear
|
|||
static const true_false_string tfs_confirmed_unconfirmed = { "Confirmed", "Unconfirmed" };
|
||||
|
||||
static const char *
|
||||
val_to_str_err_code(guint8 class, guint8 code)
|
||||
val_to_str_err_code(guint8 errclass, guint8 code)
|
||||
{
|
||||
switch (class) {
|
||||
switch (errclass) {
|
||||
case 1:
|
||||
return (val_to_str_const(code, names_err_code_vfd_state, "Unknown"));
|
||||
|
||||
|
|
|
@ -317,15 +317,15 @@ dissect_fix_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
switch (fix_fields[i].type) {
|
||||
case 1: /* strings */
|
||||
proto_tree_add_string_format_value(fix_tree, fix_fields[i].hf_id, tvb, field_offset, tag->field_len, value,
|
||||
"%s (%s)", value, str_to_str(value, fix_fields[i].table, "unknown %s"));
|
||||
"%s (%s)", value, str_to_str(value, (string_string *)fix_fields[i].table, "unknown %s"));
|
||||
break;
|
||||
case 2: /* char */
|
||||
proto_tree_add_string_format_value(fix_tree, fix_fields[i].hf_id, tvb, field_offset, tag->field_len, value,
|
||||
"%s (%s)", value, val_to_str(*value, fix_fields[i].table, "unknown %d"));
|
||||
"%s (%s)", value, val_to_str(*value, (value_string *)fix_fields[i].table, "unknown %d"));
|
||||
break;
|
||||
default:
|
||||
proto_tree_add_string_format_value(fix_tree, fix_fields[i].hf_id, tvb, field_offset, tag->field_len, value,
|
||||
"%s (%s)", value, val_to_str(atoi(value), fix_fields[i].table, "unknown %d"));
|
||||
"%s (%s)", value, val_to_str(atoi(value), (value_string *)fix_fields[i].table, "unknown %d"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ dissect_fmp_notify_status(tvbuff_t *tvb, int offset, proto_tree *tree, int *rval
|
|||
{
|
||||
fmpStat status;
|
||||
|
||||
status = tvb_get_ntohl(tvb, offset);
|
||||
status = (fmpStat)tvb_get_ntohl(tvb, offset);
|
||||
|
||||
switch (status) {
|
||||
case FMP_OK:
|
||||
|
@ -168,7 +168,7 @@ dissect_revokeHandleListReason(tvbuff_t *tvb, int offset, proto_tree *tree)
|
|||
revokeHandleListReason reason;
|
||||
|
||||
if (tree) {
|
||||
reason = tvb_get_ntohl(tvb, offset);
|
||||
reason = (revokeHandleListReason)tvb_get_ntohl(tvb, offset);
|
||||
switch (reason) {
|
||||
case FMP_LIST_USER_QUOTA_EXCEEDED:
|
||||
proto_tree_add_text(tree, tvb, offset, 4, "Reason: %s",
|
||||
|
|
|
@ -434,7 +434,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
|
|||
}
|
||||
|
||||
if(pinfo->fd->color_filter != NULL) {
|
||||
const color_filter_t *color_filter = pinfo->fd->color_filter;
|
||||
const color_filter_t *color_filter = (const color_filter_t *)pinfo->fd->color_filter;
|
||||
item = proto_tree_add_string(fh_tree, hf_frame_color_filter_name, tvb,
|
||||
0, 0, color_filter->filter_name);
|
||||
PROTO_ITEM_SET_GENERATED(item);
|
||||
|
|
|
@ -157,7 +157,7 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
if (fw1_with_uuid)
|
||||
iface_len = 6;
|
||||
|
||||
interface_name=ep_alloc(iface_len+1);
|
||||
interface_name=(char *)ep_alloc(iface_len+1);
|
||||
tvb_get_nstringz0(tvb, 2, iface_len+1, interface_name);
|
||||
|
||||
/* Known interface name - if not, remember it */
|
||||
|
|
|
@ -419,7 +419,7 @@ gadu_gadu_create_conversation(packet_info *pinfo, guint32 uin)
|
|||
struct gadu_gadu_conv_data *gg_conv;
|
||||
|
||||
conv = find_or_create_conversation(pinfo);
|
||||
gg_conv = conversation_get_proto_data(conv, proto_gadu_gadu);
|
||||
gg_conv = (struct gadu_gadu_conv_data *)conversation_get_proto_data(conv, proto_gadu_gadu);
|
||||
if (!gg_conv) {
|
||||
gg_conv = se_new(struct gadu_gadu_conv_data);
|
||||
gg_conv->uin = uin;
|
||||
|
@ -437,7 +437,7 @@ gadu_gadu_get_conversation_data(packet_info *pinfo)
|
|||
|
||||
conv = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
|
||||
if (conv)
|
||||
return conversation_get_proto_data(conv, proto_gadu_gadu);
|
||||
return (struct gadu_gadu_conv_data *)conversation_get_proto_data(conv, proto_gadu_gadu);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1047,7 +1047,7 @@ dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
/* SI1 or SI2 */
|
||||
if (is_si1) {
|
||||
SystemInformation1_t *data;
|
||||
data = ep_alloc(sizeof(SystemInformation1_t));
|
||||
data = ep_new(SystemInformation1_t);
|
||||
csnStreamDissector(bcch_tree, &ar, CSNDESCR(SystemInformation1_t), tvb, data, ett_gmr1_bcch);
|
||||
col_append_fstr(
|
||||
pinfo->cinfo, COL_INFO,
|
||||
|
@ -1056,7 +1056,7 @@ dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
);
|
||||
} else {
|
||||
SystemInformation2_t *data;
|
||||
data = ep_alloc(sizeof(SystemInformation2_t));
|
||||
data = ep_new(SystemInformation2_t);
|
||||
csnStreamDissector(bcch_tree, &ar, CSNDESCR(SystemInformation2_t), tvb, data, ett_gmr1_bcch);
|
||||
col_append_fstr(
|
||||
pinfo->cinfo, COL_INFO,
|
||||
|
|
|
@ -89,7 +89,7 @@ dissect_gmr1_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
/* Get message parameters */
|
||||
oct[1] = tvb_get_guint8(tvb, offset);
|
||||
|
||||
gmr1_get_msg_params(pd, oct[1], &msg_str, &ett_tree, &hf_idx, &msg_func);
|
||||
gmr1_get_msg_params((gmr1_pd_e)pd, oct[1], &msg_str, &ett_tree, &hf_idx, &msg_func);
|
||||
|
||||
/* Create protocol tree */
|
||||
if (msg_str == NULL)
|
||||
|
|
|
@ -2950,7 +2950,7 @@ static guint16
|
|||
de_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint fac_len, gchar *add_string _U_, int string_len _U_)
|
||||
{
|
||||
guint saved_offset;
|
||||
gint8 class;
|
||||
gint8 appclass;
|
||||
gboolean pc;
|
||||
gboolean ind = FALSE;
|
||||
guint32 component_len = 0;
|
||||
|
@ -2972,7 +2972,7 @@ de_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset,
|
|||
|
||||
/* Get the length of the component there can be more than one component in a facility message */
|
||||
|
||||
header_end_offset = get_ber_identifier(tvb, offset, &class, &pc, &comp_type_tag);
|
||||
header_end_offset = get_ber_identifier(tvb, offset, &appclass, &pc, &comp_type_tag);
|
||||
header_end_offset = get_ber_length(tvb, header_end_offset, &component_len, &ind);
|
||||
header_len = header_end_offset - offset;
|
||||
component_len = header_len + component_len;
|
||||
|
@ -6615,7 +6615,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
tap_p->pdu_type = GSM_A_PDU_TYPE_DTAP;
|
||||
tap_p->message_type = (nsd ? (oct & 0x3f) : oct);
|
||||
tap_p->protocol_disc = pd;
|
||||
tap_p->protocol_disc = (gsm_a_pd_str_e)pd;
|
||||
|
||||
tap_queue_packet(gsm_a_tap, pinfo, tap_p);
|
||||
|
||||
|
|
|
@ -10626,7 +10626,7 @@ dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
tap_p->pdu_type = GSM_A_PDU_TYPE_DTAP;
|
||||
tap_p->message_type = (nsd ? (oct & 0x3f) : oct);
|
||||
tap_p->protocol_disc = pd;
|
||||
tap_p->protocol_disc = (gsm_a_pd_str_e)pd;
|
||||
|
||||
tap_queue_packet(gsm_a_tap, pinfo, tap_p);
|
||||
|
||||
|
@ -10780,7 +10780,7 @@ dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
tap_p->pdu_type = GSM_A_PDU_TYPE_SACCH;
|
||||
tap_p->message_type = mess_type;
|
||||
tap_p->protocol_disc = short_pd;
|
||||
tap_p->protocol_disc = (gsm_a_pd_str_e)short_pd;
|
||||
|
||||
tap_queue_packet(gsm_a_tap, pinfo, tap_p);
|
||||
|
||||
|
|
|
@ -948,11 +948,11 @@ dissect_om2k_attrs(tvbuff_t *tvb, gint offset, proto_tree *tree)
|
|||
static guint
|
||||
dissect_om2k_mo(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
guint8 class = tvb_get_guint8(tvb, offset);
|
||||
guint8 mo_class = tvb_get_guint8(tvb, offset);
|
||||
guint8 inst = tvb_get_guint8(tvb, offset+3);
|
||||
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, ", (%-4s %u)",
|
||||
val_to_str(class, om2k_mo_class_short_vals,
|
||||
val_to_str(mo_class, om2k_mo_class_short_vals,
|
||||
"0x%02x"), inst);
|
||||
if (tree) {
|
||||
proto_item *ti;
|
||||
|
@ -972,7 +972,7 @@ dissect_om2k_mo(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree
|
|||
proto_tree_add_item(mo_tree, hf_om2k_mo_instance, tvb, offset+3,
|
||||
1, ENC_BIG_ENDIAN);
|
||||
proto_item_append_text(ti, ", Class: %s, Sub: %02x/%02x, Instance: %u",
|
||||
val_to_str(class, om2k_mo_class_vals, "0x%02x"),
|
||||
val_to_str(mo_class, om2k_mo_class_vals, "0x%02x"),
|
||||
sub1, sub2, inst);
|
||||
}
|
||||
return 4;
|
||||
|
|
|
@ -514,9 +514,7 @@ typedef enum
|
|||
}
|
||||
bsslap_elem_idx_t;
|
||||
*/
|
||||
elem_fcn bsslap_elem_fcn[];
|
||||
|
||||
guint16 (*bsslap_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string, int string_len) = {
|
||||
elem_fcn bsslap_elem_fcn[] = {
|
||||
/* BSS LAP Elements 5 */
|
||||
NULL, /* Reserved */
|
||||
de_ta, /* Timing Advance */
|
||||
|
|
|
@ -7702,7 +7702,7 @@ dissect_gsm_rlcmac_downlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
RlcMacDownlink_t * data;
|
||||
|
||||
/* allocate a data structure and guess the coding scheme */
|
||||
data = ep_alloc(sizeof(RlcMacDownlink_t));
|
||||
data = ep_new(RlcMacDownlink_t);
|
||||
|
||||
if ((pinfo->private_data != NULL) && (((RlcMacPrivateData_t *)(pinfo->private_data))->magic == GSM_RLC_MAC_MAGIC_NUMBER))
|
||||
{
|
||||
|
@ -7752,7 +7752,7 @@ dissect_gsm_rlcmac_uplink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
RlcMacUplink_t *data;
|
||||
|
||||
/* allocate a data structure and set the coding scheme */
|
||||
data = ep_alloc(sizeof(RlcMacUplink_t));
|
||||
data = ep_new(RlcMacUplink_t);
|
||||
|
||||
if ((pinfo->private_data != NULL) && (((RlcMacPrivateData_t *)(pinfo->private_data))->magic == GSM_RLC_MAC_MAGIC_NUMBER))
|
||||
{
|
||||
|
|
|
@ -439,7 +439,7 @@ dis_field_addr(tvbuff_t *tvb, proto_tree *tree, guint32 *offset_p, const gchar *
|
|||
addrstr = gsm_sms_chars_to_utf8(addrbuf, i);
|
||||
break;
|
||||
default:
|
||||
addrstr = ep_alloc(numdigocts*2 + 1);
|
||||
addrstr = (gchar *)ep_alloc(numdigocts*2 + 1);
|
||||
for (i = 0; i < numdigocts; i++)
|
||||
{
|
||||
oct = tvb_get_guint8(tvb, offset + i);
|
||||
|
@ -1748,7 +1748,7 @@ gsm_sms_chars_to_utf8(const unsigned char* src, int len)
|
|||
}
|
||||
|
||||
/* Now allocate a buffer for the output string and fill it in */
|
||||
outbuf = ep_alloc(outlen + 1);
|
||||
outbuf = (gchar *)ep_alloc(outlen + 1);
|
||||
for (i = 0, j = 0; j < len; j++)
|
||||
{
|
||||
if (char_is_escape(src[j])) {
|
||||
|
@ -2703,7 +2703,7 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb
|
|||
}
|
||||
|
||||
/* Store udl and length for later decoding of reassembled SMS */
|
||||
p_frag_params = se_alloc0(sizeof(sm_fragment_params));
|
||||
p_frag_params = se_new0(sm_fragment_params);
|
||||
p_frag_params->udl = udl;
|
||||
p_frag_params->length = length;
|
||||
g_hash_table_insert(g_sm_fragment_params_table,
|
||||
|
|
|
@ -7859,12 +7859,12 @@ dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
|
|||
/*
|
||||
* Do we already know this conversation?
|
||||
*/
|
||||
gtp_info = conversation_get_proto_data(conversation, proto_gtp);
|
||||
gtp_info = (gtp_conv_info_t *)conversation_get_proto_data(conversation, proto_gtp);
|
||||
if (gtp_info == NULL) {
|
||||
/* No. Attach that information to the conversation, and add
|
||||
* it to the list of information structures.
|
||||
*/
|
||||
gtp_info = g_malloc(sizeof(gtp_conv_info_t));
|
||||
gtp_info = (gtp_conv_info_t *)g_malloc(sizeof(gtp_conv_info_t));
|
||||
/*Request/response matching tables*/
|
||||
gtp_info->matched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_matched);
|
||||
gtp_info->unmatched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_unmatched);
|
||||
|
|
|
@ -294,14 +294,14 @@ static gint ett_h248_3GTFO_codec = -1;
|
|||
|
||||
static void dissect_3GTFO_codec_mode(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* cu _U_, void* ignored _U_) {
|
||||
tvbuff_t* sub_tvb = NULL;
|
||||
gint8 class;
|
||||
gint8 appclass;
|
||||
gboolean pc;
|
||||
gint32 tag;
|
||||
asn1_ctx_t asn1_ctx;
|
||||
|
||||
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
||||
|
||||
get_ber_identifier(tvb, 0, &class, &pc, &tag);
|
||||
get_ber_identifier(tvb, 0, &appclass, &pc, &tag);
|
||||
|
||||
/* XXX: is this enough to guess it? */
|
||||
if (tag==BER_UNI_TAG_OCTETSTRING) {
|
||||
|
@ -319,14 +319,14 @@ static void dissect_3GTFO_codec_mode(proto_tree* tree, tvbuff_t* tvb, packet_inf
|
|||
|
||||
static void dissect_3GTFO_codec_list(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* cu _U_, void* ignored _U_) {
|
||||
tvbuff_t* sub_tvb = NULL;
|
||||
gint8 class;
|
||||
gint8 appclass;
|
||||
gboolean pc;
|
||||
gint32 tag;
|
||||
asn1_ctx_t asn1_ctx;
|
||||
|
||||
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
||||
|
||||
get_ber_identifier(tvb, 0, &class, &pc, &tag);
|
||||
get_ber_identifier(tvb, 0, &appclass, &pc, &tag);
|
||||
|
||||
if (tag==BER_UNI_TAG_OCTETSTRING) {
|
||||
dissect_ber_octet_string(FALSE, &asn1_ctx, tree, tvb, 0, hfid, &sub_tvb );
|
||||
|
|
|
@ -287,14 +287,14 @@ static gint ett_h248_pkg_bt_bit= -1;
|
|||
|
||||
static void dissect_bt_tunneled_proto(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* i _U_, void* d _U_) {
|
||||
tvbuff_t* bctp_tvb = NULL;
|
||||
gint8 class;
|
||||
gint8 appclass;
|
||||
gboolean pc;
|
||||
gint32 tag;
|
||||
asn1_ctx_t asn1_ctx;
|
||||
|
||||
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
||||
|
||||
get_ber_identifier(tvb, 0, &class, &pc, &tag);
|
||||
get_ber_identifier(tvb, 0, &appclass, &pc, &tag);
|
||||
|
||||
/* XXX: is this enough to guess it? */
|
||||
if (tag==BER_UNI_TAG_OCTETSTRING) {
|
||||
|
|
|
@ -398,7 +398,7 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
|
|||
bit_offset = *start_bit_offset;
|
||||
|
||||
/* prepare the string */
|
||||
str = ep_alloc(256);
|
||||
str = (char *)ep_alloc(256);
|
||||
str[0] = '\0';
|
||||
for (bit=0; bit<((int)(bit_offset&0x07)); bit++) {
|
||||
if (bit && (!(bit%4))) {
|
||||
|
@ -1062,7 +1062,7 @@ dissect_h265_unescap_nal_unit(tvbuff_t *tvb, packet_info *pinfo, int offset)
|
|||
int i;
|
||||
gchar *buff;
|
||||
|
||||
buff = g_malloc(length);
|
||||
buff = (gchar *)g_malloc(length);
|
||||
for (i = 0; i < length; i++) {
|
||||
if ((i + 2 < length) && (tvb_get_ntoh24(tvb, offset) == 0x000003)) {
|
||||
buff[NumBytesInRBSP++] = tvb_get_guint8(tvb, offset);
|
||||
|
|
|
@ -268,7 +268,7 @@ static int
|
|||
hartip_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_,
|
||||
epan_dissect_t* edt _U_, const void* p)
|
||||
{
|
||||
const hartip_tap_info *tapinfo = p;
|
||||
const hartip_tap_info *tapinfo = (const hartip_tap_info *)p;
|
||||
const gchar *message_type_node_str, *message_id_node_str;
|
||||
int message_type_node;
|
||||
|
||||
|
@ -385,7 +385,7 @@ dissect_string(proto_tree *tree, int hf, const char *name, int len,
|
|||
proto_item *ti;
|
||||
char *str;
|
||||
|
||||
str = ep_alloc(256);
|
||||
str = (char *)ep_alloc(256);
|
||||
|
||||
ti = proto_tree_add_item(tree, hf, tvb, offset, len, ENC_NA);
|
||||
if (len < 256) {
|
||||
|
@ -411,12 +411,12 @@ dissect_packAscii(proto_tree *tree, int hf, const char *name, int len,
|
|||
guint8 *tmp;
|
||||
char *str = NULL;
|
||||
|
||||
str = ep_alloc(256+1);
|
||||
str = (char *)ep_alloc(256+1);
|
||||
|
||||
ti = proto_tree_add_item(tree, hf, tvb, offset, len, ENC_NA);
|
||||
|
||||
DISSECTOR_ASSERT(len < 3 * (256/4));
|
||||
tmp = ep_alloc0(len);
|
||||
tmp = (guint8 *)ep_alloc0(len);
|
||||
tvb_memcpy(tvb, tmp, offset, len);
|
||||
|
||||
iIndex = 0;
|
||||
|
@ -877,7 +877,7 @@ dissect_hartip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
offset++;
|
||||
|
||||
/* Setup statistics for tap. */
|
||||
tapinfo = ep_alloc(sizeof(hartip_tap_info));
|
||||
tapinfo = ep_new(hartip_tap_info);
|
||||
tapinfo->message_type = message_type;
|
||||
tapinfo->message_id = message_id;
|
||||
tap_queue_packet(hartip_tap, pinfo, tapinfo);
|
||||
|
|
|
@ -150,7 +150,7 @@ hclnfsd_decode_obscure(const char *ident, int ident_len)
|
|||
char *ident_decoded, *ident_out;
|
||||
int j, x, y;
|
||||
|
||||
ident_decoded = ep_alloc(ident_len);
|
||||
ident_decoded = (char *)ep_alloc(ident_len);
|
||||
ident_out = ident_decoded;
|
||||
for (x = -1, j = 0; j < ident_len; j++)
|
||||
{
|
||||
|
|
|
@ -481,9 +481,9 @@ dissect_hip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
/* Checksum - this is the same algorithm from UDP, ICMPv6 */
|
||||
if (!pinfo->fragmented) {
|
||||
/* IPv4 or IPv6 addresses */
|
||||
cksum_vec[0].ptr = pinfo->src.data;
|
||||
cksum_vec[0].ptr = (guint8 *)pinfo->src.data;
|
||||
cksum_vec[0].len = pinfo->src.len;
|
||||
cksum_vec[1].ptr = pinfo->dst.data;
|
||||
cksum_vec[1].ptr = (guint8 *)pinfo->dst.data;
|
||||
cksum_vec[1].len = pinfo->dst.len;
|
||||
|
||||
/* the rest of the pseudo-header */
|
||||
|
|
|
@ -1477,7 +1477,7 @@ dissect_icqv5Client(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
*/
|
||||
rounded_size = ((((capturedsize - ICQ5_CL_SESSIONID) + 3)/4)*4) + ICQ5_CL_SESSIONID;
|
||||
/* rounded_size might exceed the tvb bounds so we can't just use tvb_memdup here. */
|
||||
decr_pd = g_malloc(rounded_size);
|
||||
decr_pd = (guint8 *)g_malloc(rounded_size);
|
||||
tvb_memcpy(tvb, decr_pd, 0, capturedsize);
|
||||
decrypt_v5(decr_pd, rounded_size, key);
|
||||
|
||||
|
|
|
@ -1067,7 +1067,7 @@ static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
|
|||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "104asdu");
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
|
||||
asduh = ep_alloc(sizeof(struct asduheader));
|
||||
asduh = ep_new(struct asduheader);
|
||||
res = ep_strbuf_new_label(NULL);
|
||||
|
||||
/*** *** START: Common to 'Packet List' and 'Packet Details' *** ***/
|
||||
|
@ -1521,7 +1521,7 @@ static void dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
|
|||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "104apci");
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
|
||||
apcih = ep_alloc(sizeof(struct apciheader));
|
||||
apcih = ep_new(struct apciheader);
|
||||
|
||||
/*** *** START: Common to 'Packet List' and 'Packet Details' *** ***/
|
||||
Start = 0;
|
||||
|
|
|
@ -60,7 +60,7 @@ ieee802a_add_oui(guint32 oui, const char *table_name, const char *table_ui_name,
|
|||
{
|
||||
oui_info_t *new_info;
|
||||
|
||||
new_info = g_malloc(sizeof (oui_info_t));
|
||||
new_info = (oui_info_t *)g_malloc(sizeof (oui_info_t));
|
||||
new_info->table = register_dissector_table(table_name,
|
||||
table_ui_name, FT_UINT16, BASE_HEX);
|
||||
new_info->field_info = hf_item;
|
||||
|
@ -113,7 +113,7 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
* Do we have information for this OUI?
|
||||
*/
|
||||
if (oui_info_table != NULL &&
|
||||
(oui_info = g_hash_table_lookup(oui_info_table,
|
||||
(oui_info = (oui_info_t *)g_hash_table_lookup(oui_info_table,
|
||||
GUINT_TO_POINTER(oui))) != NULL) {
|
||||
/*
|
||||
* Yes - use it.
|
||||
|
@ -164,7 +164,7 @@ proto_register_ieee802a(void)
|
|||
static void
|
||||
register_hf(gpointer key _U_, gpointer value, gpointer user_data _U_)
|
||||
{
|
||||
oui_info_t *info = value;
|
||||
oui_info_t *info = (oui_info_t *)value;
|
||||
|
||||
proto_register_field_array(proto_ieee802a, info->field_info, 1);
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ static void dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
/* this is a ugly hack to find the first byte of the IP source address */
|
||||
if (pinfo->net_src.type == AT_IPv4) {
|
||||
ipsrc = pinfo->net_src.data;
|
||||
ipsrc = (guint8 *)pinfo->net_src.data;
|
||||
network = ipsrc[0];
|
||||
} else
|
||||
network = 0; /* XXX - shouldn't happen */
|
||||
|
|
|
@ -78,8 +78,8 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
int iter;
|
||||
int commandlen;
|
||||
|
||||
tokenbuf = ep_alloc(MAX_BUFFER);
|
||||
command_token = ep_alloc(MAX_BUFFER);
|
||||
tokenbuf = (guchar *)ep_alloc(MAX_BUFFER);
|
||||
command_token = (guchar *)ep_alloc(MAX_BUFFER);
|
||||
memset(tokenbuf, '\0', MAX_BUFFER);
|
||||
memset(command_token, '\0', MAX_BUFFER);
|
||||
commandlen = 0;
|
||||
|
|
|
@ -225,7 +225,7 @@ dissect_ib_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
|
|||
return 0; /* no infiniband handle? can't get our proto-data; sorry, can't help you without this */
|
||||
proto_infiniband = dissector_handle_get_protocol_index(infiniband_handle);
|
||||
}
|
||||
convo_data = conversation_get_proto_data(conv, proto_infiniband);
|
||||
convo_data = (conversation_infiniband_data *)conversation_get_proto_data(conv, proto_infiniband);
|
||||
|
||||
if (!(convo_data->service_id & SERVICE_ID_MASK))
|
||||
return 0; /* the service id doesn't match that of SDP - nothing for us to do here */
|
||||
|
|
|
@ -58,7 +58,7 @@ dissect_ipars(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
|
|||
int offset = 0;
|
||||
gchar *eom_msg;
|
||||
|
||||
eom_msg = ep_alloc(MAX_EOM_MSG_SIZE);
|
||||
eom_msg = (gchar *)ep_alloc(MAX_EOM_MSG_SIZE);
|
||||
eom_msg[0] = 0;
|
||||
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
|
|
|
@ -1768,7 +1768,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
if(decrypt_ok && (decrypted_len > esp_iv_len))
|
||||
{
|
||||
tvb_decrypted = tvb_new_child_real_data(tvb, g_memdup(decrypted_data+sizeof(guint8)*esp_iv_len,
|
||||
tvb_decrypted = tvb_new_child_real_data(tvb, (guint8 *)g_memdup(decrypted_data+sizeof(guint8)*esp_iv_len,
|
||||
decrypted_len - esp_iv_len),
|
||||
decrypted_len - esp_iv_len, decrypted_len - esp_iv_len);
|
||||
g_free(decrypted_data);
|
||||
|
@ -2167,7 +2167,7 @@ proto_register_ipsec(void)
|
|||
sizeof(uat_esp_sa_record_t), /* record size */
|
||||
"esp_sa", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void*) &uat_esp_sa_records, /* data_ptr */
|
||||
(void**) &uat_esp_sa_records, /* data_ptr */
|
||||
&num_sa_uat, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* help */
|
||||
|
|
|
@ -1808,7 +1808,7 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
}
|
||||
|
||||
if (tvb_get_guint8(tvb, offset + IP6H_SRC + 8) & 0x02 && tvb_get_ntohs(tvb, offset + IP6H_SRC + 11) == 0xfffe) { /* RFC 4291 appendix A */
|
||||
mac_addr = ep_alloc(6);
|
||||
mac_addr = (guint8 *)ep_alloc(6);
|
||||
tvb_memcpy(tvb, mac_addr, offset + IP6H_SRC + 8, 3);
|
||||
tvb_memcpy(tvb, mac_addr+3, offset+ IP6H_SRC + 13, 3);
|
||||
mac_addr[0] &= ~0x02;
|
||||
|
@ -1895,7 +1895,7 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
}
|
||||
|
||||
if (tvb_get_guint8(tvb, offset + IP6H_DST + 8) & 0x02 && tvb_get_ntohs(tvb, offset + IP6H_DST + 11) == 0xfffe) { /* RFC 4291 appendix A */
|
||||
mac_addr = ep_alloc(6);
|
||||
mac_addr = (guint8 *)ep_alloc(6);
|
||||
tvb_memcpy(tvb, mac_addr, offset + IP6H_DST + 8, 3);
|
||||
tvb_memcpy(tvb, mac_addr+3, offset+ IP6H_DST + 13, 3);
|
||||
mac_addr[0] &= ~0x02;
|
||||
|
|
|
@ -564,7 +564,7 @@ iscsi_dissect_TargetAddress(packet_info *pinfo, proto_tree *tree _U_,char *val)
|
|||
*pgt++ = 0;
|
||||
}
|
||||
|
||||
addr = ep_alloc(sizeof(address));
|
||||
addr = ep_new(address);
|
||||
addr->type = AT_IPv4;
|
||||
addr->len = 4;
|
||||
addr->data = ep_alloc(4);
|
||||
|
@ -744,7 +744,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
|
|||
/* XXX we need a way to handle replayed iscsi itt here */
|
||||
cdata=(iscsi_conv_data_t *)se_tree_lookup32(iscsi_session->itlq, tvb_get_ntohl(tvb, offset+16));
|
||||
if(!cdata){
|
||||
cdata = se_alloc (sizeof(iscsi_conv_data_t));
|
||||
cdata = se_new(iscsi_conv_data_t);
|
||||
cdata->itlq.lun=0xffff;
|
||||
cdata->itlq.scsi_opcode=0xffff;
|
||||
cdata->itlq.task_flags=0;
|
||||
|
@ -814,7 +814,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
|
|||
|
||||
itl=(itl_nexus_t *)se_tree_lookup32(iscsi_session->itl, lun);
|
||||
if(!itl){
|
||||
itl=se_alloc(sizeof(itl_nexus_t));
|
||||
itl=se_new(itl_nexus_t);
|
||||
itl->cmdset=0xff;
|
||||
itl->conversation=conversation;
|
||||
se_tree_insert32(iscsi_session->itl, lun, itl);
|
||||
|
@ -1595,7 +1595,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
|
|||
/* We have a variable length CDB where bytes >16 is transported
|
||||
* in the AHS.
|
||||
*/
|
||||
cdb_buf=g_malloc(16+ahs_cdb_length);
|
||||
cdb_buf=(guint8 *)g_malloc(16+ahs_cdb_length);
|
||||
/* the 16 first bytes of the cdb */
|
||||
tvb_memcpy(tvb, cdb_buf, cdb_offset, 16);
|
||||
/* the remainder of the cdb from the ahs */
|
||||
|
@ -2344,9 +2344,9 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean chec
|
|||
/* make sure we have a conversation for this session */
|
||||
conversation = find_or_create_conversation(pinfo);
|
||||
|
||||
iscsi_session=conversation_get_proto_data(conversation, proto_iscsi);
|
||||
iscsi_session=(iscsi_session_t *)conversation_get_proto_data(conversation, proto_iscsi);
|
||||
if(!iscsi_session){
|
||||
iscsi_session=se_alloc(sizeof(iscsi_session_t));
|
||||
iscsi_session=se_new(iscsi_session_t);
|
||||
iscsi_session->header_digest=ISCSI_HEADER_DIGEST_AUTO;
|
||||
iscsi_session->itlq=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "iSCSI ITLQ");
|
||||
iscsi_session->itl=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "iSCSI ITL");
|
||||
|
|
|
@ -324,7 +324,7 @@ iuup_proto_tree_add_bits(proto_tree* tree, int hf, tvbuff_t* tvb, int offset, in
|
|||
|
||||
DISSECTOR_ASSERT(bit_offset < 8);
|
||||
|
||||
shifted_buffer = ep_tvb_memdup(tvb,offset,len+1);
|
||||
shifted_buffer = (guint8 *)ep_tvb_memdup(tvb,offset,len+1);
|
||||
|
||||
for(i = 0; i < len; i++) {
|
||||
shifted_buffer[i] <<= bit_offset;
|
||||
|
@ -355,7 +355,7 @@ static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr
|
|||
if ( ! dissect_fields ) {
|
||||
return;
|
||||
} else if ( ! pinfo->circuit_id
|
||||
|| ! ( iuup_circuit = g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id)) ) ) {
|
||||
|| ! ( iuup_circuit = (iuup_circuit_t *)g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id)) ) ) {
|
||||
proto_item_set_expert_flags(pi, PI_UNDECODED, PI_WARN);
|
||||
return;
|
||||
}
|
||||
|
@ -409,7 +409,7 @@ static guint dissect_rfcis(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tr
|
|||
guint i;
|
||||
|
||||
do {
|
||||
iuup_rfci_t *rfci = se_alloc0(sizeof(iuup_rfci_t));
|
||||
iuup_rfci_t *rfci = se_new0(iuup_rfci_t);
|
||||
guint len = 0;
|
||||
|
||||
DISSECTOR_ASSERT(c < 64);
|
||||
|
@ -474,15 +474,15 @@ static void dissect_iuup_init(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre
|
|||
iuup_circuit_t* iuup_circuit = NULL;
|
||||
|
||||
if (pinfo->circuit_id) {
|
||||
iuup_circuit = g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id));
|
||||
iuup_circuit = (iuup_circuit_t *)g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id));
|
||||
|
||||
if (iuup_circuit) {
|
||||
g_hash_table_remove(circuits,GUINT_TO_POINTER(pinfo->circuit_id));
|
||||
}
|
||||
|
||||
iuup_circuit = se_alloc0(sizeof(iuup_circuit_t));
|
||||
iuup_circuit = se_new0(iuup_circuit_t);
|
||||
} else {
|
||||
iuup_circuit = ep_alloc0(sizeof(iuup_circuit_t));
|
||||
iuup_circuit = ep_new0(iuup_circuit_t);
|
||||
}
|
||||
|
||||
iuup_circuit->id = pinfo->circuit_id;
|
||||
|
|
|
@ -306,7 +306,7 @@ remove_markers(tvbuff_t *tvb, packet_info *pinfo, guint32 marker_offset,
|
|||
|
||||
/* allocate memory for the marker-free buffer */
|
||||
mfree_buff_length = orig_length - (MPA_MARKER_LEN * num_markers);
|
||||
mfree_buff = g_malloc(mfree_buff_length);
|
||||
mfree_buff = (guint8 *)g_malloc(mfree_buff_length);
|
||||
|
||||
tot_copy = 0;
|
||||
source_offset = 0;
|
||||
|
@ -801,7 +801,7 @@ dissect_iwarp_mpa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
|
|||
/* FPDU */
|
||||
if (tvb_length(tvb) >= MPA_SMALLEST_FPDU_LEN && is_mpa_fpdu(pinfo)) {
|
||||
|
||||
tcpinfo = pinfo->private_data;
|
||||
tcpinfo = (struct tcpinfo *)pinfo->private_data;
|
||||
|
||||
conversation = find_conversation(pinfo->fd->num, &pinfo->src,
|
||||
&pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
|
||||
|
|
|
@ -507,11 +507,11 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
/* Calculate the IFG */
|
||||
|
||||
/* Check for an existing ifg value associated with the frame */
|
||||
p_ifg_info = p_get_proto_data(pinfo->fd, proto_ixveriwave);
|
||||
p_ifg_info = (ifg_info *)p_get_proto_data(pinfo->fd, proto_ixveriwave);
|
||||
if (!p_ifg_info)
|
||||
{
|
||||
/* allocate the space */
|
||||
p_ifg_info = se_alloc0(sizeof(struct ifg_info));
|
||||
p_ifg_info = se_new0(struct ifg_info);
|
||||
|
||||
/* Doesn't exist, so we need to calculate the value */
|
||||
if (previous_frame_data.previous_frame_num !=0 && (pinfo->fd->num - previous_frame_data.previous_frame_num == 1))
|
||||
|
|
|
@ -354,7 +354,7 @@ static void after_value(void *tvbparse_data, const void *wanted_data _U_, tvbpar
|
|||
json_token_type_t value_id = JSON_TOKEN_INVALID;
|
||||
|
||||
if (tok->sub)
|
||||
value_id = tok->sub->id;
|
||||
value_id = (json_token_type_t)tok->sub->id;
|
||||
|
||||
switch (value_id) {
|
||||
case JSON_TOKEN_STRING:
|
||||
|
|
|
@ -693,7 +693,7 @@ static jxta_stream_conversation_data *get_tpt_conversation(packet_info * pinfo)
|
|||
tpt_conv_data = (jxta_stream_conversation_data *) conversation_get_proto_data(tpt_conversation, proto_jxta);
|
||||
|
||||
if (NULL == tpt_conv_data) {
|
||||
tpt_conv_data = se_alloc(sizeof(jxta_stream_conversation_data));
|
||||
tpt_conv_data = se_new(jxta_stream_conversation_data);
|
||||
tpt_conv_data->tpt_ptype = pinfo->ptype;
|
||||
|
||||
SE_COPY_ADDRESS(&tpt_conv_data->initiator_tpt_address, &pinfo->src);
|
||||
|
@ -1257,7 +1257,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree
|
|||
}
|
||||
|
||||
if ((AT_URI == pinfo->src.type) && (AT_URI == pinfo->dst.type)) {
|
||||
jxta_tap_header *tap_header = se_alloc(sizeof(jxta_tap_header));
|
||||
jxta_tap_header *tap_header = se_new(jxta_tap_header);
|
||||
|
||||
tap_header->src_address = pinfo->src;
|
||||
tap_header->dest_address = pinfo->dst;
|
||||
|
@ -1367,7 +1367,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree
|
|||
proto_tree_add_uint(jxta_msg_tree, hf_jxta_message_names_count, tvb, tree_offset, (int)sizeof(guint16), msg_names_count);
|
||||
tree_offset += (int)sizeof(guint16);
|
||||
|
||||
names_table = ep_alloc((msg_names_count + 2) * sizeof(const gchar *));
|
||||
names_table = (const gchar **)ep_alloc((msg_names_count + 2) * sizeof(const gchar *));
|
||||
names_table[0] = "";
|
||||
names_table[1] = "jxta";
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ dissect_kingfisher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
|
|||
|
||||
|
||||
|
||||
kfp=ep_alloc(sizeof(kingfisher_packet_t));
|
||||
kfp=ep_new(kingfisher_packet_t);
|
||||
|
||||
/* Verify that it looks like kingfisher */
|
||||
/* the packet must be at least 9 bytes */
|
||||
|
|
Loading…
Reference in New Issue