more updates of x509if

svn path=/trunk/; revision=12433
This commit is contained in:
Ronnie Sahlberg 2004-10-29 11:39:58 +00:00
parent deae759020
commit 076d4710ec
6 changed files with 50 additions and 81 deletions

View File

@ -27,26 +27,26 @@ IMPORTS
AttributeId ::= OBJECT IDENTIFIER
--AttributeValue ::= Any
--
-- attribute data types
-- XXX This function is implemented by hand inside the template
-- Attribute ::= SEQUENCE {
-- type AttributeId,
-- values
-- SET SIZE (0..MAX) OF ATTRIBUTE.&Type({SupportedAttributes}{@type}),
Attribute ::= SEQUENCE {
type AttributeId
-- value
-- SET SIZE (0..MAX) OF AttributeValue
-- valuesWithContext
-- SET SIZE (1..MAX) OF
-- SEQUENCE {value ATTRIBUTE.&Type({SupportedAttributes}{@type}),
-- SEQUENCE {value Any,
-- contextList SET SIZE (1..MAX) OF Context} OPTIONAL
-- }
}
AttributeType ::= AttributeId
-- AttributeValue ::= ATTRIBUTE.&Type
--
-- Context ::= SEQUENCE {
-- contextType CONTEXT.&id({SupportedContexts}),
-- contextType AttributeId,
-- contextValues
-- SET SIZE (1..MAX) OF CONTEXT.&Type({SupportedContexts}{@contextType}),
-- SET SIZE (1..MAX) OF Any,
-- fallback BOOLEAN DEFAULT FALSE
-- }
--
@ -98,13 +98,12 @@ RelativeDistinguishedName ::=
AttributeTypeAndDistinguishedValue ::= SEQUENCE {
type AttributeId,
-- value ATTRIBUTE.&Type({SupportedAttributes}{@type}),
value Any,
primaryDistinguished BOOLEAN OPTIONAL
-- valuesWithContext
-- SET SIZE (1..MAX) OF
-- SEQUENCE {distingAttrValue
-- [0] ATTRIBUTE.&Type({SupportedAttributes}{@type}) OPTIONAL,
-- [0] Any OPTIONAL,
-- contextList SET SIZE (1..MAX) OF Context} OPTIONAL
}
@ -595,13 +594,13 @@ ImposedSubset ::= ENUMERATED {baseObject(0), oneLevel(1), wholeSubtree(2)}
-- includeSubtypes [0] BOOLEAN DEFAULT FALSE,
-- selectedValues
-- [1] SEQUENCE SIZE (0..MAX) OF
-- ATTRIBUTE.&Type({SupportedAttributes}{@attributeType}) OPTIONAL,
-- Any OPTIONAL,
-- defaultValues
-- [2] SEQUENCE SIZE (0..MAX) OF
-- SEQUENCE {entryType OBJECT-CLASS.&id OPTIONAL,
-- values
-- SEQUENCE OF
-- ATTRIBUTE.&Type({SupportedAttributes}{@attributeType})
-- Any
-- } OPTIONAL,
-- contexts [3] SEQUENCE SIZE (0..MAX) OF ContextProfile OPTIONAL,
-- contextCombination [4] ContextCombination DEFAULT and:{},
@ -647,14 +646,14 @@ ImposedSubset ::= ENUMERATED {baseObject(0), oneLevel(1), wholeSubtree(2)}
-- outputValues
-- CHOICE {selectedValues
-- SEQUENCE SIZE (1..MAX) OF
-- ATTRIBUTE.&Type({SupportedAttributes}{@attributeType}),
-- Any,
-- matchedValuesOnly NULL} OPTIONAL,
-- contexts [0] SEQUENCE SIZE (1..MAX) OF ContextProfile OPTIONAL
-- }
--
-- OutputValues ::= CHOICE {
-- selectedValues
-- SEQUENCE SIZE (1..MAX) OF ATTRIBUTE.&Type({SupportedAttributes}),
-- SEQUENCE SIZE (1..MAX) OF Any,
-- matchedValuesOnly NULL
-- }
--
@ -738,9 +737,9 @@ ImposedSubset ::= ENUMERATED {baseObject(0), oneLevel(1), wholeSubtree(2)}
--
-- REQUEST-ATTRIBUTE ::= CLASS {
-- &attributeType AttributeId,
-- &SelectedValues ATTRIBUTE.&Type OPTIONAL,
-- &SelectedValues Any OPTIONAL,
-- &DefaultValues SEQUENCE {entryType OBJECT-CLASS.&id OPTIONAL,
-- values SEQUENCE OF ATTRIBUTE.&Type
-- values SEQUENCE OF Any
-- } OPTIONAL,
-- &contexts SEQUENCE OF ContextProfile OPTIONAL,
-- &contextCombination ContextCombination OPTIONAL,

View File

@ -46,27 +46,10 @@ int hf_x509if_object_identifier_id = -1;
#include "packet-x509if-hf.c"
/* Initialize the subtree pointers */
static gint ett_x509if_Attribute = -1;
#include "packet-x509if-ett.c"
static char object_identifier_id[64]; /*64 chars should be long enough? */
static const ber_sequence Attribute_sequence[] = {
/* { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_x509if_type },*/
/*XXX missing stuff here */
{ 0, 0, 0, NULL }
};
int
dissect_x509if_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
Attribute_sequence, hf_index, ett_x509if_Attribute);
return offset;
}
#include "packet-x509if-fn.c"
@ -84,7 +67,6 @@ void proto_register_x509if(void) {
/* List of subtrees */
static gint *ett[] = {
&ett_x509if_Attribute,
#include "packet-x509if-ettarr.c"
};

View File

@ -27,7 +27,5 @@
#include "packet-x509if-exp.h"
int dissect_x509if_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
#endif /* PACKET_X509IF_H */

View File

@ -8,7 +8,7 @@
#.INCLUDE ./x509if_dummy.cnf
#.EXPORTS
Attribute
AttributeType
Name
RelativeDistinguishedName
@ -19,10 +19,13 @@ RelativeDistinguishedName
#.FIELD_RENAME
#.FN_BODY AttributeTypeAndDistinguishedValue/type
#.FN_BODY AttributeId
offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
hf_x509if_object_identifier_id, object_identifier_id);
#.FN_BODY AttributeValue
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
#.FN_BODY AttributeTypeAndDistinguishedValue/value
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);

View File

@ -8,7 +8,7 @@
/* packet-x509if.c
* Routines for X.509 Information Framework packet dissection
*
* $Id: packet-x509if-template.c 12245 2004-10-08 20:28:04Z guy $
* $Id: packet-x509if-template.c 12431 2004-10-29 11:10:31Z sahlberg $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -53,10 +53,10 @@ int hf_x509if_object_identifier_id = -1;
/*--- Included file: packet-x509if-hf.c ---*/
static int hf_x509if_type = -1; /* AttributeId */
static int hf_x509if_rdnSequence = -1; /* RDNSequence */
static int hf_x509if_RDNSequence_item = -1; /* RelativeDistinguishedName */
static int hf_x509if_RelativeDistinguishedName_item = -1; /* AttributeTypeAndDistinguishedValue */
static int hf_x509if_type = -1; /* T_type */
static int hf_x509if_value = -1; /* T_value */
static int hf_x509if_primaryDistinguished = -1; /* BOOLEAN */
/* named bits */
@ -68,10 +68,10 @@ static int hf_x509if_AllowedSubset_wholeSubtree = -1;
/* Initialize the subtree pointers */
static gint ett_x509if_Attribute = -1;
/*--- Included file: packet-x509if-ett.c ---*/
static gint ett_x509if_Attribute = -1;
static gint ett_x509if_Name = -1;
static gint ett_x509if_RDNSequence = -1;
static gint ett_x509if_RelativeDistinguishedName = -1;
@ -84,22 +84,6 @@ static gint ett_x509if_AllowedSubset = -1;
static char object_identifier_id[64]; /*64 chars should be long enough? */
static const ber_sequence Attribute_sequence[] = {
/* { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_x509if_type },*/
/*XXX missing stuff here */
{ 0, 0, 0, NULL }
};
int
dissect_x509if_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
Attribute_sequence, hf_index, ett_x509if_Attribute);
return offset;
}
/*--- Included file: packet-x509if-fn.c ---*/
/*--- Fields for imported types ---*/
@ -108,8 +92,25 @@ dissect_x509if_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packe
static int
dissect_x509if_AttributeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
hf_index, NULL);
offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
hf_x509if_object_identifier_id, object_identifier_id);
return offset;
}
static int dissect_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
return dissect_x509if_AttributeId(FALSE, tvb, offset, pinfo, tree, hf_x509if_type);
}
static const ber_sequence Attribute_sequence[] = {
{ BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_type },
{ 0, 0, 0, NULL }
};
int
dissect_x509if_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
Attribute_sequence, hf_index, ett_x509if_Attribute);
return offset;
}
@ -123,19 +124,6 @@ dissect_x509if_AttributeType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offse
}
static int
dissect_x509if_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
hf_x509if_object_identifier_id, object_identifier_id);
return offset;
}
static int dissect_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
return dissect_x509if_T_type(FALSE, tvb, offset, pinfo, tree, hf_x509if_type);
}
static int
dissect_x509if_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
@ -299,6 +287,10 @@ void proto_register_x509if(void) {
/*--- Included file: packet-x509if-hfarr.c ---*/
{ &hf_x509if_type,
{ "type", "x509if.type",
FT_STRING, BASE_NONE, NULL, 0,
"", HFILL }},
{ &hf_x509if_rdnSequence,
{ "rdnSequence", "x509if.rdnSequence",
FT_UINT32, BASE_DEC, NULL, 0,
@ -311,10 +303,6 @@ void proto_register_x509if(void) {
{ "Item", "x509if.RelativeDistinguishedName_item",
FT_NONE, BASE_NONE, NULL, 0,
"RelativeDistinguishedName/_item", HFILL }},
{ &hf_x509if_type,
{ "type", "x509if.type",
FT_STRING, BASE_NONE, NULL, 0,
"AttributeTypeAndDistinguishedValue/type", HFILL }},
{ &hf_x509if_value,
{ "value", "x509if.value",
FT_NONE, BASE_NONE, NULL, 0,
@ -342,10 +330,10 @@ void proto_register_x509if(void) {
/* List of subtrees */
static gint *ett[] = {
&ett_x509if_Attribute,
/*--- Included file: packet-x509if-ettarr.c ---*/
&ett_x509if_Attribute,
&ett_x509if_Name,
&ett_x509if_RDNSequence,
&ett_x509if_RelativeDistinguishedName,

View File

@ -36,6 +36,7 @@
/*--- Included file: packet-x509if-exp.h ---*/
extern const value_string Name_vals[];
int dissect_x509if_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_x509if_AttributeType(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_x509if_Name(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
int dissect_x509if_RelativeDistinguishedName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
@ -43,7 +44,5 @@ int dissect_x509if_RelativeDistinguishedName(gboolean implicit_tag, tvbuff_t *tv
/*--- End of included file: packet-x509if-exp.h ---*/
int dissect_x509if_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
#endif /* PACKET_X509IF_H */