1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-pkixproxy.c */
4 /* ../../tools/asn2wrs.py -b -p pkixproxy -c ./pkixproxy.cnf -s ./packet-pkixproxy-template -D . -O ../../epan/dissectors PKIXProxy.asn */
6 /* Input file: packet-pkixproxy-template.c */
8 #line 1 "../../asn1/pkixproxy/packet-pkixproxy-template.c"
10 * Routines for RFC3820 PKIXProxy packet dissection
11 * Ronnie Sahlberg 2004
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
37 #include <epan/packet.h>
38 #include <epan/oids.h>
39 #include <epan/asn1.h>
41 #include "packet-ber.h"
42 #include "packet-pkixproxy.h"
44 #define PNAME "PKIXProxy (RFC3820)"
45 #define PSNAME "PKIXPROXY"
46 #define PFNAME "pkixproxy"
48 /* Initialize the protocol and registered fields */
49 static int proto_pkixproxy
= -1;
51 /*--- Included file: packet-pkixproxy-hf.c ---*/
52 #line 1 "../../asn1/pkixproxy/packet-pkixproxy-hf.c"
53 static int hf_pkixproxy_ProxyCertInfoExtension_PDU
= -1; /* ProxyCertInfoExtension */
54 static int hf_pkixproxy_pCPathLenConstraint
= -1; /* ProxyCertPathLengthConstraint */
55 static int hf_pkixproxy_proxyPolicy
= -1; /* ProxyPolicy */
56 static int hf_pkixproxy_policyLanguage
= -1; /* OBJECT_IDENTIFIER */
57 static int hf_pkixproxy_policy
= -1; /* OCTET_STRING */
59 /*--- End of included file: packet-pkixproxy-hf.c ---*/
60 #line 43 "../../asn1/pkixproxy/packet-pkixproxy-template.c"
62 /* Initialize the subtree pointers */
64 /*--- Included file: packet-pkixproxy-ett.c ---*/
65 #line 1 "../../asn1/pkixproxy/packet-pkixproxy-ett.c"
66 static gint ett_pkixproxy_ProxyCertInfoExtension
= -1;
67 static gint ett_pkixproxy_ProxyPolicy
= -1;
69 /*--- End of included file: packet-pkixproxy-ett.c ---*/
70 #line 46 "../../asn1/pkixproxy/packet-pkixproxy-template.c"
73 /*--- Included file: packet-pkixproxy-fn.c ---*/
74 #line 1 "../../asn1/pkixproxy/packet-pkixproxy-fn.c"
78 dissect_pkixproxy_ProxyCertPathLengthConstraint(gboolean implicit_tag _U_
, tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
79 offset
= dissect_ber_integer(implicit_tag
, actx
, tree
, tvb
, offset
, hf_index
,
88 dissect_pkixproxy_OBJECT_IDENTIFIER(gboolean implicit_tag _U_
, tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
89 offset
= dissect_ber_object_identifier(implicit_tag
, actx
, tree
, tvb
, offset
, hf_index
, NULL
);
97 dissect_pkixproxy_OCTET_STRING(gboolean implicit_tag _U_
, tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
98 offset
= dissect_ber_octet_string(implicit_tag
, actx
, tree
, tvb
, offset
, hf_index
,
105 static const ber_sequence_t ProxyPolicy_sequence
[] = {
106 { &hf_pkixproxy_policyLanguage
, BER_CLASS_UNI
, BER_UNI_TAG_OID
, BER_FLAGS_NOOWNTAG
, dissect_pkixproxy_OBJECT_IDENTIFIER
},
107 { &hf_pkixproxy_policy
, BER_CLASS_UNI
, BER_UNI_TAG_OCTETSTRING
, BER_FLAGS_OPTIONAL
|BER_FLAGS_NOOWNTAG
, dissect_pkixproxy_OCTET_STRING
},
108 { NULL
, 0, 0, 0, NULL
}
112 dissect_pkixproxy_ProxyPolicy(gboolean implicit_tag _U_
, tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
113 offset
= dissect_ber_sequence(implicit_tag
, actx
, tree
, tvb
, offset
,
114 ProxyPolicy_sequence
, hf_index
, ett_pkixproxy_ProxyPolicy
);
120 static const ber_sequence_t ProxyCertInfoExtension_sequence
[] = {
121 { &hf_pkixproxy_pCPathLenConstraint
, BER_CLASS_UNI
, BER_UNI_TAG_INTEGER
, BER_FLAGS_OPTIONAL
|BER_FLAGS_NOOWNTAG
, dissect_pkixproxy_ProxyCertPathLengthConstraint
},
122 { &hf_pkixproxy_proxyPolicy
, BER_CLASS_UNI
, BER_UNI_TAG_SEQUENCE
, BER_FLAGS_NOOWNTAG
, dissect_pkixproxy_ProxyPolicy
},
123 { NULL
, 0, 0, 0, NULL
}
127 dissect_pkixproxy_ProxyCertInfoExtension(gboolean implicit_tag _U_
, tvbuff_t
*tvb _U_
, int offset _U_
, asn1_ctx_t
*actx _U_
, proto_tree
*tree _U_
, int hf_index _U_
) {
128 offset
= dissect_ber_sequence(implicit_tag
, actx
, tree
, tvb
, offset
,
129 ProxyCertInfoExtension_sequence
, hf_index
, ett_pkixproxy_ProxyCertInfoExtension
);
136 static void dissect_ProxyCertInfoExtension_PDU(tvbuff_t
*tvb _U_
, packet_info
*pinfo _U_
, proto_tree
*tree _U_
) {
138 asn1_ctx_init(&asn1_ctx
, ASN1_ENC_BER
, TRUE
, pinfo
);
139 dissect_pkixproxy_ProxyCertInfoExtension(FALSE
, tvb
, 0, &asn1_ctx
, tree
, hf_pkixproxy_ProxyCertInfoExtension_PDU
);
143 /*--- End of included file: packet-pkixproxy-fn.c ---*/
144 #line 48 "../../asn1/pkixproxy/packet-pkixproxy-template.c"
147 /*--- proto_register_pkixproxy ----------------------------------------------*/
148 void proto_register_pkixproxy(void) {
151 static hf_register_info hf
[] = {
153 /*--- Included file: packet-pkixproxy-hfarr.c ---*/
154 #line 1 "../../asn1/pkixproxy/packet-pkixproxy-hfarr.c"
155 { &hf_pkixproxy_ProxyCertInfoExtension_PDU
,
156 { "ProxyCertInfoExtension", "pkixproxy.ProxyCertInfoExtension_element",
157 FT_NONE
, BASE_NONE
, NULL
, 0,
159 { &hf_pkixproxy_pCPathLenConstraint
,
160 { "pCPathLenConstraint", "pkixproxy.pCPathLenConstraint",
161 FT_INT32
, BASE_DEC
, NULL
, 0,
162 "ProxyCertPathLengthConstraint", HFILL
}},
163 { &hf_pkixproxy_proxyPolicy
,
164 { "proxyPolicy", "pkixproxy.proxyPolicy_element",
165 FT_NONE
, BASE_NONE
, NULL
, 0,
167 { &hf_pkixproxy_policyLanguage
,
168 { "policyLanguage", "pkixproxy.policyLanguage",
169 FT_OID
, BASE_NONE
, NULL
, 0,
170 "OBJECT_IDENTIFIER", HFILL
}},
171 { &hf_pkixproxy_policy
,
172 { "policy", "pkixproxy.policy",
173 FT_BYTES
, BASE_NONE
, NULL
, 0,
174 "OCTET_STRING", HFILL
}},
176 /*--- End of included file: packet-pkixproxy-hfarr.c ---*/
177 #line 56 "../../asn1/pkixproxy/packet-pkixproxy-template.c"
180 /* List of subtrees */
181 static gint
*ett
[] = {
183 /*--- Included file: packet-pkixproxy-ettarr.c ---*/
184 #line 1 "../../asn1/pkixproxy/packet-pkixproxy-ettarr.c"
185 &ett_pkixproxy_ProxyCertInfoExtension
,
186 &ett_pkixproxy_ProxyPolicy
,
188 /*--- End of included file: packet-pkixproxy-ettarr.c ---*/
189 #line 61 "../../asn1/pkixproxy/packet-pkixproxy-template.c"
192 /* Register protocol */
193 proto_pkixproxy
= proto_register_protocol(PNAME
, PSNAME
, PFNAME
);
195 /* Register fields and subtrees */
196 proto_register_field_array(proto_pkixproxy
, hf
, array_length(hf
));
197 proto_register_subtree_array(ett
, array_length(ett
));
202 /*--- proto_reg_handoff_pkixproxy -------------------------------------------*/
203 void proto_reg_handoff_pkixproxy(void) {
205 /*--- Included file: packet-pkixproxy-dis-tab.c ---*/
206 #line 1 "../../asn1/pkixproxy/packet-pkixproxy-dis-tab.c"
207 register_ber_oid_dissector("1.3.6.1.5.5.7.1.14", dissect_ProxyCertInfoExtension_PDU
, proto_pkixproxy
, "id-pe-proxyCertInfo");
210 /*--- End of included file: packet-pkixproxy-dis-tab.c ---*/
211 #line 76 "../../asn1/pkixproxy/packet-pkixproxy-template.c"
212 oid_add_from_string("id-ppl-anyLanguage","1.3.6.1.5.5.7.21.0");
213 oid_add_from_string("id-ppl-inheritAll","1.3.6.1.5.5.7.21.1");
214 oid_add_from_string("id-ppl-independent","1.3.6.1.5.5.7.21.2");