/src/wireshark/epan/dissectors/packet-wlancertextn.c
Line | Count | Source |
1 | | /* Do not modify this file. Changes will be overwritten. */ |
2 | | /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ |
3 | | /* packet-wlancertextn.c */ |
4 | | /* asn2wrs.py -b -q -L -p wlancertextn -c ./wlancertextn.cnf -s ./packet-wlancertextn-template -D . -O ../.. WLANCERTEXTN.asn */ |
5 | | |
6 | | /* packet-wlancertextn.c |
7 | | * Routines for Wireless Certificate Extension (RFC3770) |
8 | | * Ronnie Sahlberg 2005 |
9 | | * |
10 | | * Wireshark - Network traffic analyzer |
11 | | * By Gerald Combs <gerald@wireshark.org> |
12 | | * Copyright 1998 Gerald Combs |
13 | | * |
14 | | * SPDX-License-Identifier: GPL-2.0-or-later |
15 | | */ |
16 | | |
17 | | #include "config.h" |
18 | | |
19 | | #include <epan/packet.h> |
20 | | #include <epan/oids.h> |
21 | | #include <epan/asn1.h> |
22 | | |
23 | | #include <wsutil/array.h> |
24 | | |
25 | | #include "packet-ber.h" |
26 | | #include "packet-x509af.h" |
27 | | #include "packet-x509ce.h" |
28 | | #include "packet-x509sat.h" |
29 | | |
30 | | void proto_register_wlancertextn(void); |
31 | | void proto_reg_handoff_wlancertextn(void); |
32 | | |
33 | | /* Initialize the protocol and registered fields */ |
34 | | static int proto_wlancertextn; |
35 | | static int hf_wlancertextn_SSIDList_PDU; /* SSIDList */ |
36 | | static int hf_wlancertextn_SSIDList_item; /* SSID */ |
37 | | |
38 | | /* Initialize the subtree pointers */ |
39 | | static int ett_wlancertextn_SSIDList; |
40 | | |
41 | | |
42 | | |
43 | | static unsigned |
44 | 0 | dissect_wlancertextn_SSID(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
45 | 0 | offset = dissect_ber_constrained_octet_string(implicit_tag, actx, tree, tvb, offset, |
46 | 0 | 1, 32, hf_index, NULL); |
47 | |
|
48 | 0 | return offset; |
49 | 0 | } |
50 | | |
51 | | |
52 | | static const ber_sequence_t SSIDList_sequence_of[1] = { |
53 | | { &hf_wlancertextn_SSIDList_item, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_wlancertextn_SSID }, |
54 | | }; |
55 | | |
56 | | static unsigned |
57 | 0 | dissect_wlancertextn_SSIDList(bool implicit_tag _U_, tvbuff_t *tvb _U_, unsigned offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { |
58 | 0 | offset = dissect_ber_constrained_sequence_of(implicit_tag, actx, tree, tvb, offset, |
59 | 0 | 1, NO_BOUND, SSIDList_sequence_of, hf_index, ett_wlancertextn_SSIDList); |
60 | |
|
61 | 0 | return offset; |
62 | 0 | } |
63 | | |
64 | | /*--- PDUs ---*/ |
65 | | |
66 | 0 | static int dissect_SSIDList_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) { |
67 | 0 | unsigned offset = 0; |
68 | 0 | asn1_ctx_t asn1_ctx; |
69 | 0 | asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo); |
70 | 0 | offset = dissect_wlancertextn_SSIDList(false, tvb, offset, &asn1_ctx, tree, hf_wlancertextn_SSIDList_PDU); |
71 | 0 | return offset; |
72 | 0 | } |
73 | | |
74 | | |
75 | | |
76 | | /*--- proto_register_wlancertextn ----------------------------------------------*/ |
77 | 16 | void proto_register_wlancertextn(void) { |
78 | | |
79 | | /* List of fields */ |
80 | 16 | static hf_register_info hf[] = { |
81 | 16 | { &hf_wlancertextn_SSIDList_PDU, |
82 | 16 | { "SSIDList", "wlancertextn.SSIDList", |
83 | 16 | FT_UINT32, BASE_DEC, NULL, 0, |
84 | 16 | NULL, HFILL }}, |
85 | 16 | { &hf_wlancertextn_SSIDList_item, |
86 | 16 | { "SSID", "wlancertextn.SSID", |
87 | 16 | FT_BYTES, BASE_NONE, NULL, 0, |
88 | 16 | NULL, HFILL }}, |
89 | 16 | }; |
90 | | |
91 | | /* List of subtrees */ |
92 | 16 | static int *ett[] = { |
93 | 16 | &ett_wlancertextn_SSIDList, |
94 | 16 | }; |
95 | | |
96 | | /* Register protocol */ |
97 | 16 | proto_wlancertextn = proto_register_protocol("Wlan Certificate Extension", "WLANCERTEXTN", "wlancertextn"); |
98 | | |
99 | | /* Register fields and subtrees */ |
100 | 16 | proto_register_field_array(proto_wlancertextn, hf, array_length(hf)); |
101 | 16 | proto_register_subtree_array(ett, array_length(ett)); |
102 | | |
103 | 16 | } |
104 | | |
105 | | |
106 | | /*--- proto_reg_handoff_wlancertextn -------------------------------------------*/ |
107 | 16 | void proto_reg_handoff_wlancertextn(void) { |
108 | 16 | register_ber_oid_dissector("1.3.6.1.5.5.7.1.13", dissect_SSIDList_PDU, proto_wlancertextn, "id-pe-wlanSSID"); |
109 | 16 | register_ber_oid_dissector("1.3.6.1.5.5.7.10.6", dissect_SSIDList_PDU, proto_wlancertextn, "id-aca-wlanSSID"); |
110 | | |
111 | 16 | oid_add_from_string("id-kp-eapOverPPP","1.3.6.1.5.5.7.3.13"); |
112 | 16 | oid_add_from_string("id-kp-eapOverLAN","1.3.6.1.5.5.7.3.14"); |
113 | 16 | } |
114 | | |