SatCat5
port_recovery.h
1 // Copyright 2025 The Aerospace Corporation.
3 // This file is a part of SatCat5, licensed under CERN-OHL-W v2 or later.
5 //
6 //
7 // Recovery Subsystem
8 
9 
10 #pragma once
11 
12 #include <satcat5/eth_checksum.h>
13 #include <satcat5/eth_header.h>
14 #include <satcat5/eth_plugin.h>
15 #include <satcat5/eth_switch.h>
16 #include <satcat5/io_core.h>
17 #include <satcat5/pkt_buffer.h>
18 #include <satcat5/switch_cfg.h>
19 
20 #define SATCAT5_RECOVERY_SWITCH_BUFFER_SIZE 2048
21 
22 namespace satcat5 {
23  namespace port {
27  public:
30 
33  { return &m_recov_in_buff; }
34 
35  protected:
36  // Plugin Query Callback
37  void query(satcat5::eth::PluginPacket& packet) override;
38  satcat5::io::PacketBuffer m_recov_in_buff;
39  u8 m_raw_buff_in[SATCAT5_RECOVERY_SWITCH_BUFFER_SIZE];
40  };
41 
45  public:
48  };
49  }
50 }
Ethernet switch plugin API.
Definition: eth_plugin.h:166
A shared-memory Ethernet switch based on the MultiBuffer class.
Definition: eth_switch.h:93
Generic packetized I/O interface for use with SwitchCore.
Definition: eth_switch.h:245
MultiWriter adapter for bypass mode.
Definition: multi_buffer.h:481
The PacketBuffer class is a wrapper for a circular buffer, with optional logic to support retention o...
Definition: pkt_buffer.h:66
Abstract API for reading byte-streams and packets.
Definition: io_readable.h:68
MultiWriter that slips packets written to it into the port's egress buffer.
Definition: port_recovery.h:44
RecoveryEgress(satcat5::eth::SwitchPort *port)
Egress interface attaches to an Ethernet port.
Intercepts all packets with the ETYPE_RECOVERY_IN ethertype and puts them into a buffer that can be r...
Definition: port_recovery.h:26
RecoveryIngress(satcat5::eth::SwitchCore *sw)
Ingress interface attaches to an Ethernet switch.
void query(satcat5::eth::PluginPacket &packet) override
Packet-received callback.
satcat5::io::Readable * read()
Return the buffer's Readable interface.
Definition: port_recovery.h:32
Inline Ethernet Checksum insertion and verification.
Type definitions for Ethernet frames and protocol handlers.
Plugins for the software-defined Ethernet switch and IPv4 router.
Software-defined Ethernet switch.
I/O interface core definitions.
Ephemeral data structure provided to plugin callbacks.
Definition: eth_plugin.h:48
Configuration for a managed SatCat5 switch.