Loading...
Searching...
No Matches
gsm_23_032.h
Go to the documentation of this file.
/*
* (C) 2020 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
*
* All Rights Reserved
*
* Author: Neels Hofmeyr <neels@hofmeyr.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include <stdint.h>
#include <osmocom/core/endian.h>
enum gad_type {
GAD_TYPE_ELL_POINT = 0,
GAD_TYPE_ELL_POINT_UNC_CIRCLE = 1,
GAD_TYPE_ELL_POINT_UNC_ELLIPSE = 3,
GAD_TYPE_POLYGON = 5,
GAD_TYPE_ELL_POINT_ALT = 8,
GAD_TYPE_ELL_POINT_ALT_UNC_ELL = 9,
GAD_TYPE_ELL_ARC = 10,
GAD_TYPE_HA_ELL_POINT_UNC_ELLIPSE = 11,
GAD_TYPE_HA_ELL_POINT_ALT_UNC_ELL = 12,
};
struct gad_raw_head {
#if OSMO_IS_LITTLE_ENDIAN
uint8_t spare:4,
type:4;
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
uint8_t type:4, spare:4;
#endif
} __attribute__ ((packed));
struct gad_raw_ell_point {
struct gad_raw_head h;
uint8_t lat[3];
uint8_t lon[3];
} __attribute__ ((packed));
struct gad_raw_ell_point_unc_circle {
#if OSMO_IS_LITTLE_ENDIAN
struct gad_raw_head h;
uint8_t lat[3];
uint8_t lon[3];
uint8_t unc:7,
spare2:1;
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
struct gad_raw_head h;
uint8_t lat[3];
uint8_t lon[3];
uint8_t spare2:1, unc:7;
#endif
} __attribute__ ((packed));
struct gad_raw_ell_point_unc_ellipse {
#if OSMO_IS_LITTLE_ENDIAN
struct gad_raw_head h;
uint8_t lat[3];
uint8_t lon[3];
uint8_t unc_semi_major:7,
spare1:1;
uint8_t unc_semi_minor:7,
spare2:1;
uint8_t major_ori;
uint8_t confidence:7,
spare3:1;
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
struct gad_raw_head h;
uint8_t lat[3];
uint8_t lon[3];
uint8_t spare1:1, unc_semi_major:7;
uint8_t spare2:1, unc_semi_minor:7;
uint8_t major_ori;
uint8_t spare3:1, confidence:7;
#endif
} __attribute__ ((packed));
struct gad_raw_polygon {
struct {
#if OSMO_IS_LITTLE_ENDIAN
uint8_t num_points:4;
uint8_t type:4;
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
uint8_t type:4, num_points:4;
#endif
} h;
struct {
uint8_t lat[3];
uint8_t lon[3];
} point[15];
} __attribute__ ((packed));
struct gad_raw_ell_point_alt {
struct gad_raw_head h;
uint8_t lat[3];
uint8_t lon[3];
uint8_t alt[2];
} __attribute__ ((packed));
struct gad_raw_ell_point_alt_unc_ell {
#if OSMO_IS_LITTLE_ENDIAN
struct gad_raw_head h;
uint8_t lat[3];
uint8_t lon[3];
uint8_t alt[2];
uint8_t unc_semi_major:7,
spare1:1;
uint8_t unc_semi_minor:7,
spare2:1;
uint8_t major_ori;
uint8_t unc_alt:7,
spare3:1;
uint8_t confidence:7,
spare4:1;
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
struct gad_raw_head h;
uint8_t lat[3];
uint8_t lon[3];
uint8_t alt[2];
uint8_t spare1:1, unc_semi_major:7;
uint8_t spare2:1, unc_semi_minor:7;
uint8_t major_ori;
uint8_t spare3:1, unc_alt:7;
uint8_t spare4:1, confidence:7;
#endif
} __attribute__ ((packed));
struct gad_raw_ell_arc {
#if OSMO_IS_LITTLE_ENDIAN
struct gad_raw_head h;
uint8_t lat[3];
uint8_t lon[3];
uint8_t inner_r[2];
uint8_t unc_r:7,
spare1:1;
uint8_t ofs_angle;
uint8_t incl_angle;
uint8_t confidence:7,
spare2:1;
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
struct gad_raw_head h;
uint8_t lat[3];
uint8_t lon[3];
uint8_t inner_r[2];
uint8_t spare1:1, unc_r:7;
uint8_t ofs_angle;
uint8_t incl_angle;
uint8_t spare2:1, confidence:7;
#endif
} __attribute__ ((packed));
struct gad_raw_ha_ell_point_unc_ell {
#if OSMO_IS_LITTLE_ENDIAN
struct gad_raw_head h;
uint8_t lat[4];
uint8_t lon[4];
uint8_t alt[3];
uint8_t unc_semi_major;
uint8_t unc_semi_minor;
uint8_t major_ori;
uint8_t confidence:7,
spare1:1;
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
struct gad_raw_head h;
uint8_t lat[4];
uint8_t lon[4];
uint8_t alt[3];
uint8_t unc_semi_major;
uint8_t unc_semi_minor;
uint8_t major_ori;
uint8_t spare1:1, confidence:7;
#endif
} __attribute__ ((packed));
struct gad_raw_ha_ell_point_alt_unc_ell {
#if OSMO_IS_LITTLE_ENDIAN
struct gad_raw_head h;
uint8_t lat[4];
uint8_t lon[4];
uint8_t alt[3];
uint8_t unc_semi_major;
uint8_t unc_semi_minor;
uint8_t major_ori;
uint8_t h_confidence:7,
spare1:1;
uint8_t unc_alt;
uint8_t v_confidence:7,
spare2:1;
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
struct gad_raw_head h;
uint8_t lat[4];
uint8_t lon[4];
uint8_t alt[3];
uint8_t unc_semi_major;
uint8_t unc_semi_minor;
uint8_t major_ori;
uint8_t spare1:1, h_confidence:7;
uint8_t unc_alt;
uint8_t spare2:1, v_confidence:7;
#endif
} __attribute__ ((packed));
union gad_raw {
struct gad_raw_head h;
struct gad_raw_ell_point ell_point;
struct gad_raw_ell_point_unc_circle ell_point_unc_circle;
struct gad_raw_ell_point_unc_ellipse ell_point_unc_ellipse;
struct gad_raw_polygon polygon;
struct gad_raw_ell_point_alt ell_point_alt;
struct gad_raw_ell_point_alt_unc_ell ell_point_alt_unc_ell;
struct gad_raw_ell_arc ell_arc;
struct gad_raw_ha_ell_point_unc_ell ha_ell_point_unc_ell;
struct gad_raw_ha_ell_point_alt_unc_ell ha_ell_point_alt_unc_ell;
} __attribute__ ((packed));
endian.h
gad_type
gad_type
Definition gsm_23_032.h:32
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
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
type
uint8_t type
Definition gsm_08_08.h:0
__attribute__
enum gsmtap_um_voice_type __attribute__
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::point
struct gad_raw_polygon::@99 point[15]
gad_raw_polygon::h
struct gad_raw_polygon::@98 h
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