New protocol: RFC2634 ExtendedSecurityServices
[metze/wireshark/wip.git] / asn1 / cms / packet-cms-template.c
1 /* packet-cms.c
2  * Routines for RFC2630 Cryptographic Message Syntax packet dissection
3  *   Ronnie Sahlberg 2004
4  *
5  * $Id$
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 # include "config.h"
28 #endif
29
30 #include <glib.h>
31 #include <epan/packet.h>
32 #include <epan/conversation.h>
33
34 #include <stdio.h>
35 #include <string.h>
36
37 #include "packet-ber.h"
38 #include "packet-cms.h"
39 #include "packet-x509af.h"
40 #include "packet-x509if.h"
41
42 #define PNAME  "Cryptographic Message Syntax"
43 #define PSNAME "CMS"
44 #define PFNAME "cms"
45
46 /* Initialize the protocol and registered fields */
47 int proto_cms = -1;
48 static int hf_cms_ci_contentType = -1;
49 #include "packet-cms-hf.c"
50
51 /* Initialize the subtree pointers */
52 #include "packet-cms-ett.c"
53
54 static char object_identifier_id[64]; /*64 chars should be long enough? */
55
56 #include "packet-cms-fn.c"
57
58
59 /*--- proto_register_cms ----------------------------------------------*/
60 void proto_register_cms(void) {
61
62   /* List of fields */
63   static hf_register_info hf[] = {
64     { &hf_cms_ci_contentType,
65       { "contentType", "cms.contentInfo.contentType",
66         FT_STRING, BASE_NONE, NULL, 0,
67         "ContentType", HFILL }},
68 #include "packet-cms-hfarr.c"
69   };
70
71   /* List of subtrees */
72   static gint *ett[] = {
73 #include "packet-cms-ettarr.c"
74   };
75
76   /* Register protocol */
77   proto_cms = proto_register_protocol(PNAME, PSNAME, PFNAME);
78
79   /* Register fields and subtrees */
80   proto_register_field_array(proto_cms, hf, array_length(hf));
81   proto_register_subtree_array(ett, array_length(ett));
82
83 }
84
85
86 /*--- proto_reg_handoff_cms -------------------------------------------*/
87 void proto_reg_handoff_cms(void) {
88 #include "packet-cms-dis-tab.c"
89 }
90