FreeCalypso > hg > themwi-smsc
annotate include/sm_record.h @ 6:acc5b1c3e07d default tip
doc/Arch-design: document Osmocom network interface plan
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 23 Dec 2023 08:07:33 +0000 |
parents | 9e364c18e0e8 |
children |
rev | line source |
---|---|
0
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This header file defines the message structure as stored in ThemWi-SMSC |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * persistent message store (PMS) binary files. |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #pragma once |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <stdint.h> |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 struct sm_address { |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 uint8_t ndigits; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 uint8_t ton_npi; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 uint8_t bcd[10]; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 }; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 /* values for src_class and dest_class bytes */ |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #define SME_CLASS_LOCAL 0 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #define SME_CLASS_GSM 1 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 #define SME_CLASS_UPSTREAM 2 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 #define SME_CLASS_DOWNSTREAM 3 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 /* values for disposition byte */ |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #define SM_DISP_ACTIVE 0 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #define SM_DISP_DELIVERED 1 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #define SM_DISP_EXPIRED 2 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #define SM_DISP_IMSI_FAIL 3 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #define SM_DISP_SMPP_REJECT 4 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 struct sm_record { |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 uint64_t time_entry; /* time entered in our SMSC */ |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 uint64_t time_expiry; /* end of validity period */ |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 uint64_t time_disch; /* discharge time */ |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 struct sm_address addr_from; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 struct sm_address addr_to_orig; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 struct sm_address addr_to_final; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 /* |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 * Each of the two IMSI fields is repurposed as system_id |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 * in the case of downstream SMPP peers. The maximum length |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 * is conveniently the same. |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 */ |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 char src_imsi[16]; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 char dest_imsi[16]; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 uint32_t src_extra_info; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 uint32_t dest_extra_info; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 uint8_t src_class; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 uint8_t dest_class; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 uint8_t disposition; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 uint8_t gsm_src_mr; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 uint8_t pid; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 uint8_t dcs; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 uint8_t udhi; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 uint8_t udl; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 uint8_t ud[140]; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 uint8_t reserved[8]; |
9e364c18e0e8
beginning of architectural design spec
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 }; |