/src/wireshark/epan/dissectors/packet-h248_2.c
Line | Count | Source |
1 | | /* |
2 | | * packet-h248_2.c |
3 | | * |
4 | | * H.248.2 |
5 | | * Gateway control protocol: Facsimile, text conversation and call discrimination packages |
6 | | * |
7 | | * (c) 2012, Anders broman <anders.broman@ericsson.com> |
8 | | * |
9 | | * Wireshark - Network traffic analyzer |
10 | | * By Gerald Combs <gerald@wireshark.org> |
11 | | * Copyright 1998 Gerald Combs |
12 | | * |
13 | | * SPDX-License-Identifier: GPL-2.0-or-later |
14 | | * |
15 | | */ |
16 | | |
17 | | #include "config.h" |
18 | | |
19 | | #include "packet-h248.h" |
20 | | |
21 | | void proto_register_h248_dot2(void); |
22 | | |
23 | | static int proto_h248_2; |
24 | | |
25 | | /* static int hf_h248_2_dtone_evt; */ |
26 | | static int hf_h248_2_dtone_dtt_obs_evt; |
27 | | static int hf_h248_2_dtone_dtt_obs_evt_val; |
28 | | |
29 | | static int ett_h248_2; |
30 | | static int ett_h248_2_dtone_dtt_obs_evt; |
31 | | |
32 | | |
33 | | static const value_string hf_h248_2_dtone_dtt_obs_evt_val_values[] = { |
34 | | /*For FAX*/ |
35 | | { 0x0001, "CNG"}, /* A T.30 fax calling tone */ |
36 | | { 0x0002, "V21flag"}, /* V21 tone and flags for fax answering */ |
37 | | /* For TEXT */ |
38 | | { 0x0003, "XCI"}, /* A V.18 XCI */ |
39 | | { 0x0004, "V18txp1"}, /* A V.18 txp signal in channel V.21(1) */ |
40 | | { 0x0005, "V18txp2"}, /* A V.18 txp signal in channel V.21(2) */ |
41 | | { 0x0006, "BellHi"}, /* A Bell 103 carrier on the high channel */ |
42 | | { 0x0007, "BellLo"}, /* A Bell 103 low channel */ |
43 | | { 0x0008, "Baudot45"}, /* Baudot45 initial carrier and characters */ |
44 | | { 0x0009, "Baudot50"}, /* A Baudot50 initial carrier and characters */ |
45 | | { 0x000a, "Edt"}, /* An EDT initial tone and characters */ |
46 | | { 0x000b, "DTMF"}, /* DTMF signals */ |
47 | | { 0x001c, "CTM"}, /* CTM signals */ |
48 | | /* For DATA */ |
49 | | { 0x000c, "Sig"}, /* Modulation signal from a mode only used for data, i.e., not V.21, V.23 nor Bell 103 */ |
50 | | /* Common to TEXT and DATA */ |
51 | | { 0x000d, "CT"}, /* A V.25 calling tone */ |
52 | | { 0x000e, "V21hi"}, /* A V.21 carrier on the higher frequency channel */ |
53 | | { 0x000f, "V21lo"}, /* A V.21 carrier on the low frequency channel */ |
54 | | { 0x0010, "V23hi"}, /* A V.23 high carrier */ |
55 | | { 0x0011, "V23lo"}, /* A V.23 low carrier */ |
56 | | { 0x0012, "CI"}, /* A V.8 CI with contents in "dtvalue" */ |
57 | | /* Common to FAX, TEXT and DATA */ |
58 | | { 0x0013, "ANS(T.30 CED)"}, /* V.25 ANS, equivalent to T.30 CED from answering terminal */ |
59 | | { 0x0014, "ANSbar"}, /* V.25 ANS with phase reversals" */ |
60 | | { 0x0015, "ANSAM"}, /* V.8 ANSam */ |
61 | | { 0x0016, "ANSAMbar"}, /* V.8 ANSam with phase reversals */ |
62 | | { 0x0017, "CM"}, /* V.8 CM with contents in "dtvalue" */ |
63 | | { 0x0018, "CJ"}, /* V.8 CJ */ |
64 | | { 0x0019, "JM"}, /* V.8 JM with contents in "dtvalue" */ |
65 | | { 0x001a, "ENDOFSIG"}, /* End of reported signal detected reported for continuous or repeated signals */ |
66 | | { 0x001b, "V8BIS"}, /* V.8 bis signal, with signal type in parameter V8bistype and value in "dtvalue" */ |
67 | | { 0, NULL } |
68 | | }; |
69 | | |
70 | | static const h248_pkg_param_t h248_2_dtone_dtt_obs_evt_params[] = { |
71 | | { 0x0001, &hf_h248_2_dtone_dtt_obs_evt_val, h248_param_ber_integer, NULL }, |
72 | | { 0, NULL, NULL, NULL} |
73 | | }; |
74 | | |
75 | | |
76 | | static const value_string h248_2_ctype_events_vals[] = { |
77 | | { 0x0001, "Discriminating Tone Detected(dtone)"}, |
78 | | { 0x0002, "Call Type Discrimination Result(calldisres)"}, |
79 | | { 0, NULL } |
80 | | }; |
81 | | |
82 | | static const h248_pkg_evt_t h248_pkg_generic_cause_evts[] = { |
83 | | { 0x0001, &hf_h248_2_dtone_dtt_obs_evt, &ett_h248_2_dtone_dtt_obs_evt, h248_2_dtone_dtt_obs_evt_params, h248_2_ctype_events_vals}, |
84 | | { 0, NULL, NULL, NULL, NULL} |
85 | | }; |
86 | | |
87 | | |
88 | | |
89 | | /* Call Type Discrimination Package */ |
90 | | static h248_package_t h248_pkg_ctype = { |
91 | | 0x0011, /* Id */ |
92 | | &proto_h248_2, /* hfid */ |
93 | | &ett_h248_2, /* ett */ |
94 | | |
95 | | NULL, /* value_string param_names */ |
96 | | NULL, /* value_string signal_names */ |
97 | | h248_2_ctype_events_vals, /* value_string event_names */ |
98 | | NULL, /* value_string stats_names */ |
99 | | |
100 | | NULL, /* properties */ |
101 | | NULL, /* signals */ |
102 | | h248_pkg_generic_cause_evts, /* events */ |
103 | | NULL /* statistics */ |
104 | | }; |
105 | | |
106 | 15 | void proto_register_h248_dot2(void) { |
107 | 15 | static hf_register_info hf[] = { |
108 | | #if 0 |
109 | | { &hf_h248_2_dtone_evt, |
110 | | { "Discriminating Tone Type", "h248.2.dtt", |
111 | | FT_BYTES, BASE_NONE, NULL, 0, |
112 | | NULL, HFILL } |
113 | | }, |
114 | | #endif |
115 | 15 | { &hf_h248_2_dtone_dtt_obs_evt, |
116 | 15 | { "Discriminating Tone Type(dtt)", "h248.2.dtt", |
117 | 15 | FT_BYTES, BASE_NONE, NULL, 0, |
118 | 15 | NULL, HFILL }, |
119 | 15 | }, |
120 | 15 | { &hf_h248_2_dtone_dtt_obs_evt_val, |
121 | 15 | { "call type", "h248.2.dtt.val", |
122 | 15 | FT_UINT32, BASE_DEC, VALS(hf_h248_2_dtone_dtt_obs_evt_val_values) , 0, |
123 | 15 | NULL, HFILL } |
124 | 15 | }, |
125 | | |
126 | 15 | }; |
127 | | |
128 | 15 | static int *ett[] = { |
129 | 15 | &ett_h248_2, |
130 | 15 | &ett_h248_2_dtone_dtt_obs_evt, |
131 | 15 | }; |
132 | | |
133 | 15 | proto_h248_2 = proto_register_protocol("H.248.2", "H248_2", "h248.2"); |
134 | | |
135 | 15 | proto_register_field_array(proto_h248_2, hf, array_length(hf)); |
136 | | |
137 | 15 | proto_register_subtree_array(ett, array_length(ett)); |
138 | | |
139 | 15 | h248_register_package(&h248_pkg_ctype,MERGE_PKG_HIGH); |
140 | 15 | } |
141 | | |
142 | | /* |
143 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
144 | | * |
145 | | * Local variables: |
146 | | * c-basic-offset: 4 |
147 | | * tab-width: 8 |
148 | | * indent-tabs-mode: nil |
149 | | * End: |
150 | | * |
151 | | * vi: set shiftwidth=4 tabstop=8 expandtab: |
152 | | * :indentSize=4:tabSize=8:noTabs=true: |
153 | | */ |