- dissect_ber_object_identifier() returns value as tvb
[obnox/wireshark/wip.git] / asn1 / pkix1explicit / packet-pkix1explicit-template.c
1 #define BER_UNI_TAG_TeletexString           20  /* workaround bug in asn2eth */
2
3 /* packet-pkix1explicit.c
4  * Routines for PKIX1Explitic packet dissection
5  *
6  * $Id$
7  *
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@ethereal.com>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <glib.h>
32 #include <epan/packet.h>
33 #include <epan/conversation.h>
34
35 #include <stdio.h>
36 #include <string.h>
37
38 #include "packet-ber.h"
39 #include "packet-pkix1explicit.h"
40 #include "packet-x509af.h"
41 #include "packet-x509if.h"
42 #include "packet-x509ce.h"
43
44 #define PNAME  "PKIX1Explitit"
45 #define PSNAME "PKIX1EXPLICIT"
46 #define PFNAME "pkix1explicit"
47
48 /* Initialize the protocol and registered fields */
49 static int proto_pkix1explicit = -1;
50 static int hf_pkix1explicit_object_identifier_id = -1;
51 #include "packet-pkix1explicit-hf.c"
52
53 /* Initialize the subtree pointers */
54 #include "packet-pkix1explicit-ett.c"
55
56
57 static const char *object_identifier_id;
58
59 int
60 dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
61   offset = dissect_x509af_Certificate(implicit_tag, tvb, offset, pinfo, tree, hf_index);
62
63   return offset;
64 }
65 int
66 dissect_pkix1explicit_CertificateList(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
67   offset = dissect_x509af_CertificateList(implicit_tag, tvb, offset, pinfo, tree, hf_index);
68
69   return offset;
70 }
71 int
72 dissect_pkix1explicit_GeneralName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
73   offset = dissect_x509ce_GeneralName(implicit_tag, tvb, offset, pinfo, tree, hf_index);
74
75   return offset;
76 }
77 int
78 dissect_pkix1explicit_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
79   offset = dissect_x509if_Name(implicit_tag, tvb, offset, pinfo, tree, hf_index);
80
81   return offset;
82 }
83 int
84 dissect_pkix1explicit_AlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
85   offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
86
87   return offset;
88 }
89
90 int
91 dissect_pkix1explicit_SubjectPublicKeyInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) {
92   offset = dissect_x509af_SubjectPublicKeyInfo(implicit_tag, tvb, offset, pinfo, tree, hf_index);
93
94   return offset;
95 }
96
97
98 #include "packet-pkix1explicit-fn.c"
99
100
101 /*--- proto_register_pkix1explicit ----------------------------------------------*/
102 void proto_register_pkix1explicit(void) {
103
104   /* List of fields */
105   static hf_register_info hf[] = {
106     { &hf_pkix1explicit_object_identifier_id, 
107       { "Id", "pkix1explicit.id", FT_STRING, BASE_NONE, NULL, 0,
108         "Object identifier Id", HFILL }},
109 #include "packet-pkix1explicit-hfarr.c"
110   };
111
112   /* List of subtrees */
113   static gint *ett[] = {
114 #include "packet-pkix1explicit-ettarr.c"
115   };
116
117   /* Register protocol */
118   proto_pkix1explicit = proto_register_protocol(PNAME, PSNAME, PFNAME);
119
120   /* Register fields and subtrees */
121   proto_register_field_array(proto_pkix1explicit, hf, array_length(hf));
122   proto_register_subtree_array(ett, array_length(ett));
123
124 }
125
126
127 /*--- proto_reg_handoff_pkix1explicit -------------------------------------------*/
128 void proto_reg_handoff_pkix1explicit(void) {
129 #include "packet-pkix1explicit-dis-tab.c"
130 }
131