/src/wireshark/epan/dissectors/packet-h248_7.c
Line | Count | Source |
1 | | /* |
2 | | * packet-h248_7.c |
3 | | * H.248.7 |
4 | | * Gateway control protocol: Generic Announcement package |
5 | | * |
6 | | * (c) 2007, Luis E. Garcia Ontanon <luis@ontanon.org> |
7 | | * |
8 | | * Wireshark - Network traffic analyzer |
9 | | * By Gerald Combs <gerald@wireshark.org> |
10 | | * Copyright 1998 Gerald Combs |
11 | | * |
12 | | * SPDX-License-Identifier: GPL-2.0-or-later |
13 | | */ |
14 | | |
15 | | #include "config.h" |
16 | | |
17 | | #include "packet-h248.h" |
18 | | |
19 | | void proto_register_h248_7(void); |
20 | | |
21 | | static int proto_h248_an; |
22 | | |
23 | | static int hf_h248_an_apf; |
24 | | static int hf_h248_an_apf_an; |
25 | | static int hf_h248_an_apf_noc; |
26 | | static int hf_h248_an_apf_av; |
27 | | static int hf_h248_an_apf_di; |
28 | | |
29 | | static int hf_h248_an_apv; |
30 | | static int hf_h248_an_apv_an; |
31 | | static int hf_h248_an_apv_noc; |
32 | | static int hf_h248_an_apv_av; |
33 | | static int hf_h248_an_apv_num; |
34 | | static int hf_h248_an_apv_spi; |
35 | | static int hf_h248_an_apv_sp; |
36 | | static int hf_h248_an_apv_di; |
37 | | |
38 | | static int ett_h248_an; |
39 | | static int ett_h248_an_apf; |
40 | | static int ett_h248_an_apv; |
41 | | |
42 | | static const value_string h248_an_prop_vals[] = { |
43 | | { 0, "Generic Announcement Package (an) (H.248.7)" }, |
44 | | { 0, NULL } |
45 | | }; |
46 | | |
47 | | static const value_string h248_an_signals_vals[] = { |
48 | | { 0x0001, "Announcement Play Fixed (apf)"}, |
49 | | { 0x0002, "Announcement Play Variable (apv)"}, |
50 | | {0,NULL} |
51 | | }; |
52 | | |
53 | | |
54 | | static const value_string h248_an_apf_params_vals[] = { |
55 | | { 0x0001, "Name (an)"}, |
56 | | { 0x0002, "Number of Cycles (noc)"}, |
57 | | { 0x0003, "Variant (av)"}, |
58 | | { 0x0004, "Direction (di)"}, |
59 | | {0,NULL} |
60 | | }; |
61 | | |
62 | | static const value_string h248_an_apv_params_vals[] = { |
63 | | { 0x0001, "Name (an)"}, |
64 | | { 0x0002, "Number of Cycles (noc)"}, |
65 | | { 0x0003, "Variant (av)"}, |
66 | | { 0x0004, "Number (num)"}, |
67 | | { 0x0005, "Specific Parameters Interpretation (spi)"}, |
68 | | { 0x0006, "Specific Parameters (sp)"}, |
69 | | { 0x0007, "Direction (di)"}, |
70 | | {0,NULL} |
71 | | }; |
72 | | |
73 | | static const value_string h248_an_di_vals[] = { |
74 | | { 0x0001, "External (ext)"}, |
75 | | { 0x0002, "Internal (int)"}, |
76 | | { 0x0003, "Both (both)"}, |
77 | | {0,NULL} |
78 | | }; |
79 | | |
80 | | |
81 | | |
82 | | |
83 | | static const h248_pkg_param_t h248_an_apf_params[] = { |
84 | | { 0x0001, &hf_h248_an_apf_an, h248_param_ber_integer, NULL }, |
85 | | { 0x0002, &hf_h248_an_apf_noc, h248_param_ber_integer, NULL }, |
86 | | { 0x0003, &hf_h248_an_apf_av, h248_param_ber_octetstring, NULL }, |
87 | | { 0x0004, &hf_h248_an_apf_di, h248_param_ber_integer, NULL }, |
88 | | { 0, NULL, NULL, NULL} |
89 | | }; |
90 | | |
91 | | static const h248_pkg_param_t h248_an_apv_params[] = { |
92 | | { 0x0001, &hf_h248_an_apv_an, h248_param_ber_integer, NULL }, |
93 | | { 0x0002, &hf_h248_an_apv_noc, h248_param_ber_integer, NULL }, |
94 | | { 0x0003, &hf_h248_an_apv_av, h248_param_ber_octetstring, NULL }, |
95 | | { 0x0004, &hf_h248_an_apv_num, h248_param_ber_integer, NULL }, |
96 | | { 0x0005, &hf_h248_an_apv_spi, h248_param_ber_integer, NULL }, |
97 | | { 0x0006, &hf_h248_an_apv_sp, h248_param_ber_octetstring, NULL }, |
98 | | { 0x0007, &hf_h248_an_apv_di, h248_param_ber_integer, NULL }, |
99 | | { 0, NULL, NULL, NULL} |
100 | | }; |
101 | | |
102 | | static const h248_pkg_sig_t h248_an_signals[] = { |
103 | | { 0x0001, &hf_h248_an_apf, &ett_h248_an_apf, h248_an_apf_params, h248_an_apf_params_vals }, |
104 | | { 0x0002, &hf_h248_an_apv, &ett_h248_an_apv, h248_an_apv_params, h248_an_apv_params_vals }, |
105 | | { 0, NULL, NULL, NULL, NULL} |
106 | | }; |
107 | | |
108 | | static h248_package_t h248_pkg_an = { |
109 | | 0x001d, |
110 | | &proto_h248_an, |
111 | | &ett_h248_an, |
112 | | h248_an_prop_vals, |
113 | | h248_an_signals_vals, |
114 | | NULL, |
115 | | NULL, |
116 | | NULL, /* Properties */ |
117 | | h248_an_signals, /* signals */ |
118 | | NULL, /* events */ |
119 | | NULL /* statistics */ |
120 | | }; |
121 | | |
122 | | |
123 | | |
124 | | |
125 | | |
126 | | |
127 | 16 | void proto_register_h248_7(void) { |
128 | 16 | static hf_register_info hf[] = { |
129 | 16 | { &hf_h248_an_apf, { "Fixed Announcement Play", "h248.an.apf", FT_BYTES, BASE_NONE, NULL, 0, "Initiates the play of a fixed announcement", HFILL }}, |
130 | 16 | { &hf_h248_an_apf_an, { "Announcement name", "h248.an.apf.an", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
131 | 16 | { &hf_h248_an_apf_noc, { "Number of cycles", "h248.an.apf.noc", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, |
132 | 16 | { &hf_h248_an_apf_av, { "Announcement Variant", "h248.an.apf.av", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, |
133 | 16 | { &hf_h248_an_apf_di, {"Announcement Direction","h248.an.apf.di",FT_UINT32, BASE_HEX, VALS(h248_an_di_vals), 0, NULL, HFILL}}, |
134 | | |
135 | 16 | { &hf_h248_an_apv, { "Fixed Announcement Play", "h248.an.apv", FT_BYTES, BASE_NONE, NULL, 0, "Initiates the play of a fixed announcement", HFILL }}, |
136 | 16 | { &hf_h248_an_apv_an, { "Announcement name", "h248.an.apv.an", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
137 | 16 | { &hf_h248_an_apv_noc, { "Number of cycles", "h248.an.apv.noc", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, |
138 | 16 | { &hf_h248_an_apv_av, { "Announcement Variant", "h248.an.apv.av", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, |
139 | 16 | { &hf_h248_an_apv_num, { "Number", "h248.an.apv.num", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, |
140 | 16 | { &hf_h248_an_apv_spi, { "Specific parameters interpretation", "h248.an.apv.spi", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, |
141 | 16 | { &hf_h248_an_apv_sp, { "Specific parameters", "h248.an.apv.sp", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, |
142 | 16 | { &hf_h248_an_apv_di, {"Announcement Direction","h248.an.apv.di",FT_UINT32, BASE_HEX, VALS(h248_an_di_vals), 0, NULL, HFILL}} |
143 | | |
144 | 16 | }; |
145 | | |
146 | 16 | static int *ett[] = { |
147 | 16 | &ett_h248_an, |
148 | 16 | &ett_h248_an_apf, |
149 | 16 | &ett_h248_an_apv |
150 | 16 | }; |
151 | | |
152 | 16 | proto_h248_an = proto_register_protocol("H.248.7", "H248AN", "h248.an"); |
153 | | |
154 | 16 | proto_register_field_array(proto_h248_an, hf, array_length(hf)); |
155 | | |
156 | 16 | proto_register_subtree_array(ett, array_length(ett)); |
157 | | |
158 | 16 | h248_register_package(&h248_pkg_an,REPLACE_PKG); |
159 | 16 | } |
160 | | |
161 | | /* |
162 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
163 | | * |
164 | | * Local variables: |
165 | | * c-basic-offset: 8 |
166 | | * tab-width: 8 |
167 | | * indent-tabs-mode: t |
168 | | * End: |
169 | | * |
170 | | * vi: set shiftwidth=8 tabstop=8 noexpandtab: |
171 | | * :indentSize=8:tabSize=8:noTabs=false: |
172 | | */ |