Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 1 | /*! \file gsm23003.h */ |
| 2 | |
Harald Welte | bda26c0 | 2016-05-11 09:13:08 +0200 | [diff] [blame] | 3 | #pragma once |
Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 4 | |
Harald Welte | bda26c0 | 2016-05-11 09:13:08 +0200 | [diff] [blame] | 5 | #include <stdint.h> |
Neels Hofmeyr | 9cd1e74 | 2017-10-04 03:15:47 +0200 | [diff] [blame] | 6 | #include <stdbool.h> |
Harald Welte | bda26c0 | 2016-05-11 09:13:08 +0200 | [diff] [blame] | 7 | |
| 8 | /* 23.003 Chapter 12.1 */ |
| 9 | struct osmo_plmn_id { |
| 10 | uint16_t mcc; |
| 11 | uint16_t mnc; |
| 12 | }; |
| 13 | |
| 14 | /* 4.1 */ |
| 15 | struct osmo_location_area_id { |
| 16 | struct osmo_plmn_id plmn; |
| 17 | uint16_t lac; |
| 18 | }; |
| 19 | |
| 20 | /* 4.2 */ |
| 21 | struct osmo_routing_area_id { |
| 22 | struct osmo_location_area_id lac; |
| 23 | uint8_t rac; |
| 24 | }; |
| 25 | |
| 26 | /* 4.3.1 */ |
| 27 | struct osmo_cell_global_id { |
| 28 | struct osmo_location_area_id lai; |
| 29 | uint16_t cell_identity; |
| 30 | }; |
| 31 | |
| 32 | /* 12.5 */ |
| 33 | struct osmo_service_area_id { |
| 34 | struct osmo_location_area_id lai; |
| 35 | uint16_t sac; |
| 36 | }; |
| 37 | |
| 38 | /* 12.6 */ |
| 39 | struct osmo_shared_network_area_id { |
| 40 | struct osmo_plmn_id plmn; |
| 41 | uint32_t snac; |
| 42 | }; |
| 43 | |
| 44 | /* 5.1 */ |
| 45 | enum osmo_gsn_addr_type { |
| 46 | GSN_ADDR_TYPE_IPV4 = 0, |
| 47 | GSN_ADDR_TYPE_IPV6 = 1, |
| 48 | }; |
| 49 | |
| 50 | /* 5.1 */ |
| 51 | struct 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 */ |
| 58 | struct osmo_tracking_area_id { |
| 59 | struct osmo_plmn_id plmn; |
| 60 | uint16_t tac; |
| 61 | }; |
| 62 | |
| 63 | struct osmo_eutran_cell_global_id { |
| 64 | struct osmo_plmn_id plmn; |
| 65 | uint32_t eci; /* FIXME */ |
| 66 | }; |
| 67 | |
| 68 | /* 2.8.1 */ |
| 69 | struct osmo_mme_id { |
| 70 | uint16_t group_id; |
| 71 | uint8_t code; |
| 72 | }; |
| 73 | |
| 74 | /* 2.8.1 */ |
| 75 | struct osmo_gummei { |
| 76 | struct osmo_plmn_id plmn; |
| 77 | struct osmo_mme_id mme; |
| 78 | }; |
| 79 | |
| 80 | /* 2.8.1 */ |
| 81 | struct osmo_guti { |
| 82 | struct osmo_gummei gummei; |
| 83 | uint32_t mtmsi; |
| 84 | }; |
Neels Hofmeyr | 9cd1e74 | 2017-10-04 03:15:47 +0200 | [diff] [blame] | 85 | |
| 86 | bool osmo_imsi_str_valid(const char *imsi); |
| 87 | bool osmo_msisdn_str_valid(const char *msisdn); |