comparison include/sm_record.h @ 0:9e364c18e0e8

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