Expand description
DVB SimulCrypt (ETSI TS 103 197) - the protocol between a scrambler and conditional access
systems (CAS). The crate runs the ECMG client, the EMMG server, control word generation, the
ECM carousel and EMM packetization; scrambling and PSI/SI stay with the application.
The main API is Simulcrypt: CAS registration (acquire_cas), opening services
(open_service) and one Cw/Ecm/Ts/Emm/State event stream per service. The
messages codec with the protocol constants in messages::ecmg and messages::emmg is
public for building test peers.
Modules§
- messages
SimulCryptmessage codec: header, TLV variables, parsing and serialization.
Structs§
- CasConfig
- One CAS description: the ECMG client and an optional EMMG server.
- CasError
- Last ECMG error of a CAS channel (see
CasStatus::last_error). - CasLease
- A CAS registered with
Simulcrypt::acquire_cas. The CAS is removed when the last lease of it drops: its ECMG and EMMG channels close and its streams are detached from open services, which keep running on their other CAS. Drop the services that use the CAS first. The EMMG listener closes with the last CAS on its port. - CasParams
- Parameters negotiated in
CHANNEL_STATUS.formatandrep_periodaffect the crate’s behavior, the other fields are informational. - CasRef
- Cheap copyable reference to a CAS channel; survives reconnects.
- CasStatus
- State of one CAS channel for diagnostics and monitoring (
Simulcrypt::status). - Ecmg
Config - ECMG server connection settings.
- Emmg
Config - EMMG server settings of one CAS channel.
- Emmg
Port Status - EMMG listener of one port (see
Simulcrypt::emmg_status). - Service
- Service handle. Several
Services may share one CW group fully or partially (seeopen_service); each(CasRef, stream_id)is released when the lastServicereferencing it lets go, and the whole group when no members are left. If afterwards aCasRefhas no streams at all, its ECMG driver is stopped - theCasRefstays valid and comes back on the nextopen_servicewith it. - Service
Cas - One CAS channel of a service.
- Service
Config - Scrambled service: one CW group shared by any number of CAS.
- Simulcrypt
- Process registry: CAS channels and open services. Cheap to clone (an
Arcinside), can be passed freely to several tasks. - Stream
Info - Stream assigned by the crate: the CAS, the caller’s
ecm_pidand the actual protocolstream_id. - Stream
Status - One stream of a CAS channel (see
CasStatus::streams). Counters run since the stream was opened.
Enums§
- CasState
- State of the ECMG connection of one CAS channel.
- Datagram
Format - ECM/EMM datagram format. The crate reports it together with the data, so the application does
not have to track
section_TSpkt_flagitself. - Error
- Error of the public API (
Simulcrypt/Service). - Event
- One ordered event queue per service.
Cloneis needed to deliver the same event to severalServices sharing one CW group. - Parity
- Crypto period parity: selects which physical CSA slot to update.