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