30b2571ef51d295d24c7c5de66cc68afc47a92b4
[obnox/wireshark/wip.git] / asn1 / x509sat / packet-x509sat-template.c
1 /* packet-x509sat.c
2  * Routines for X.509 Selected Attribute Types 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., 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/oids.h>
33 #include <epan/asn1.h>
34
35 #include <string.h>
36
37 #include "packet-ber.h"
38 #include "packet-x411.h"
39 #include "packet-x509sat.h"
40 #include "packet-x509if.h"
41
42 #define PNAME  "X.509 Selected Attribute Types"
43 #define PSNAME "X509SAT"
44 #define PFNAME "x509sat"
45
46 /* Initialize the protocol and registered fields */
47 static int proto_x509sat = -1;
48 #include "packet-x509sat-hf.c"
49
50 /* Initialize the subtree pointers */
51 #include "packet-x509sat-ett.c"
52
53 #include "packet-x509sat-fn.c"
54
55
56 /*--- proto_register_x509sat ----------------------------------------------*/
57 void proto_register_x509sat(void) {
58
59   /* List of fields */
60   static hf_register_info hf[] = {
61 #include "packet-x509sat-hfarr.c"
62   };
63
64   /* List of subtrees */
65   static gint *ett[] = {
66 #include "packet-x509sat-ettarr.c"
67   };
68
69   /* Register protocol */
70   proto_x509sat = proto_register_protocol(PNAME, PSNAME, PFNAME);
71
72   /* Register fields and subtrees */
73   proto_register_field_array(proto_x509sat, hf, array_length(hf));
74   proto_register_subtree_array(ett, array_length(ett));
75
76 }
77
78
79 /*--- proto_reg_handoff_x509sat -------------------------------------------*/
80 void proto_reg_handoff_x509sat(void) {
81 #include "packet-x509sat-dis-tab.c"
82
83   /* OBJECT CLASSES */
84
85   oid_add_from_string("top","2.5.6.0");
86   oid_add_from_string("alias","2.5.6.1");
87   oid_add_from_string("country","2.5.6.2");
88   oid_add_from_string("locality","2.5.6.3");
89   oid_add_from_string("organization","2.5.6.4");
90   oid_add_from_string("organizationalUnit","2.5.6.5");
91   oid_add_from_string("person","2.5.6.6");
92   oid_add_from_string("organizationalPerson","2.5.6.7");
93   oid_add_from_string("organizationalRole","2.5.6.8");
94   oid_add_from_string("groupOfNames","2.5.6.9");
95   oid_add_from_string("residentialPerson","2.5.6.10");
96   oid_add_from_string("applicationProcess","2.5.6.11");
97   oid_add_from_string("applicationEntity","2.5.6.12");
98   oid_add_from_string("dSA","2.5.6.13");
99   oid_add_from_string("device","2.5.6.14");
100   oid_add_from_string("strongAuthenticationUser","2.5.6.15");
101   oid_add_from_string("certificationAuthority","2.5.6.16");
102   oid_add_from_string("certificationAuthorityV2","2.5.6.16.2");
103   oid_add_from_string("groupOfUniqueNames","2.5.6.17");
104   oid_add_from_string("userSecurityInformation","2.5.6.18");
105   oid_add_from_string("cRLDistributionPoint","2.5.6.19");
106   oid_add_from_string("dmd","2.5.6.20");
107   oid_add_from_string("pkiUser","2.5.6.21");
108   oid_add_from_string("pkiCA","2.5.6.22");
109   
110   oid_add_from_string("parent","2.5.6.28");
111   oid_add_from_string("child","2.5.6.29");
112
113   /* RFC 2247 */
114   oid_add_from_string("dcObject","1.3.6.1.4.1.1446.344");
115   oid_add_from_string("domain","0.9.2342.19200300.100.4.13");
116
117 }
118
119
120