libosmogsm 1.13.1.1-afb4 Osmocom GSM library

gsm_23_032.h
Go to the documentation of this file.
1
5/*
6 * (C) 2020 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
7 *
8 * All Rights Reserved
9 *
10 * Author: Neels Hofmeyr <neels@hofmeyr.de>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Affero General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (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 Affero General Public License for more details.
21 *
22 * You should have received a copy of the GNU Affero General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 *
25 */
26
27#pragma once
28
29#include <stdint.h>
30#include <osmocom/core/endian.h>
31
32 enum gad_type {
34 GAD_TYPE_ELL_POINT = 0,
36 GAD_TYPE_ELL_POINT_UNC_CIRCLE = 1,
38 GAD_TYPE_ELL_POINT_UNC_ELLIPSE = 3,
39 GAD_TYPE_POLYGON = 5,
41 GAD_TYPE_ELL_POINT_ALT = 8,
43 GAD_TYPE_ELL_POINT_ALT_UNC_ELL = 9,
45 GAD_TYPE_ELL_ARC = 10,
47 GAD_TYPE_HA_ELL_POINT_UNC_ELLIPSE = 11,
49 GAD_TYPE_HA_ELL_POINT_ALT_UNC_ELL = 12,
50};
51
52 struct gad_raw_head {
53#if OSMO_IS_LITTLE_ENDIAN
54 uint8_t spare:4,
55 type:4;
56#elif OSMO_IS_BIG_ENDIAN
57/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
58 uint8_t type:4, spare:4;
59#endif
60} __attribute__ ((packed));
61
62 struct gad_raw_ell_point {
63 struct gad_raw_head h;
64 uint8_t lat[3];
65 uint8_t lon[3];
66} __attribute__ ((packed));
67
68 struct gad_raw_ell_point_unc_circle {
69#if OSMO_IS_LITTLE_ENDIAN
70 struct gad_raw_head h;
71 uint8_t lat[3];
72 uint8_t lon[3];
73 uint8_t unc:7,
74 spare2:1;
75#elif OSMO_IS_BIG_ENDIAN
76/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
77 struct gad_raw_head h;
78 uint8_t lat[3];
79 uint8_t lon[3];
80 uint8_t spare2:1, unc:7;
81#endif
82} __attribute__ ((packed));
83
84 struct gad_raw_ell_point_unc_ellipse {
85#if OSMO_IS_LITTLE_ENDIAN
86 struct gad_raw_head h;
87 uint8_t lat[3];
88 uint8_t lon[3];
89 uint8_t unc_semi_major:7,
90 spare1:1;
91 uint8_t unc_semi_minor:7,
92 spare2:1;
93 uint8_t major_ori;
94 uint8_t confidence:7,
95 spare3:1;
96#elif OSMO_IS_BIG_ENDIAN
97/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
98 struct gad_raw_head h;
99 uint8_t lat[3];
100 uint8_t lon[3];
101 uint8_t spare1:1, unc_semi_major:7;
102 uint8_t spare2:1, unc_semi_minor:7;
103 uint8_t major_ori;
104 uint8_t spare3:1, confidence:7;
105#endif
106} __attribute__ ((packed));
107
108 struct gad_raw_polygon {
109 struct {
110#if OSMO_IS_LITTLE_ENDIAN
111 uint8_t num_points:4;
112 uint8_t type:4;
113#elif OSMO_IS_BIG_ENDIAN
114/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
115 uint8_t type:4, num_points:4;
116#endif
117 } h;
118 struct {
119 uint8_t lat[3];
120 uint8_t lon[3];
121 } point[15];
122} __attribute__ ((packed));
123
124 struct gad_raw_ell_point_alt {
125 struct gad_raw_head h;
126 uint8_t lat[3];
127 uint8_t lon[3];
128 uint8_t alt[2];
129} __attribute__ ((packed));
130
131 struct gad_raw_ell_point_alt_unc_ell {
132#if OSMO_IS_LITTLE_ENDIAN
133 struct gad_raw_head h;
134 uint8_t lat[3];
135 uint8_t lon[3];
136 uint8_t alt[2];
137 uint8_t unc_semi_major:7,
138 spare1:1;
139 uint8_t unc_semi_minor:7,
140 spare2:1;
141 uint8_t major_ori;
142 uint8_t unc_alt:7,
143 spare3:1;
144 uint8_t confidence:7,
145 spare4:1;
146#elif OSMO_IS_BIG_ENDIAN
147/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
148 struct gad_raw_head h;
149 uint8_t lat[3];
150 uint8_t lon[3];
151 uint8_t alt[2];
152 uint8_t spare1:1, unc_semi_major:7;
153 uint8_t spare2:1, unc_semi_minor:7;
154 uint8_t major_ori;
155 uint8_t spare3:1, unc_alt:7;
156 uint8_t spare4:1, confidence:7;
157#endif
158} __attribute__ ((packed));
159
160 struct gad_raw_ell_arc {
161#if OSMO_IS_LITTLE_ENDIAN
162 struct gad_raw_head h;
163 uint8_t lat[3];
164 uint8_t lon[3];
165 uint8_t inner_r[2];
166 uint8_t unc_r:7,
167 spare1:1;
168 uint8_t ofs_angle;
169 uint8_t incl_angle;
170 uint8_t confidence:7,
171 spare2:1;
172#elif OSMO_IS_BIG_ENDIAN
173/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
174 struct gad_raw_head h;
175 uint8_t lat[3];
176 uint8_t lon[3];
177 uint8_t inner_r[2];
178 uint8_t spare1:1, unc_r:7;
179 uint8_t ofs_angle;
180 uint8_t incl_angle;
181 uint8_t spare2:1, confidence:7;
182#endif
183} __attribute__ ((packed));
184
185 struct gad_raw_ha_ell_point_unc_ell {
186#if OSMO_IS_LITTLE_ENDIAN
187 struct gad_raw_head h;
188 uint8_t lat[4];
189 uint8_t lon[4];
190 uint8_t alt[3];
191 uint8_t unc_semi_major;
192 uint8_t unc_semi_minor;
193 uint8_t major_ori;
194 uint8_t confidence:7,
195 spare1:1;
196#elif OSMO_IS_BIG_ENDIAN
197/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
198 struct gad_raw_head h;
199 uint8_t lat[4];
200 uint8_t lon[4];
201 uint8_t alt[3];
202 uint8_t unc_semi_major;
203 uint8_t unc_semi_minor;
204 uint8_t major_ori;
205 uint8_t spare1:1, confidence:7;
206#endif
207} __attribute__ ((packed));
208
209 struct gad_raw_ha_ell_point_alt_unc_ell {
210#if OSMO_IS_LITTLE_ENDIAN
211 struct gad_raw_head h;
212 uint8_t lat[4];
213 uint8_t lon[4];
214 uint8_t alt[3];
215 uint8_t unc_semi_major;
216 uint8_t unc_semi_minor;
217 uint8_t major_ori;
218 uint8_t h_confidence:7,
219 spare1:1;
220 uint8_t unc_alt;
221 uint8_t v_confidence:7,
222 spare2:1;
223#elif OSMO_IS_BIG_ENDIAN
224/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
225 struct gad_raw_head h;
226 uint8_t lat[4];
227 uint8_t lon[4];
228 uint8_t alt[3];
229 uint8_t unc_semi_major;
230 uint8_t unc_semi_minor;
231 uint8_t major_ori;
232 uint8_t spare1:1, h_confidence:7;
233 uint8_t unc_alt;
234 uint8_t spare2:1, v_confidence:7;
235#endif
236} __attribute__ ((packed));
237
239 union gad_raw {
240 struct gad_raw_head h;
241 struct gad_raw_ell_point ell_point;
242 struct gad_raw_ell_point_unc_circle ell_point_unc_circle;
243 struct gad_raw_ell_point_unc_ellipse ell_point_unc_ellipse;
244 struct gad_raw_polygon polygon;
245 struct gad_raw_ell_point_alt ell_point_alt;
246 struct gad_raw_ell_point_alt_unc_ell ell_point_alt_unc_ell;
247 struct gad_raw_ell_arc ell_arc;
248 struct gad_raw_ha_ell_point_unc_ell ha_ell_point_unc_ell;
249 struct gad_raw_ha_ell_point_alt_unc_ell ha_ell_point_alt_unc_ell;
250} __attribute__ ((packed));
251
endian.h
gad_type
gad_type
Definition: gsm_23_032.h:32
__attribute__
struct gad_raw_head __attribute__((packed))
GAD_TYPE_POLYGON
@ GAD_TYPE_POLYGON
Definition: gsm_23_032.h:39
GAD_TYPE_ELL_POINT_ALT
@ GAD_TYPE_ELL_POINT_ALT
Ellipsoid point with altitude.
Definition: gsm_23_032.h:41
GAD_TYPE_HA_ELL_POINT_UNC_ELLIPSE
@ GAD_TYPE_HA_ELL_POINT_UNC_ELLIPSE
High accuracy ellipsoid point with uncertainty ellipse.
Definition: gsm_23_032.h:47
GAD_TYPE_ELL_POINT
@ GAD_TYPE_ELL_POINT
Ellipsoid point.
Definition: gsm_23_032.h:34
GAD_TYPE_ELL_POINT_ALT_UNC_ELL
@ GAD_TYPE_ELL_POINT_ALT_UNC_ELL
Ellipsoid point with altitude and uncertainty ellipsoid.
Definition: gsm_23_032.h:43
GAD_TYPE_ELL_POINT_UNC_CIRCLE
@ GAD_TYPE_ELL_POINT_UNC_CIRCLE
Ellipsoid point with uncertainty circle.
Definition: gsm_23_032.h:36
GAD_TYPE_HA_ELL_POINT_ALT_UNC_ELL
@ GAD_TYPE_HA_ELL_POINT_ALT_UNC_ELL
High accuracy ellipsoid point with altitude and uncertainty ellipsoid.
Definition: gsm_23_032.h:49
GAD_TYPE_ELL_POINT_UNC_ELLIPSE
@ GAD_TYPE_ELL_POINT_UNC_ELLIPSE
Ellipsoid point with uncertainty ellipse.
Definition: gsm_23_032.h:38
GAD_TYPE_ELL_ARC
@ GAD_TYPE_ELL_ARC
Ellipsoid arc.
Definition: gsm_23_032.h:45
type
uint8_t type
Definition: gsm_04_08_gprs.h:7
lon
uint8_t lon[3]
Definition: gsm_23_032.h:2
lat
uint8_t lat[3]
Definition: gsm_23_032.h:1
h
struct gad_raw_head h
type = GAD_TYPE_ELL_POINT
Definition: gsm_23_032.h:0
alt
uint8_t alt[2]
Definition: gsm_23_032.h:3
gad_raw_ell_arc
Definition: gsm_23_032.h:160
gad_raw_ell_point_alt_unc_ell
Definition: gsm_23_032.h:131
gad_raw_ell_point_alt
Definition: gsm_23_032.h:124
gad_raw_ell_point_alt::lon
uint8_t lon[3]
Definition: gsm_23_032.h:127
gad_raw_ell_point_alt::alt
uint8_t alt[2]
Definition: gsm_23_032.h:128
gad_raw_ell_point_alt::lat
uint8_t lat[3]
Definition: gsm_23_032.h:126
gad_raw_ell_point_alt::h
struct gad_raw_head h
type = GAD_TYPE_ELL_POINT_ALT
Definition: gsm_23_032.h:125
gad_raw_ell_point_unc_circle
Definition: gsm_23_032.h:68
gad_raw_ell_point_unc_ellipse
Definition: gsm_23_032.h:84
gad_raw_ell_point
Definition: gsm_23_032.h:62
gad_raw_ell_point::lat
uint8_t lat[3]
Definition: gsm_23_032.h:64
gad_raw_ell_point::h
struct gad_raw_head h
type = GAD_TYPE_ELL_POINT
Definition: gsm_23_032.h:63
gad_raw_ell_point::lon
uint8_t lon[3]
Definition: gsm_23_032.h:65
gad_raw_ha_ell_point_alt_unc_ell
Definition: gsm_23_032.h:209
gad_raw_ha_ell_point_unc_ell
Definition: gsm_23_032.h:185
gad_raw_head
Definition: gsm_23_032.h:52
gad_raw_polygon
Definition: gsm_23_032.h:108
gad_raw_polygon::h
struct gad_raw_polygon::@111 h
gad_raw_polygon::point
struct gad_raw_polygon::@112 point[15]
gad_raw_polygon::lat
uint8_t lat[3]
Definition: gsm_23_032.h:119
gad_raw_polygon::lon
uint8_t lon[3]
Definition: gsm_23_032.h:120
gad_raw
GAD PDU in network-byte-order according to 3GPP TS 23.032 GAD: Universal Geographical Area Descriptio...
Definition: gsm_23_032.h:239
gad_raw::ha_ell_point_unc_ell
struct gad_raw_ha_ell_point_unc_ell ha_ell_point_unc_ell
Definition: gsm_23_032.h:248
gad_raw::ell_point_alt_unc_ell
struct gad_raw_ell_point_alt_unc_ell ell_point_alt_unc_ell
Definition: gsm_23_032.h:246
gad_raw::ell_point_unc_ellipse
struct gad_raw_ell_point_unc_ellipse ell_point_unc_ellipse
Definition: gsm_23_032.h:243
gad_raw::polygon
struct gad_raw_polygon polygon
Definition: gsm_23_032.h:244
gad_raw::ell_point
struct gad_raw_ell_point ell_point
Definition: gsm_23_032.h:241
gad_raw::ell_arc
struct gad_raw_ell_arc ell_arc
Definition: gsm_23_032.h:247
gad_raw::ell_point_unc_circle
struct gad_raw_ell_point_unc_circle ell_point_unc_circle
Definition: gsm_23_032.h:242
gad_raw::ell_point_alt
struct gad_raw_ell_point_alt ell_point_alt
Definition: gsm_23_032.h:245
gad_raw::h
struct gad_raw_head h
Definition: gsm_23_032.h:240
gad_raw::ha_ell_point_alt_unc_ell
struct gad_raw_ha_ell_point_alt_unc_ell ha_ell_point_alt_unc_ell
Definition: gsm_23_032.h:249