1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
module ECBE_Types {
/* Type definitions for the ECBE (External Cell Broadcast Entity) protocol of OsmoCBC */
/* (C) 2021 by Harald Welte <laforge@gnumonks.org>
* All rights reserved.
*/
/***********************************************************************
* smscb.schema.json
***********************************************************************/
type charstring EcbeLanguageCode length(2);
type integer EcbeMessageId (0..65535);
type enumerated EcbeGeographicScope {
cell_wide_immediate,
plmn_wide,
lac_sac_tac_wide,
cell_wide
};
type integer EcbeMessageCode (0..1023);
type integer EcbeUpdateNumber (0..15);
type integer EcbeSerialNrEncoded (0..65535);
type record EcbeSerialNrDecoded {
EcbeGeographicScope geo_scope,
EcbeMessageCode msg_code,
EcbeUpdateNumber update_nr
};
type union EcbeSerialNr {
EcbeSerialNrEncoded serial_nr_encoded,
EcbeSerialNrDecoded serial_nr_decoded
};
type integer EcbeDcsEncoded (0..255);
type enumerated EcbeCharacterSet {
gsm,
eight_bit,
ucs2
};
type integer EcbeDcsClass (0..3);
type record EcbePayloadDecoded {
EcbeCharacterSet character_set optional,
EcbeLanguageCode Language optional,
EcbeDcsClass dcs_class optional,
charstring data_utf8
};
type charstring EcbePage;
type record of EcbePage EcbePages;
type record EcbePayloadEncoded {
EcbeDcsEncoded dcs,
EcbePages pages
};
type integer EcbeWarningTypeEncoded (0..127);
type enumerated EcbeWarningTypeDecoded {
earthquake,
tsunami,
earthquake_and_tsunami,
test,
other,
rfu
};
type union EcbeWarningType {
EcbeWarningTypeEncoded warning_type_encoded,
EcbeWarningTypeDecoded warning_type_decoded
};
type record EcbePayloadEtws {
EcbeWarningType warning_type,
boolean emergency_user_alert optional,
boolean popup_on_display optional,
charstring warning_sec_info optional
};
type union EcbePayload {
EcbePayloadEncoded payload_encoded,
EcbePayloadDecoded payload_decoded,
EcbePayloadEtws payload_etws
};
type record EcbeSmscbMessage {
EcbeSerialNr serial_nr,
EcbeMessageId message_id,
EcbePayload payload
};
external function enc_EcbeSmscbMessage(in EcbeSmscbMessage inp) return octetstring
with { extension "prototype(convert) encode(JSON)" }
external function dec_EcbeSmscbMessage(in octetstring inp) return EcbeSmscbMessage
with { extension "prototype(convert) decode(JSON)" }
/***********************************************************************
* cbc.schema.json
***********************************************************************/
type enumerated EcbeCategory {
normal,
high_priority,
background
};
type integer EcbeRepetitionPeriod (1..4095);
type enumerated EcbeChannelIndicator {
basic,
extended
};
type integer EcbeWarningPeriodSec (0..3600);
type integer EcbeNumberOfBroadcasts (0..65535);
type record EcbeScopePlmn {
};
type union EcbeScope {
EcbeScopePlmn scope_plmn
};
type record EcbeCbcMessage {
charstring cbe_name optional,
EcbeCategory category optional,
EcbeRepetitionPeriod repetition_period optional,
EcbeNumberOfBroadcasts num_of_bcast optional,
EcbeScope scope,
EcbeSmscbMessage smscb_message
};
external function enc_EcbeCbcMessage(in EcbeCbcMessage inp) return octetstring
with { extension "prototype(convert) encode(JSON)" }
external function dec_EcbeCbcMessage(in octetstring inp) return EcbeCbcMessage
with { extension "prototype(convert) decode(JSON)" }
} with { encode "JSON" }
|