SatCat5
router2_table.h
1 // Copyright 2024 The Aerospace Corporation.
3 // This file is a part of SatCat5, licensed under CERN-OHL-W v2 or later.
5 // Internet Protocol v4 (IPv4) forwarding table with mirroring
6 
7 #pragma once
8 
9 #include <satcat5/cfgbus_core.h>
10 #include <satcat5/ip_table.h>
11 
12 namespace satcat5 {
13  namespace router2 {
22  class Table : public satcat5::ip::Table {
23  public:
25  Table(satcat5::cfg::ConfigBus* cfg, unsigned devaddr);
26 
28  unsigned table_size();
29 
30  protected:
31  // Override the required parent methods..
32  bool route_wrdef(const satcat5::ip::Route& route) override;
33  bool route_write(unsigned idx, const satcat5::ip::Route& route) override;
34 
35  // Internal helper method.
36  bool route_load(u32 opcode, const satcat5::ip::Route& route);
37 
38  // ConfigBus register interface.
40  };
41  }
42 }
ConfigBus core definitions.
Generic ConfigBus API.
Definition: cfgbus_core.h:124
Pointer-like wrapper for one or more ConfigBus registers.
Definition: cfgbus_core.h:76
IPv4 forwarding table.
Definition: ip_table.h:144
Table()
Construct an empty table with a local default route.
Definition: ip_table.cc:52
IPv4 forwarding table with hardware mirroring.
Definition: router2_table.h:22
unsigned table_size()
Read the size of the hardware table.
bool route_wrdef(const satcat5::ip::Route &route) override
Internal methods used to access "m_route_default".
bool route_write(unsigned idx, const satcat5::ip::Route &route) override
Internal methods used to access "m_route_table".
Internet Protocol v4 (IPv4) forwarding table.
A single entry in the static routing table.
Definition: ip_table.h:57