From Kovarththanan Rajaratnam via bug 3548:
[obnox/wireshark/wip.git] / epan / dissectors / packet-wlancertextn.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler   */
3 /* packet-wlancertextn.c                                                      */
4 /* ../../tools/asn2wrs.py -b -p wlancertextn -c ./wlancertextn.cnf -s ./packet-wlancertextn-template -D . WLANCERTEXTN.asn */
5
6 /* Input file: packet-wlancertextn-template.c */
7
8 #line 1 "packet-wlancertextn-template.c"
9 /* packet-wlancertextn.c
10  * Routines for Wireless Certificate Extension (RFC3770)
11  *  Ronnie Sahlberg 2005
12  *
13  * $Id$
14  *
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
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.
23  *
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.
28  *
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.
32  */
33
34 #ifdef HAVE_CONFIG_H
35 # include "config.h"
36 #endif
37
38 #include <glib.h>
39 #include <epan/packet.h>
40 #include <epan/oids.h>
41 #include <epan/asn1.h>
42
43 #include <stdio.h>
44 #include <string.h>
45
46 #include "packet-ber.h"
47 #include "packet-wlancertextn.h"
48 #include "packet-x509af.h"
49 #include "packet-x509ce.h"
50 #include "packet-x509sat.h"
51
52 #define PNAME  "Wlan Certificate Extension"
53 #define PSNAME "WLANCERTEXTN"
54 #define PFNAME "wlancertextn"
55
56 /* Initialize the protocol and registered fields */
57 int proto_wlancertextn = -1;
58
59 /*--- Included file: packet-wlancertextn-hf.c ---*/
60 #line 1 "packet-wlancertextn-hf.c"
61 static int hf_wlancertextn_SSIDList_PDU = -1;     /* SSIDList */
62 static int hf_wlancertextn_SSIDList_item = -1;    /* SSID */
63
64 /*--- End of included file: packet-wlancertextn-hf.c ---*/
65 #line 51 "packet-wlancertextn-template.c"
66
67 /* Initialize the subtree pointers */
68
69 /*--- Included file: packet-wlancertextn-ett.c ---*/
70 #line 1 "packet-wlancertextn-ett.c"
71 static gint ett_wlancertextn_SSIDList = -1;
72
73 /*--- End of included file: packet-wlancertextn-ett.c ---*/
74 #line 54 "packet-wlancertextn-template.c"
75
76
77 /*--- Included file: packet-wlancertextn-fn.c ---*/
78 #line 1 "packet-wlancertextn-fn.c"
79
80
81 static int
82 dissect_wlancertextn_SSID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
83   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
84                                        NULL);
85
86   return offset;
87 }
88
89
90 static const ber_sequence_t SSIDList_sequence_of[1] = {
91   { &hf_wlancertextn_SSIDList_item, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_wlancertextn_SSID },
92 };
93
94 static int
95 dissect_wlancertextn_SSIDList(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
96   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
97                                       SSIDList_sequence_of, hf_index, ett_wlancertextn_SSIDList);
98
99   return offset;
100 }
101
102 /*--- PDUs ---*/
103
104 static void dissect_SSIDList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
105   asn1_ctx_t asn1_ctx;
106   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
107   dissect_wlancertextn_SSIDList(FALSE, tvb, 0, &asn1_ctx, tree, hf_wlancertextn_SSIDList_PDU);
108 }
109
110
111 /*--- End of included file: packet-wlancertextn-fn.c ---*/
112 #line 56 "packet-wlancertextn-template.c"
113
114
115 /*--- proto_register_wlancertextn ----------------------------------------------*/
116 void proto_register_wlancertextn(void) {
117
118   /* List of fields */
119   static hf_register_info hf[] = {
120
121 /*--- Included file: packet-wlancertextn-hfarr.c ---*/
122 #line 1 "packet-wlancertextn-hfarr.c"
123     { &hf_wlancertextn_SSIDList_PDU,
124       { "SSIDList", "wlancertextn.SSIDList",
125         FT_UINT32, BASE_DEC, NULL, 0,
126         "wlancertextn.SSIDList", HFILL }},
127     { &hf_wlancertextn_SSIDList_item,
128       { "SSID", "wlancertextn.SSID",
129         FT_BYTES, BASE_NONE, NULL, 0,
130         "wlancertextn.SSID", HFILL }},
131
132 /*--- End of included file: packet-wlancertextn-hfarr.c ---*/
133 #line 64 "packet-wlancertextn-template.c"
134   };
135
136   /* List of subtrees */
137   static gint *ett[] = {
138
139 /*--- Included file: packet-wlancertextn-ettarr.c ---*/
140 #line 1 "packet-wlancertextn-ettarr.c"
141     &ett_wlancertextn_SSIDList,
142
143 /*--- End of included file: packet-wlancertextn-ettarr.c ---*/
144 #line 69 "packet-wlancertextn-template.c"
145   };
146
147   /* Register protocol */
148   proto_wlancertextn = proto_register_protocol(PNAME, PSNAME, PFNAME);
149
150   /* Register fields and subtrees */
151   proto_register_field_array(proto_wlancertextn, hf, array_length(hf));
152   proto_register_subtree_array(ett, array_length(ett));
153
154 }
155
156
157 /*--- proto_reg_handoff_wlancertextn -------------------------------------------*/
158 void proto_reg_handoff_wlancertextn(void) {
159
160 /*--- Included file: packet-wlancertextn-dis-tab.c ---*/
161 #line 1 "packet-wlancertextn-dis-tab.c"
162   register_ber_oid_dissector("1.3.6.1.5.5.7.1.13", dissect_SSIDList_PDU, proto_wlancertextn, "id-pe-wlanSSID");
163   register_ber_oid_dissector("1.3.6.1.5.5.7.10.6", dissect_SSIDList_PDU, proto_wlancertextn, "id-aca-wlanSSID");
164
165
166 /*--- End of included file: packet-wlancertextn-dis-tab.c ---*/
167 #line 84 "packet-wlancertextn-template.c"
168   oid_add_from_string("id-kp-eapOverPPP","1.3.6.1.5.5.7.3.13");
169   oid_add_from_string("id-kp-eapOverLAN","1.3.6.1.5.5.7.3.14");
170 }
171