1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler */
3 /* .\packet-pkixproxy.c */
4 /* ../../tools/asn2wrs.py -b -e -p pkixproxy -c pkixproxy.cnf -s packet-pkixproxy-template PKIXProxy.asn */
6 /* Input file: packet-pkixproxy-template.c */
8 #line 1 "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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39 #include <epan/packet.h>
44 #include "packet-ber.h"
45 #include "packet-pkixproxy.h"
47 #define PNAME "PKIXProxy (RFC3820)"
48 #define PSNAME "PKIXPROXY"
49 #define PFNAME "pkixproxy"
51 /* Initialize the protocol and registered fields */
52 static int proto_pkixproxy = -1;
54 /*--- Included file: packet-pkixproxy-hf.c ---*/
55 #line 1 "packet-pkixproxy-hf.c"
56 static int hf_pkixproxy_ProxyCertInfoExtension_PDU = -1; /* ProxyCertInfoExtension */
57 static int hf_pkixproxy_pCPathLenConstraint = -1; /* ProxyCertPathLengthConstraint */
58 static int hf_pkixproxy_proxyPolicy = -1; /* ProxyPolicy */
59 static int hf_pkixproxy_policyLanguage = -1; /* OBJECT_IDENTIFIER */
60 static int hf_pkixproxy_policy = -1; /* OCTET_STRING */
62 /*--- End of included file: packet-pkixproxy-hf.c ---*/
63 #line 46 "packet-pkixproxy-template.c"
65 /* Initialize the subtree pointers */
67 /*--- Included file: packet-pkixproxy-ett.c ---*/
68 #line 1 "packet-pkixproxy-ett.c"
69 static gint ett_pkixproxy_ProxyCertInfoExtension = -1;
70 static gint ett_pkixproxy_ProxyPolicy = -1;
72 /*--- End of included file: packet-pkixproxy-ett.c ---*/
73 #line 49 "packet-pkixproxy-template.c"
76 /*--- Included file: packet-pkixproxy-fn.c ---*/
77 #line 1 "packet-pkixproxy-fn.c"
78 /*--- Fields for imported types ---*/
84 dissect_pkixproxy_ProxyCertPathLengthConstraint(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
85 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
90 static int dissect_pCPathLenConstraint(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
91 return dissect_pkixproxy_ProxyCertPathLengthConstraint(FALSE, tvb, offset, pinfo, tree, hf_pkixproxy_pCPathLenConstraint);
97 dissect_pkixproxy_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
98 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
102 static int dissect_policyLanguage(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
103 return dissect_pkixproxy_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_pkixproxy_policyLanguage);
109 dissect_pkixproxy_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
110 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
115 static int dissect_policy(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
116 return dissect_pkixproxy_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_pkixproxy_policy);
120 static const ber_sequence_t ProxyPolicy_sequence[] = {
121 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_policyLanguage },
122 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_policy },
127 dissect_pkixproxy_ProxyPolicy(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
128 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
129 ProxyPolicy_sequence, hf_index, ett_pkixproxy_ProxyPolicy);
133 static int dissect_proxyPolicy(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
134 return dissect_pkixproxy_ProxyPolicy(FALSE, tvb, offset, pinfo, tree, hf_pkixproxy_proxyPolicy);
138 static const ber_sequence_t ProxyCertInfoExtension_sequence[] = {
139 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pCPathLenConstraint },
140 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_proxyPolicy },
145 dissect_pkixproxy_ProxyCertInfoExtension(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
146 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
147 ProxyCertInfoExtension_sequence, hf_index, ett_pkixproxy_ProxyCertInfoExtension);
154 static void dissect_ProxyCertInfoExtension_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
155 dissect_pkixproxy_ProxyCertInfoExtension(FALSE, tvb, 0, pinfo, tree, hf_pkixproxy_ProxyCertInfoExtension_PDU);
159 /*--- End of included file: packet-pkixproxy-fn.c ---*/
160 #line 51 "packet-pkixproxy-template.c"
163 /*--- proto_register_pkixproxy ----------------------------------------------*/
164 void proto_register_pkixproxy(void) {
167 static hf_register_info hf[] = {
169 /*--- Included file: packet-pkixproxy-hfarr.c ---*/
170 #line 1 "packet-pkixproxy-hfarr.c"
171 { &hf_pkixproxy_ProxyCertInfoExtension_PDU,
172 { "ProxyCertInfoExtension", "pkixproxy.ProxyCertInfoExtension",
173 FT_NONE, BASE_NONE, NULL, 0,
174 "ProxyCertInfoExtension", HFILL }},
175 { &hf_pkixproxy_pCPathLenConstraint,
176 { "pCPathLenConstraint", "pkixproxy.pCPathLenConstraint",
177 FT_INT32, BASE_DEC, NULL, 0,
178 "ProxyCertInfoExtension/pCPathLenConstraint", HFILL }},
179 { &hf_pkixproxy_proxyPolicy,
180 { "proxyPolicy", "pkixproxy.proxyPolicy",
181 FT_NONE, BASE_NONE, NULL, 0,
182 "ProxyCertInfoExtension/proxyPolicy", HFILL }},
183 { &hf_pkixproxy_policyLanguage,
184 { "policyLanguage", "pkixproxy.policyLanguage",
185 FT_OID, BASE_NONE, NULL, 0,
186 "ProxyPolicy/policyLanguage", HFILL }},
187 { &hf_pkixproxy_policy,
188 { "policy", "pkixproxy.policy",
189 FT_BYTES, BASE_HEX, NULL, 0,
190 "ProxyPolicy/policy", HFILL }},
192 /*--- End of included file: packet-pkixproxy-hfarr.c ---*/
193 #line 59 "packet-pkixproxy-template.c"
196 /* List of subtrees */
197 static gint *ett[] = {
199 /*--- Included file: packet-pkixproxy-ettarr.c ---*/
200 #line 1 "packet-pkixproxy-ettarr.c"
201 &ett_pkixproxy_ProxyCertInfoExtension,
202 &ett_pkixproxy_ProxyPolicy,
204 /*--- End of included file: packet-pkixproxy-ettarr.c ---*/
205 #line 64 "packet-pkixproxy-template.c"
208 /* Register protocol */
209 proto_pkixproxy = proto_register_protocol(PNAME, PSNAME, PFNAME);
211 /* Register fields and subtrees */
212 proto_register_field_array(proto_pkixproxy, hf, array_length(hf));
213 proto_register_subtree_array(ett, array_length(ett));
218 /*--- proto_reg_handoff_pkixproxy -------------------------------------------*/
219 void proto_reg_handoff_pkixproxy(void) {
221 /*--- Included file: packet-pkixproxy-dis-tab.c ---*/
222 #line 1 "packet-pkixproxy-dis-tab.c"
223 register_ber_oid_dissector("1.3.6.1.5.5.7.1.14", dissect_ProxyCertInfoExtension_PDU, proto_pkixproxy, "id-pe-proxyCertInfo");
226 /*--- End of included file: packet-pkixproxy-dis-tab.c ---*/
227 #line 79 "packet-pkixproxy-template.c"
228 register_ber_oid_name("1.3.6.1.5.5.7.21.0", "id-ppl-anyLanguage");
229 register_ber_oid_name("1.3.6.1.5.5.7.21.1", "id-ppl-inheritAll");
230 register_ber_oid_name("1.3.6.1.5.5.7.21.2", "id-ppl-independent");