Multicast module with multi-instance support and active trigger mechanism. More...
Public Member Functions | |
| __init__ (self, config) | |
| init preload some needed locals and then call onLoad() directly | |
| onLoad (self) | |
| Initialize module configuration and start the global cleanup thread. | |
| doWork (self, bwPacket) | |
| Process an incoming packet and handle multicast logic. | |
| onUnload (self) | |
| Unregister instance from the global cleanup process. | |
Data Fields | |
| instance_id | |
| name | |
Data Fields inherited from module.moduleBase.ModuleBase | |
| config | |
Protected Member Functions | |
| _get_packet_data (self, bwPacket) | |
| Safely extract data dictionary from packet. | |
| _filter_output (self, result) | |
| Apply multicastRole filtering before output. | |
| _combine_results (self, *results) | |
| Combine multiple result sources into a single list or status. | |
| _should_output_packet (self, multicast_role) | |
| Check if packet should be output based on role. | |
| _add_tone_ric_packet (self, freq, packet_dict) | |
| Add a tone-RIC to the shared buffer. | |
| _get_queued_packets (self) | |
| Pop and return all packets currently in the static queue. | |
| _copy_packet_dict_to_packet (self, recipient_dict, packet, index=1) | |
| Copy dict fields to Packet with timestamp shift for DB uniqueness. | |
| _distribute_complete (self, freq, text_packet_dict) | |
| Create full multicast packets with message content. | |
| _create_incomplete_multicast (self, freq, recipient_dicts) | |
| Generate multicast packets for timeouts (no text message). | |
| _enrich_normal_alarm (self, bwPacket, packet_dict) | |
| Enrich a standard single alarm with multicast metadata. | |
| _handle_delimiter (self, freq, ric, bwPacket=None) | |
| Handle delimiter packet and clear orphaned tone-RICs. | |
| _set_mcast_metadata (self, packet, mode, role, source="", count="1", index="1") | |
| Helper to set standard multicast fields and register wildcards. | |
| _apply_list_tags (self, packet, recipient_dicts) | |
| Helper to aggregate fields from all recipients into comma-separated lists. | |
| _register_wildcard_safe (self, wildcard, field) | |
| Register wildcard if not already globally registered. | |
| _perform_instance_tick (self) | |
| Tick-entry point for this specific instance. | |
| _check_all_my_frequencies (self) | |
| Monitor timeouts for all frequencies assigned to this instance. | |
| _check_instance_auto_clear (self, freq) | |
| Check if frequency has exceeded timeout (called from doWork). | |
| _send_wakeup_trigger (self, freq, fallback_ric) | |
| Send a loopback trigger via socket to wake up the system. | |
Protected Member Functions inherited from module.moduleBase.ModuleBase | |
| _cleanup (self) | |
| Cleanup routine calls onUnload() directly. | |
| _run (self, bwPacket) | |
| start an run of the module. | |
| _getStatistics (self) | |
| Returns statistical information's from last module run. | |
Static Protected Member Functions | |
| _global_cleanup_worker () | |
| Static background thread that ticks all active module instances. | |
| _cleanup_hard_timeout_global () | |
| Global failsafe for really old packets (ignores instance config). | |
Protected Attributes | |
| _my_frequencies | |
| _auto_clear_timeout | |
| _hard_timeout | |
| _delimiter_rics | |
| _text_rics | |
| _netident_rics | |
| _trigger_ric | |
| _trigger_ric_mode | |
| _trigger_host | |
| _trigger_port | |
| _block_delimiter | |
| _block_netident | |
Protected Attributes inherited from module.moduleBase.ModuleBase | |
| _moduleName | |
| _cumTime | |
| _moduleTime | |
| _runCount | |
| _moduleErrorCount | |
Static Protected Attributes | |
| _tone_ric_packets = defaultdict(list) | |
| _last_tone_ric_time = defaultdict(float) | |
| _processing_text_ric = defaultdict(bool) | |
| _processing_text_ric_started = defaultdict(float) | |
| _lock = threading.Lock() | |
| _cleanup_thread = None | |
| bool | _running = False |
| _wildcards_registered = set() | |
| list | _packet_queue = [] |
| _queue_lock = threading.Lock() | |
| list | _instances = [] |
| str | _TRIGGER_HOST = "127.0.0.1" |
| int | _TRIGGER_PORT = 8080 |
| str | _MAGIC_WAKEUP_MSG = "###_MULTICAST_WAKEUP_###" |
| str | _DEFAULT_TRIGGER_RIC = "9999999" |
Static Protected Attributes inherited from module.moduleBase.ModuleBase | |
| list | _modulesActive = [] |
Additional Inherited Members | |
Static Public Member Functions inherited from module.moduleBase.ModuleBase | |
| registerWildcard (newWildcard, bwPacketField) | |
| Register a new wildcard. | |
Multicast module with multi-instance support and active trigger mechanism.
This module handles multicast alarm distribution. It manages the correlation between tone-RICs (recipients) and text-RICs (message content), ensuring reliable alarm delivery even in complex multi-frequency scenarios.
| module.multicast.BoswatchModule.__init__ | ( | self, | |
| moduleName | |||
| ) |
init preload some needed locals and then call onLoad() directly
Reimplemented from module.moduleBase.ModuleBase.
| module.multicast.BoswatchModule.onLoad | ( | self | ) |
Initialize module configuration and start the global cleanup thread.
| None |
Reimplemented from module.moduleBase.ModuleBase.
| module.multicast.BoswatchModule.doWork | ( | self, | |
| bwPacket | |||
| ) |
Process an incoming packet and handle multicast logic.
| bwPacket | A BOSWatch packet instance or list of packets |
Reimplemented from module.moduleBase.ModuleBase.
|
protected |
Safely extract data dictionary from packet.
| bwPacket | Packet instance or dict |
|
protected |
Apply multicastRole filtering before output.
| result | Single packet, list of packets, None or False |
|
protected |
Combine multiple result sources into a single list or status.
| results | Multiple packet objects, lists, or booleans |
|
protected |
Check if packet should be output based on role.
| multicast_role | The role string to check |
|
protected |
Add a tone-RIC to the shared buffer.
| freq | Frequency identifier |
| packet_dict | Dictionary containing packet data |
|
protected |
Pop and return all packets currently in the static queue.
| None |
|
protected |
Copy dict fields to Packet with timestamp shift for DB uniqueness.
| recipient_dict | Source dictionary |
| packet | Target Packet object |
| index | Packet index (1-based) - shifts timestamp by milliseconds |
|
protected |
Create full multicast packets with message content.
| freq | Frequency identifier |
| text_packet_dict | Data of the message-carrying packet |
|
protected |
Generate multicast packets for timeouts (no text message).
| freq | Frequency identifier |
| recipient_dicts | List of recipient data dictionaries |
|
protected |
Enrich a standard single alarm with multicast metadata.
| bwPacket | Target Packet object |
| packet_dict | Source data dictionary |
|
protected |
Handle delimiter packet and clear orphaned tone-RICs.
| freq | Frequency identifier |
| ric | Delimiter RIC |
| bwPacket | Optional delimiter packet instance |
|
protected |
Helper to set standard multicast fields and register wildcards.
| packet | The Packet instance to modify |
| mode | multicastMode (complete, incomplete, single, control) |
| role | multicastRole (recipient, single, delimiter, netident) |
| source | The originating RIC |
| count | Total number of recipients |
| index | Current recipient index |
|
protected |
Helper to aggregate fields from all recipients into comma-separated lists.
| packet | The target Packet instance |
| recipient_dicts | List of dictionaries of all recipients in this group |
|
protected |
Register wildcard if not already globally registered.
| wildcard | The wildcard string (e.g. {MCAST_MODE}) |
| field | The packet field name |
|
staticprotected |
Static background thread that ticks all active module instances.
| None |
|
protected |
Tick-entry point for this specific instance.
| None |
|
protected |
Monitor timeouts for all frequencies assigned to this instance.
| None |
|
protected |
Check if frequency has exceeded timeout (called from doWork).
| freq | Frequency identifier |
|
staticprotected |
Global failsafe for really old packets (ignores instance config).
| None |
|
protected |
Send a loopback trigger via socket to wake up the system.
| freq | Frequency identifier |
| fallback_ric | RIC to use if no explicit trigger RIC is configured |
| module.multicast.BoswatchModule.onUnload | ( | self | ) |
Unregister instance from the global cleanup process.
| None |
Reimplemented from module.moduleBase.ModuleBase.
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
| module.multicast.BoswatchModule.instance_id |
| module.multicast.BoswatchModule.name |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |