blob: dd41bc5b90fa17050ecb5ff5437058c580520036 [file] [log] [blame]
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02001/*! \file gsm23003.h */
2
Harald Weltebda26c02016-05-11 09:13:08 +02003#pragma once
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02004
Harald Weltebda26c02016-05-11 09:13:08 +02005#include <stdint.h>
Neels Hofmeyr9cd1e742017-10-04 03:15:47 +02006#include <stdbool.h>
Harald Weltebda26c02016-05-11 09:13:08 +02007
8/* 23.003 Chapter 12.1 */
9struct osmo_plmn_id {
10 uint16_t mcc;
11 uint16_t mnc;
12};
13
14/* 4.1 */
15struct osmo_location_area_id {
16 struct osmo_plmn_id plmn;
17 uint16_t lac;
18};
19
20/* 4.2 */
21struct osmo_routing_area_id {
22 struct osmo_location_area_id lac;
23 uint8_t rac;
24};
25
26/* 4.3.1 */
27struct osmo_cell_global_id {
28 struct osmo_location_area_id lai;
29 uint16_t cell_identity;
30};
31
32/* 12.5 */
33struct osmo_service_area_id {
34 struct osmo_location_area_id lai;
35 uint16_t sac;
36};
37
38/* 12.6 */
39struct osmo_shared_network_area_id {
40 struct osmo_plmn_id plmn;
41 uint32_t snac;
42};
43
44/* 5.1 */
45enum osmo_gsn_addr_type {
46 GSN_ADDR_TYPE_IPV4 = 0,
47 GSN_ADDR_TYPE_IPV6 = 1,
48};
49
50/* 5.1 */
51struct osmo_gsn_address {
52 enum osmo_gsn_addr_type type;
53 uint8_t length;
54 uint8_t addr[16];
55};
56
57/* 19.4.2.3 */
58struct osmo_tracking_area_id {
59 struct osmo_plmn_id plmn;
60 uint16_t tac;
61};
62
63struct osmo_eutran_cell_global_id {
64 struct osmo_plmn_id plmn;
65 uint32_t eci; /* FIXME */
66};
67
68/* 2.8.1 */
69struct osmo_mme_id {
70 uint16_t group_id;
71 uint8_t code;
72};
73
74/* 2.8.1 */
75struct osmo_gummei {
76 struct osmo_plmn_id plmn;
77 struct osmo_mme_id mme;
78};
79
80/* 2.8.1 */
81struct osmo_guti {
82 struct osmo_gummei gummei;
83 uint32_t mtmsi;
84};
Neels Hofmeyr9cd1e742017-10-04 03:15:47 +020085
86bool osmo_imsi_str_valid(const char *imsi);
87bool osmo_msisdn_str_valid(const char *msisdn);