From beroset:

remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48355
This commit is contained in:
Anders Broman 2013-03-17 16:48:47 +00:00
parent 9a376b8cd0
commit 81e80f2c0b
14 changed files with 68 additions and 69 deletions

View File

@ -611,7 +611,7 @@ void dfilter_macro_init(void) {
sizeof(dfilter_macro_t),
DFILTER_MACRO_FILENAME,
TRUE,
(void*) &macros,
(void**) &macros,
&num_macros,
0, /* doesn't affect anything that requires a GUI update */
"ChDisplayFilterMacrosSection",

View File

@ -5341,7 +5341,7 @@ proto_register_ber(void)
sizeof(oid_user_t),
"oid",
FALSE,
(void*) &oid_users,
(void**) &oid_users,
&num_oid_users,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChObjectIdentifiers",

View File

@ -6884,7 +6884,7 @@ proto_register_bootp(void)
sizeof(uat_bootp_record_t), /* record size */
"custom_bootp", /* filename */
TRUE, /* from_profile */
(void*) &uat_bootp_records, /* data_ptr */
(void**) &uat_bootp_records,/* data_ptr */
&num_bootp_records_uat, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */

View File

@ -45,8 +45,8 @@
#define CSPT_REPORT
void proto_register_componentstatus(void);
void proto_reg_handoff_componentstatus(void);
void proto_register_componentstatusprotocol(void);
void proto_reg_handoff_componentstatusprotocol(void);
/* Initialize the protocol and registered fields */
static int proto_componentstatusprotocol = -1;

View File

@ -2694,7 +2694,7 @@ proto_register_dtls(void)
sizeof(ssldecrypt_assoc_t),
"dtlsdecrypttablefile", /* filename */
TRUE, /* from_profile */
(void*) &dtlskeylist_uats, /* data_ptr */
(void**) &dtlskeylist_uats, /* data_ptr */
&ndtlsdecrypt, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChK12ProtocolsSection", /* TODO, need revision - help */

View File

@ -2972,7 +2972,7 @@ proto_register_http(void)
sizeof(header_field_t),
"custom_http_header_fields",
TRUE,
(void*) &header_fields,
(void**) &header_fields,
&num_header_fields,
/* specifies named fields, so affects dissection
and the set of named fields */

View File

@ -223,7 +223,7 @@ static gchar *
prism_rate_return(guint32 rate)
{
gchar *result=NULL;
result = ep_alloc(SHORT_STR);
result = (gchar *)ep_alloc(SHORT_STR);
result[0] = '\0';
prism_rate_base_custom(result, rate);

View File

@ -874,7 +874,7 @@ capture_radiotap(const guchar * pd, int offset, int len, packet_counts * ld)
ld->other++;
return;
}
hdr = (void *)pd;
hdr = (struct ieee80211_radiotap_header *)pd;
it_len = pletohs(&hdr->it_len);
if (!BYTES_ARE_IN_FRAME(offset, len, it_len)) {
ld->other++;
@ -1028,7 +1028,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (!data)
return;
if (ieee80211_radiotap_iterator_init(&iter, data, length, NULL)) {
if (ieee80211_radiotap_iterator_init(&iter, (struct ieee80211_radiotap_header *)data, length, NULL)) {
if (tree)
proto_item_append_text(ti, " (invalid)");
/* maybe the length was correct anyway ... */

View File

@ -6899,7 +6899,7 @@ static const struct ieee80211_fixed_field_dissector ff_dissectors[] = {
FF_FIELD(TARGET_CHANNEL , target_channel),
FF_FIELD(REGULATORY_CLASS , regulatory_class),
FF_FIELD(WNM_ACTION_CODE , wnm_action_code),
{ -1 , NULL }
{ (enum fixed_field)-1 , NULL }
};
#undef FF_FIELD
@ -6968,7 +6968,7 @@ rsn_gcs_base_custom(gchar *result, guint32 gcs)
{
gchar *oui_result;
oui_result = ep_alloc(SHORT_STR);
oui_result = (gchar *)ep_alloc(SHORT_STR);
oui_result[0] = '\0';
oui_base_custom(oui_result, gcs >> 8);
g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
@ -6980,7 +6980,7 @@ rsn_pcs_base_custom(gchar *result, guint32 pcs)
{
gchar *oui_result;
oui_result = ep_alloc(SHORT_STR);
oui_result = (gchar *)ep_alloc(SHORT_STR);
oui_result[0] = '\0';
oui_base_custom(oui_result, pcs >> 8);
g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
@ -6992,7 +6992,7 @@ rsn_akms_base_custom(gchar *result, guint32 akms)
{
gchar *oui_result;
oui_result = ep_alloc(SHORT_STR);
oui_result = (gchar *)ep_alloc(SHORT_STR);
oui_result[0] = '\0';
oui_base_custom(oui_result, akms >> 8);
g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
@ -7004,7 +7004,7 @@ rsn_pcs_return(guint32 pcs)
{
gchar *result;
result = ep_alloc(SHORT_STR);
result = (gchar *)ep_alloc(SHORT_STR);
result[0] = '\0';
rsn_pcs_base_custom(result, pcs);
@ -7016,7 +7016,7 @@ rsn_akms_return(guint32 akms)
{
gchar *result;
result = ep_alloc(SHORT_STR);
result = (gchar *)ep_alloc(SHORT_STR);
result[0] = '\0';
rsn_akms_base_custom(result, akms);
@ -7028,7 +7028,7 @@ rsn_gmcs_base_custom(gchar *result, guint32 gmcs)
{
gchar *oui_result;
oui_result = ep_alloc(SHORT_STR);
oui_result = (gchar *)ep_alloc(SHORT_STR);
oui_result[0] = '\0';
oui_base_custom(oui_result, gmcs >> 8);
g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
@ -7127,7 +7127,7 @@ wpa_mcs_base_custom(gchar *result, guint32 mcs)
{
gchar *oui_result;
oui_result = ep_alloc(SHORT_STR);
oui_result = (gchar *)ep_alloc(SHORT_STR);
oui_result[0] = '\0';
oui_base_custom(oui_result, mcs >> 8);
g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
@ -7139,7 +7139,7 @@ wpa_ucs_base_custom(gchar *result, guint32 ucs)
{
gchar *oui_result;
oui_result = ep_alloc(SHORT_STR);
oui_result = (gchar *)ep_alloc(SHORT_STR);
oui_result[0] = '\0';
oui_base_custom(oui_result, ucs >> 8);
g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
@ -7151,7 +7151,7 @@ wpa_akms_base_custom(gchar *result, guint32 akms)
{
gchar *oui_result;
oui_result = ep_alloc(SHORT_STR);
oui_result = (gchar *)ep_alloc(SHORT_STR);
oui_result[0] = '\0';
oui_base_custom(oui_result, akms >> 8);
g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
@ -7163,7 +7163,7 @@ wpa_ucs_return(guint32 ucs)
{
gchar *result;
result = ep_alloc(SHORT_STR);
result = (gchar *)ep_alloc(SHORT_STR);
result[0] = '\0';
wpa_ucs_base_custom(result, ucs);
@ -7175,7 +7175,7 @@ wpa_akms_return(guint32 akms)
{
gchar *result;
result = ep_alloc(SHORT_STR);
result = (gchar *)ep_alloc(SHORT_STR);
result[0] = '\0';
wpa_akms_base_custom(result, akms);
@ -12876,7 +12876,7 @@ dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo,
} else {
/* first time or new seq*/
if (!result) {
result = se_alloc(sizeof(retransmit_key));
result = se_new(retransmit_key);
*result = key;
g_hash_table_insert(fc_analyse_retransmit_table, result, result);
}
@ -13354,8 +13354,8 @@ dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo,
octet1 = tvb_get_guint8(next_tvb, 0);
octet2 = tvb_get_guint8(next_tvb, 1);
if ((octet1 != 0xaa) || (octet2 != 0xaa)) {
if ((tvb_memeql(next_tvb, 6, pinfo->dl_src.data, 6) == 0) ||
(tvb_memeql(next_tvb, 0, pinfo->dl_dst.data, 6) == 0))
if ((tvb_memeql(next_tvb, 6, (const guint8 *)pinfo->dl_src.data, 6) == 0) ||
(tvb_memeql(next_tvb, 0, (const guint8 *)pinfo->dl_dst.data, 6) == 0))
encap_type = ENCAP_ETHERNET;
else if ((octet1 == 0xff) && (octet2 == 0xff))
encap_type = ENCAP_IPX;
@ -13537,7 +13537,7 @@ try_decrypt(tvbuff_t *tvb, guint offset, guint len, guint8 *algorithm, guint32 *
}
/* allocate buffer for decrypted payload */
tmp = g_memdup(dec_data+offset, dec_caplen-offset);
tmp = (guint8 *)g_memdup(dec_data+offset, dec_caplen-offset);
len = dec_caplen-offset;
@ -19267,7 +19267,7 @@ proto_register_ieee80211 (void)
sizeof(uat_wep_key_record_t), /* record size */
"80211_keys", /* filename */
TRUE, /* from_profile */
(void*) &uat_wep_key_records, /* data_ptr */
(void**) &uat_wep_key_records,/* data_ptr */
&num_wepkeys_uat, /* numitems_ptr */
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* help */

View File

@ -99,7 +99,7 @@ dissect_rtp_events( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
/* get tap info */
rtp_event_info.info_rtp_evt = rtp_evt;
p_conv_data = p_get_proto_data(pinfo->fd, proto_get_id_by_filter_name("rtp"));
p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(pinfo->fd, proto_get_id_by_filter_name("rtp"));
if (p_conv_data)
rtp_event_info.info_setup_frame_num = p_conv_data->frame_number;
else

View File

@ -852,21 +852,21 @@ srtp_add_address(packet_info *pinfo, address *addr, int port, int other_port,
/*
* Check if the conversation has data associated with it.
*/
p_conv_data = conversation_get_proto_data(p_conv, proto_rtp);
p_conv_data = (struct _rtp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtp);
/*
* If not, add a new data item.
*/
if (! p_conv_data) {
/* Create conversation data */
p_conv_data = se_alloc(sizeof(struct _rtp_conversation_info));
p_conv_data = se_new(struct _rtp_conversation_info);
p_conv_data->rtp_dyn_payload = NULL;
/* start this at 0x10000 so that we cope gracefully with the
* first few packets being out of order (hence 0,65535,1,2,...)
*/
p_conv_data->extended_seqno = 0x10000;
p_conv_data->rtp_conv_info = se_alloc(sizeof(rtp_private_conv_info));
p_conv_data->rtp_conv_info = se_new(rtp_private_conv_info);
p_conv_data->rtp_conv_info->multisegment_pdus = se_tree_create(EMEM_TREE_TYPE_RED_BLACK,"rtp_ms_pdus");
conversation_add_proto_data(p_conv, proto_rtp, p_conv_data);
}
@ -980,7 +980,7 @@ process_rtp_payload(tvbuff_t *newtvb, packet_info *pinfo, proto_tree *tree,
payload_len = tvb_length_remaining(newtvb, offset);
/* first check if this is added as an SRTP stream - if so, don't try to dissector the payload data for now */
p_conv_data = p_get_proto_data(pinfo->fd, proto_rtp);
p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(pinfo->fd, proto_rtp);
if (p_conv_data && p_conv_data->srtp_info) {
srtp_info = p_conv_data->srtp_info;
payload_len -= srtp_info->mki_len + srtp_info->auth_tag_len;
@ -1015,7 +1015,7 @@ process_rtp_payload(tvbuff_t *newtvb, packet_info *pinfo, proto_tree *tree,
if (p_conv_data && p_conv_data->rtp_dyn_payload) {
gchar *payload_type_str = NULL;
encoding_name_and_rate_t *encoding_name_and_rate_pt = NULL;
encoding_name_and_rate_pt = g_hash_table_lookup(p_conv_data->rtp_dyn_payload, &payload_type);
encoding_name_and_rate_pt = (encoding_name_and_rate_t *)g_hash_table_lookup(p_conv_data->rtp_dyn_payload, &payload_type);
if (encoding_name_and_rate_pt) {
payload_type_str = encoding_name_and_rate_pt->encoding_name;
}
@ -1069,7 +1069,7 @@ dissect_rtp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint32 seqno;
/* Retrieve RTPs idea of a converation */
p_conv_data = p_get_proto_data(pinfo->fd, proto_rtp);
p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(pinfo->fd, proto_rtp);
if(p_conv_data != NULL)
finfo = p_conv_data->rtp_conv_info;
@ -1193,7 +1193,7 @@ dissect_rtp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
deseg_offset);
#endif
/* allocate a new msp for this pdu */
msp = se_alloc(sizeof(rtp_multisegment_pdu));
msp = se_new(rtp_multisegment_pdu);
msp->startseq = seqno;
msp->endseq = seqno+1;
se_tree_insert32(finfo->multisegment_pdus,seqno,msp);
@ -1267,7 +1267,7 @@ dissect_rtp_rfc2198(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gchar *payload_type_str;
/* Retrieve RTPs idea of a converation */
p_conv_data = p_get_proto_data(pinfo->fd, proto_rtp);
p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(pinfo->fd, proto_rtp);
/* Add try to RFC 2198 data */
ti = proto_tree_add_text(tree, tvb, offset, -1, "RFC 2198: Redundant Audio Data");
@ -1280,7 +1280,7 @@ dissect_rtp_rfc2198(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
payload_type_str = NULL;
/* Allocate and fill in header */
hdr_new = ep_alloc(sizeof(rfc2198_hdr));
hdr_new = ep_new(rfc2198_hdr);
hdr_new->next = NULL;
octet1 = tvb_get_guint8(tvb, offset);
hdr_new->pt = RTP_PAYLOAD_TYPE(octet1);
@ -1290,7 +1290,7 @@ dissect_rtp_rfc2198(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ((hdr_new->pt > 95) && (hdr_new->pt < 128)) {
if (p_conv_data && p_conv_data->rtp_dyn_payload){
encoding_name_and_rate_t *encoding_name_and_rate_pt = NULL;
encoding_name_and_rate_pt = g_hash_table_lookup(p_conv_data->rtp_dyn_payload, &hdr_new->pt);
encoding_name_and_rate_pt = (encoding_name_and_rate_t *)g_hash_table_lookup(p_conv_data->rtp_dyn_payload, &hdr_new->pt);
if (encoding_name_and_rate_pt) {
payload_type_str = encoding_name_and_rate_pt->encoding_name;
}
@ -1600,7 +1600,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
/* Look for conv and add to the frame if found */
get_conv_info(pinfo, rtp_info);
p_conv_data = p_get_proto_data(pinfo->fd, proto_rtp);
p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(pinfo->fd, proto_rtp);
if (p_conv_data)
rtp_info->info_is_video = p_conv_data->is_video;
@ -1611,7 +1611,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
col_set_str( pinfo->cinfo, COL_PROTOCOL, (is_srtp) ? "SRTP" : "RTP" );
/* check if this is added as an SRTP stream - if so, don't try to dissect the payload data for now */
p_conv_data = p_get_proto_data(pinfo->fd, proto_rtp);
p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(pinfo->fd, proto_rtp);
#if 0 /* XXX: srtp_offset never actually used ?? */
if (p_conv_data && p_conv_data->srtp_info) {
@ -1626,7 +1626,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
if ( (payload_type>95) && (payload_type<128) ) {
if (p_conv_data && p_conv_data->rtp_dyn_payload){
encoding_name_and_rate_t *encoding_name_and_rate_pt = NULL;
encoding_name_and_rate_pt = g_hash_table_lookup(p_conv_data->rtp_dyn_payload, &payload_type);
encoding_name_and_rate_pt = (encoding_name_and_rate_t *)g_hash_table_lookup(p_conv_data->rtp_dyn_payload, &payload_type);
if (encoding_name_and_rate_pt) {
rtp_info->info_payload_type_str = payload_type_str = encoding_name_and_rate_pt->encoding_name;
rtp_info->info_payload_rate = encoding_name_and_rate_pt->sample_rate;
@ -2030,7 +2030,7 @@ get_conv_info(packet_info *pinfo, struct _rtp_info *rtp_info)
struct _rtp_conversation_info *p_conv_data = NULL;
/* Use existing packet info if available */
p_conv_data = p_get_proto_data(pinfo->fd, proto_rtp);
p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(pinfo->fd, proto_rtp);
if (!p_conv_data)
{
@ -2042,13 +2042,13 @@ get_conv_info(packet_info *pinfo, struct _rtp_info *rtp_info)
{
/* Create space for packet info */
struct _rtp_conversation_info *p_conv_packet_data;
p_conv_data = conversation_get_proto_data(p_conv, proto_rtp);
p_conv_data = (struct _rtp_conversation_info *)conversation_get_proto_data(p_conv, proto_rtp);
if (p_conv_data) {
guint32 seqno;
/* Save this conversation info into packet info */
p_conv_packet_data = se_alloc(sizeof(struct _rtp_conversation_info));
p_conv_packet_data = se_new(struct _rtp_conversation_info);
g_strlcpy(p_conv_packet_data->method, p_conv_data->method, MAX_RTP_SETUP_METHOD_SIZE+1);
p_conv_packet_data->frame_number = p_conv_data->frame_number;
p_conv_packet_data->is_video = p_conv_data->is_video;
@ -2080,7 +2080,7 @@ show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *ti;
/* Use existing packet info if available */
p_conv_data = p_get_proto_data(pinfo->fd, proto_rtp);
p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(pinfo->fd, proto_rtp);
if (!p_conv_data) return;

View File

@ -519,6 +519,8 @@ static const value_string smb2_find_info_levels[] = {
{ 0, NULL }
};
static const gint8 zeros[NTLMSSP_KEY_LEN] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
/* ExportObject preferences variable */
gboolean eosmb2_take_name_as_fid = FALSE ;
@ -1418,8 +1420,8 @@ dissect_smb2_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset
if (eo_file_info) {
si->eo_file_info=eo_file_info;
} else { /* XXX This should never happen */
eo_file_info = se_alloc(sizeof(smb2_eo_file_info_t));
policy_hnd_hashtablekey = se_alloc(sizeof(e_ctx_hnd));
eo_file_info = se_new(smb2_eo_file_info_t);
policy_hnd_hashtablekey = se_new(e_ctx_hnd);
memcpy(policy_hnd_hashtablekey, &policy_hnd, sizeof(e_ctx_hnd));
eo_file_info->end_of_file=0;
g_hash_table_insert(si->conv->files,policy_hnd_hashtablekey,eo_file_info);
@ -2457,9 +2459,8 @@ dissect_smb2_session_setup_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* If we have found a uid->acct_name mapping, store it */
if (!pinfo->fd->flags.visited) {
idx = 0;
while ((ntlmssph = fetch_tapped_data(ntlmssp_tap_id, idx++)) != NULL) {
while ((ntlmssph = (const ntlmssp_header_t *)fetch_tapped_data(ntlmssp_tap_id, idx++)) != NULL) {
if (ntlmssph && ntlmssph->type == NTLMSSP_AUTH) {
static const gint8 zeros[NTLMSSP_KEY_LEN];
smb2_sesid_info_t *sesid;
sesid = se_new(smb2_sesid_info_t);
sesid->sesid = si->sesid;
@ -3492,7 +3493,7 @@ dissect_smb2_negotiate_protocol_response(tvbuff_t *tvb, packet_info *pinfo, prot
static int
dissect_smb2_getinfo_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, smb2_info_t *si)
{
switch (si->saved->class) {
switch (si->saved->smb2_class) {
case SMB2_CLASS_FILE_INFO:
switch (si->saved->infolevel) {
default:
@ -3544,13 +3545,13 @@ dissect_smb2_class_infolevel(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
if (!si->saved) {
return offset;
}
cl = si->saved->class;
cl = si->saved->smb2_class;
il = si->saved->infolevel;
} else {
cl = tvb_get_guint8(tvb, offset);
il = tvb_get_guint8(tvb, offset+1);
if (si->saved) {
si->saved->class = cl;
si->saved->smb2_class = cl;
si->saved->infolevel = il;
}
}
@ -3631,11 +3632,11 @@ dissect_smb2_getinfo_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
static int
dissect_smb2_infolevel(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, smb2_info_t *si, guint8 class, guint8 infolevel)
dissect_smb2_infolevel(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, smb2_info_t *si, guint8 smb2_class, guint8 infolevel)
{
int old_offset = offset;
switch (class) {
switch (smb2_class) {
case SMB2_CLASS_FILE_INFO:
switch (infolevel) {
case SMB2_FILE_BASIC_INFO:
@ -3764,7 +3765,7 @@ dissect_smb2_getinfo_response_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree
{
/* data */
if (si->saved) {
dissect_smb2_infolevel(tvb, pinfo, tree, 0, si, si->saved->class, si->saved->infolevel);
dissect_smb2_infolevel(tvb, pinfo, tree, 0, si, si->saved->smb2_class, si->saved->infolevel);
} else {
/* some unknown bytes */
proto_tree_add_item(tree, hf_smb2_unknown, tvb, 0, tvb_length(tvb), ENC_NA);
@ -5580,8 +5581,8 @@ dissect_smb2_create_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (si->saved && f_olb.len && f_olb.len<256) {
si->saved->extra_info_type = SMB2_EI_FILENAME;
si->saved->extra_info = g_malloc(f_olb.len+1);
g_snprintf(si->saved->extra_info, f_olb.len+1, "%s", fname);
si->saved->extra_info = (gchar *)g_malloc(f_olb.len+1);
g_snprintf((gchar *)si->saved->extra_info, f_olb.len+1, "%s", fname);
}
}
@ -5724,7 +5725,7 @@ dissect_smb2_setinfo_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* data */
if (si->saved)
dissect_smb2_infolevel(tvb, pinfo, tree, setinfo_offset, si, si->saved->class, si->saved->infolevel);
dissect_smb2_infolevel(tvb, pinfo, tree, setinfo_offset, si, si->saved->smb2_class, si->saved->infolevel);
offset = setinfo_offset + setinfo_size;
return offset;
@ -6566,8 +6567,6 @@ dissect_smb2_transform_header(packet_info *pinfo _U_, proto_tree *tree,
#ifdef HAVE_LIBGCRYPT
if (sti->session != NULL && sti->alg == ENC_ALG_aes128_ccm) {
static const guint8 zeros[16];
if (pinfo->destport == sti->session->server_port) {
decryption_key = sti->session->server_decryption_key;
} else {
@ -6751,7 +6750,7 @@ dissect_smb2_tid_sesid(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb,
if (!(si->flags&SMB2_FLAGS_ASYNC_CMD)) {
/* see if we can find the name for this tid */
tid_key.tid = si->tid;
si->tree = g_hash_table_lookup(si->session->tids, &tid_key);
si->tree = (smb2_tid_info_t *)g_hash_table_lookup(si->session->tids, &tid_key);
if (!si->tree) return offset;
item = proto_tree_add_string(tid_tree, hf_smb2_tree, tvb, tid_offset, 4, si->tree->name);
@ -6791,8 +6790,8 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
smb2_eo_file_info_t *eo_file_info;
e_ctx_hnd *policy_hnd_hashtablekey;
sti = ep_alloc(sizeof(smb2_transform_info_t));
si = ep_alloc(sizeof(smb2_info_t));
sti = ep_new(smb2_transform_info_t);
si = ep_new(smb2_info_t);
si->eo_file_info = NULL;
si->conv = NULL;
si->saved = NULL;
@ -6807,12 +6806,12 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
* conversation
*/
conversation = find_or_create_conversation(pinfo);
si->conv = conversation_get_proto_data(conversation, proto_smb2);
si->conv = (smb2_conv_info_t *)conversation_get_proto_data(conversation, proto_smb2);
if (!si->conv) {
/* no smb2_into_t structure for this conversation yet,
* create it.
*/
si->conv = se_alloc(sizeof(smb2_conv_info_t));
si->conv = se_new(smb2_conv_info_t);
/* qqq this leaks memory for now since we never free
the hashtables */
si->conv->matched = g_hash_table_new(smb2_saved_info_hash_matched,
@ -6948,7 +6947,7 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
if (!pinfo->fd->flags.visited) {
/* see if we can find this seqnum in the unmatched table */
ssi = g_hash_table_lookup(si->conv->unmatched, &ssi_key);
ssi = (smb2_saved_info_t *)g_hash_table_lookup(si->conv->unmatched, &ssi_key);
if (!(si->flags & SMB2_FLAGS_RESPONSE)) {
/* This is a request */
@ -6965,7 +6964,7 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
/* no we couldnt find it, so just add it then
* if was a request we are decoding
*/
ssi = se_alloc0(sizeof(smb2_saved_info_t));
ssi = se_new0(smb2_saved_info_t);
ssi->seqnum = ssi_key.seqnum;
ssi->frame_req = pinfo->fd->num;
ssi->req_time = pinfo->fd->abs_ts;

View File

@ -58,7 +58,7 @@ typedef enum {
SMB2_EI_FINDPATTERN /* find tracking char * */
} smb2_extra_info_t;
typedef struct _smb2_saved_info_t {
guint8 class;
guint8 smb2_class;
guint8 infolevel;
guint64 seqnum;
guint32 frame_req, frame_res;

View File

@ -270,7 +270,7 @@ void zbee_security_register(module_t *zbee_prefs, int proto)
sizeof(uat_key_record_t),
"zigbee_pc_keys",
TRUE,
(void*) &uat_key_records,
(void**) &uat_key_records,
&num_uat_key_records,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
NULL, /* TODO: ptr to help manual? */