imsd/interfaces/Imsd.cppm

17 lines
381 B
Text
Raw Normal View History

// SPDX-License-Identifier: GPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
/*
imsd — userspace IMS/VoLTE daemon for mainline Linux phones.
*/
export module Imsd;
export import :Util;
export import :Aka;
export import :Ipsec;
export import :Qmi;
export import :Sip;
export import :Sdp;
sms: the short message codecs of TS 23.038, 23.040 and 24.011, and EF_SMSP SMS over IP (TS 24.341) carries the bytes a 2G/3G phone puts in an RP-DATA inside a SIP MESSAGE body of type application/vnd.3gpp.sms, so imsd needs the whole stack below SIP once it owns SMS on a carrier whose modem IMS is off: the GSM 7-bit default alphabet with its extension table and the septet packing, UCS-2 for everything else (TS 23.038); SMS-SUBMIT built per segment with the concatenation header, SMS-DELIVER, SMS-STATUS-REPORT and SMS-SUBMIT-REPORT parsed, the SMS-DELIVER-REPORT that acknowledges a delivery, the user-data header and the reassembly of a concatenated message (TS 23.040); RP-DATA, RP-ACK and RP-ERROR in both directions with their causes (TS 24.011); and EF_SMSP, where the (U)SIM names the service centre the RP-DATA is addressed to (TS 31.102 4.2.27, the KPN SIM's record read on the dev phone on 2026-10-16: +31653131313). A new partition, Imsd:Sms, pure std with no SIP, clock or I/O; tests/Sms checks it against the classic public PDU vectors ("hellohello", the "How are you?" SMS-DELIVER) and vectors cross-generated by an independent Python reference. A concatenated set with one alphabet throughout is decoded from its segments' joined units — the septets, or the UTF-16BE octets — not from the segments' texts, so a surrogate pair or an escape pair a sender cut at a segment boundary comes out whole; a U+0000 in UCS-2 decodes as U+FFFD, since no text means it and a D-Bus string cannot carry it. A status report's TP-ST is read as TS 23.040 9.2.3.15 has the MS read it: a reserved value, any with bit 7 set among them, as "Service Rejected" — a temporary error after which the SC is not making any more transfer attempts (StatusAsRead, pinned over all 256 values; StatusText has the clause's four classes in words). Three more readings follow their clauses the same way, each pinned: a time stamp semi-octet that is no digit reads as 0 (9.2.3.11); `1111` before an address's last semi-octet is skipped, not taken for its end (9.1.2.3); an SMS-SUBMIT-REPORT for RP-ERROR with an unused bit of its first octet set gives TP-FCS 0xFF, unspecified, with nothing else examined (9.2.2.2a).
2026-10-16 23:11:24 +02:00
export import :Sms;
export import :Messages;
export import :Engine;