CHIRP Module#

SPDX-FileCopyrightText: 2024 DESY and the Constellation authors SPDX-License-Identifier: EUPL-1.2

Module implementing the Constellation Host Identification and Reconnaissance Protocol (CHIRP).

class core.chirp.CHIRPBeaconTransmitter(name: str, group: str, interface: list[str])#

Bases: object

Class for broadcasting CHRIP messages.

See docs/protocols/chirp.md for details.

broadcast(serviceid: CHIRPServiceIdentifier, msgtype: CHIRPMessageType, port: int = 0) None#

Broadcast a given service.

close() None#

Close the socket.

property filter: bool#

Whether or not incoming broadcasts are filtered on group.

property group: UUID#

Get the UUID of the Constellation group of this transmitter.

property host: UUID#

Get the UUID of the host this transmitter was set up for.

listen() CHIRPMessage | None#

Listen in on CHIRP port and return message if data was received.

class core.chirp.CHIRPMessage(msgtype: CHIRPMessageType = CHIRPMessageType.NONE, group_uuid: UUID = UUID('00000000-0000-0000-0000-000000000000'), host_uuid: UUID = UUID('00000000-0000-0000-0000-000000000000'), serviceid: CHIRPServiceIdentifier = CHIRPServiceIdentifier.NONE, port: int = 0)#

Bases: object

Class to hold a CHIRP message.

pack() bytes#

Serialize message to raw bytes.

unpack(msg: bytes) None#

Decode from bytes.

class core.chirp.CHIRPMessageType(*values)#

Bases: Enum

Identifies the type of message sent or received via the CHIRP protocol.

See docs/protocols/chirp.md for details.

REQUEST: A message with REQUEST type indicates that CHIRP hosts should reply with an OFFER

OFFER: A message with OFFER type indicates that service is available

DEPART: A message with DEPART type indicates that a service is no longer available

NONE: Value used for initialization only, not a valid message type.

DEPART = 3#
NONE = 0#
OFFER = 2#
REQUEST = 1#
class core.chirp.CHIRPServiceIdentifier(*values)#

Bases: Enum

Identifies the type of service.

The CONTROL service identifier indicates a CSCP (Constellation Satellite Control Protocol) service.

The HEARTBEAT service identifier indicates a CHP (Constellation Heartbeat Protocol) service.

The MONITORING service identifier indicates a CMDP (Constellation Monitoring Distribution Protocol) service.

The DATA service identifier indicates a CDTP (Constellation Data Transmission Protocol) service.

The NONE identifier is used for initialization only, and is not a valid service type.

CONTROL = 1#
DATA = 4#
HEARTBEAT = 2#
MONITORING = 3#
NONE = 0#
core.chirp.get_uuid(name: str) UUID#

Return the UUID for a string using MD5 hashing.