comparison include/number_db_v2.h @ 0:159dd90eeafe

beginning, libnumutil compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 12 Dec 2023 23:52:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:159dd90eeafe
1 /*
2 * This header file defines version 2 of ThemWi number database
3 * binary file format.
4 */
5
6 #pragma once
7
8 #include <stdint.h>
9
10 struct numdb_file_hdr {
11 uint32_t owned_number_count;
12 uint32_t short_number_count;
13 };
14
15 struct owned_number_rec {
16 uint16_t number[3]; /* NPA-exchange-suffix breakdown */
17 uint8_t number_flags; /* properties of outside number */
18 uint8_t usage; /* usage inside ThemWi */
19 uint16_t remap[3]; /* secondary remap number */
20 };
21
22 #define NUMBER_FLAG_SMSPROV 0x01 /* provisioned for outside SMS */
23 #define NUMBER_FLAG_E911PROV 0x02 /* provisioned for E911 */
24
25 #define NUMBER_USAGE_MASK 0x0F
26 #define NUMBER_USAGE_TYPE_RSVD 0x00
27 #define NUMBER_USAGE_TYPE_GSM_SUB 0x01
28 #define NUMBER_USAGE_TYPE_ALIAS 0x02
29 #define NUMBER_USAGE_FLAG_E911_VIA 0x10
30
31 struct short_number_rec {
32 uint16_t short_num;
33 uint8_t short_num_type;
34 uint8_t fullnum_flags;
35 uint16_t fullnum_prefix[2];
36 };
37
38 #define SHORT_NUM_TYPE_ABBREV 0x01
39 #define SHORT_NUM_TYPE_ITN 0x02
40 #define SHORT_NUM_TYPE_TEST_SINK 0x03