- Forward declaration of register functions.
[metze/wireshark/wip.git] / asn1 / crmf / packet-crmf-template.c
1 /* packet-crmf.c
2  * Routines for RFC2511 Certificate Request Message Format packet dissection
3  *   Ronnie Sahlberg 2004
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25
26 #include "config.h"
27
28 #include <glib.h>
29 #include <epan/packet.h>
30 #include <epan/oids.h>
31 #include <epan/asn1.h>
32
33 #include "packet-ber.h"
34 #include "packet-crmf.h"
35 #include "packet-cms.h"
36 #include "packet-pkix1explicit.h"
37 #include "packet-pkix1implicit.h"
38
39 #define PNAME  "Certificate Request Message Format"
40 #define PSNAME "CRMF"
41 #define PFNAME "crmf"
42
43 void proto_register_crmf(void);
44 void proto_reg_handoff_crmf(void);
45
46 /* Initialize the protocol and registered fields */
47 static int proto_crmf = -1;
48 static int hf_crmf_type_oid = -1;
49 #include "packet-crmf-hf.c"
50
51 /* Initialize the subtree pointers */
52 #include "packet-crmf-ett.c"
53 #include "packet-crmf-fn.c"
54
55
56 /*--- proto_register_crmf ----------------------------------------------*/
57 void proto_register_crmf(void) {
58
59   /* List of fields */
60   static hf_register_info hf[] = {
61     { &hf_crmf_type_oid,
62       { "Type", "crmf.type.oid",
63         FT_STRING, BASE_NONE, NULL, 0,
64         "Type of AttributeTypeAndValue", HFILL }},
65 #include "packet-crmf-hfarr.c"
66   };
67
68   /* List of subtrees */
69   static gint *ett[] = {
70 #include "packet-crmf-ettarr.c"
71   };
72
73   /* Register protocol */
74   proto_crmf = proto_register_protocol(PNAME, PSNAME, PFNAME);
75
76   /* Register fields and subtrees */
77   proto_register_field_array(proto_crmf, hf, array_length(hf));
78   proto_register_subtree_array(ett, array_length(ett));
79
80 }
81
82
83 /*--- proto_reg_handoff_crmf -------------------------------------------*/
84 void proto_reg_handoff_crmf(void) {
85         oid_add_from_string("id-pkip","1.3.6.1.5.5.7.5");
86         oid_add_from_string("id-regCtrl","1.3.6.1.5.5.7.5.1");
87         oid_add_from_string("id-regInfo","1.3.6.1.5.5.7.5.2");
88 #include "packet-crmf-dis-tab.c"
89 }
90