Fix compilation for Linux (defined but not used errors, C++ incompatibilities, shadowed variables)

svn path=/trunk/; revision=49344
This commit is contained in:
Pascal Quantin 2013-05-16 21:16:45 +00:00
parent 887c604334
commit 67c9aa88c7
2 changed files with 48 additions and 26 deletions

View File

@ -4,7 +4,7 @@
# $Id$
#.FIELD_RENAME
EncryptedData/etype encryptedData_etype
#EncryptedData/etype encryptedData_etype
KDC-REQ-BODY/etype kDC-REQ-BODY_etype
KRB-SAFE-BODY/user-data kRB-SAFE-BODY_user_data
EncKrbPrivPart/user-data encKrbPrivPart_user_data
@ -21,17 +21,50 @@ AP-REP/_untag/enc-part aP_REP_enc_part
KDC-REP/enc-part kDC_REP_enc_part
Ticket/_untag/enc-part ticket_enc_part
#.OMIT_ASSIGNMENT
AD-AND-OR
AD-KDCIssued
AD-LoginAlias
AD-MANDATORY-FOR-KDC
ADDR-TYPE
AUTHDATA-TYPE
ChangePasswdDataMS
EncryptedData
EtypeList
KerberosFlags
KRB5SignedPath
KRB5SignedPathData
KRB5SignedPathPrincipals
Krb5int32
Krb5uint32
PA-ClientCanonicalized
PA-ClientCanonicalizedNames
PA-ENC-TS-ENC
PA-ENC-SAM-RESPONSE-ENC
PA-PAC-REQUEST
PA-SAM-CHALLENGE-2
PA-SAM-CHALLENGE-2-BODY
PA-SAM-REDIRECT
PA-SAM-RESPONSE-2
PA-SAM-TYPE
PA-SERVER-REFERRAL-DATA
PA-ServerReferralData
PA-SvrReferralData
Principal
PROV-SRV-LOCATION
SAMFlags
TYPED-DATA
#.FN_BODY MESSAGE-TYPE VAL_PTR = &msgtype
guint32 msgtype;
%(DEFAULT_BODY)s
if (do_col_info) {
if (gbl_do_col_info) {
col_add_str(actx->pinfo->cinfo, COL_INFO,
val_to_str(msgtype, krb5_msg_types,
"Unknown msg type %%#x"));
}
do_col_info=FALSE;
gbl_do_col_info=FALSE;
/* append the application type to the tree */
proto_item_append_text(tree, " %%s", val_to_str(msgtype, krb5_msg_types, "Unknown:0x%%x"));
@ -70,7 +103,7 @@ guint32 msgtype;
}
#.FN_BODY Int32 VAL_PTR = actx->value_ptr
#.FN_BODY Int32 VAL_PTR = (guint32*)actx->value_ptr
%(DEFAULT_BODY)s
#.FN_BODY PADATA-TYPE
@ -78,7 +111,7 @@ guint32 msgtype;
actx->value_ptr = ep_alloc(sizeof(guint32));
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
actx->value_ptr);
(guint32*)actx->value_ptr);
if(tree){
proto_item_append_text(tree, " %%s",
@ -134,7 +167,7 @@ guint32 msgtype;
}
#.FN_BODY HostAddress/address
gint8 class;
gint8 appclass;
gboolean pc;
gint32 tag;
guint32 len;
@ -143,14 +176,14 @@ guint32 msgtype;
guint32 addr_type = 0;
/* read header and len for the octet string */
offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag);
offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag);
offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, NULL);
if (actx->value_ptr) {
addr_type = *((guint32*)actx->value_ptr);
}
address_str=ep_alloc(ADDRESS_STR_BUFSIZ);
address_str=(char*)ep_alloc(ADDRESS_STR_BUFSIZ);
address_str[0]=0;
switch(addr_type){
case KRB5_ADDR_IPv4:
@ -194,7 +227,7 @@ guint32 msgtype;
actx->value_ptr = ep_alloc(sizeof(guint32));
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
actx->value_ptr);
(guint32*)actx->value_ptr);
#.FN_BODY EncryptedTicketData/cipher
/**/#ifdef HAVE_KERBEROS
@ -257,7 +290,7 @@ guint32 msgtype;
actx->value_ptr = ep_alloc(sizeof(guint32));
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
actx->value_ptr);
(guint32*)actx->value_ptr);
#.FN_BODY Checksum/checksum
tvbuff_t *next_tvb;
@ -278,7 +311,7 @@ guint32 msgtype;
return offset;
#.FN_BODY EncryptionKey/keytype
kerberos_key_t* key = ep_alloc(sizeof(kerberos_key_t));
kerberos_key_t* key = (kerberos_key_t*)ep_alloc(sizeof(kerberos_key_t));
actx->value_ptr = key;
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
@ -307,7 +340,7 @@ guint32 msgtype;
actx->value_ptr = ep_alloc(sizeof(guint32));
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
actx->value_ptr);
(guint32*)actx->value_ptr);
#.FN_BODY AuthorizationData/_item/ad-data
guint32 adtype = 0;
@ -328,7 +361,7 @@ guint32 msgtype;
actx->value_ptr = ep_alloc(sizeof(guint32));
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
actx->value_ptr);
(guint32*)actx->value_ptr);
#.FN_BODY KDC-REQ-BODY

View File

@ -109,11 +109,6 @@ typedef struct kerberos_key {
static dissector_handle_t kerberos_handle_udp;
/* Global variables */
static guint32 keytype;
static gboolean do_col_info;
/* Forward declarations */
static int dissect_kerberos_Applications(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
static int dissect_kerberos_PA_ENC_TIMESTAMP(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
@ -1735,7 +1730,7 @@ dissect_kerberos_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
saved_private_data=pinfo->private_data;
pinfo->private_data=cb;
do_col_info=dci;
gbl_do_col_info=dci;
if (have_rm) {
krb_rm = tvb_get_ntohl(tvb, offset);
@ -1801,7 +1796,7 @@ dissect_kerberos_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (do_col_protocol) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "KRB5");
}
if (do_col_info) {
if (gbl_do_col_info) {
col_clear(pinfo->cinfo, COL_INFO);
}
if (tree) {
@ -1850,12 +1845,6 @@ dissect_kerberos_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int d
return (dissect_kerberos_common(tvb, pinfo, tree, do_col_info, FALSE, FALSE, cb));
}
guint32
kerberos_output_keytype(void)
{
return keytype;
}
static gint
dissect_kerberos_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{