|
SatCat5
|
IPv4 forwarding table with hardware mirroring.
This thin-wrapper for the ip::Table class overrides specific methods to allow routing-table contents to be mirrored to the FPGA's CIDR table ("router2_table.vhd").
Gateware and hybrid routers must use this block instead of of the basic ip::Table class.
Definition at line 22 of file router2_table.h.
#include <router2_table.h>
Public Member Functions | |
| Table (satcat5::cfg::ConfigBus *cfg, unsigned devaddr) | |
| Link this object to its hardware counterpart. | |
| unsigned | table_size () |
| Read the size of the hardware table. | |
| void | log_to (satcat5::log::LogBuffer &wr) const |
| Create a log entry with the full contents of this table. More... | |
| void | route_clear (bool lockdown=true) |
| Clear all routes, including the default. More... | |
| void | route_flush () |
| Flush cached MAC-addresses. More... | |
| bool | route_default (const satcat5::ip::Addr &gateway, const satcat5::eth::MacAddr &dstmac=satcat5::eth::MACADDR_NONE, u8 port=0, u8 flags=0) |
| Set the default behavior when no other routes match. | |
| bool | route_simple (const satcat5::ip::Addr &gateway, const satcat5::ip::Mask &subnet=satcat5::ip::MASK_24) |
| Simplified one-step setup for a typical home network. More... | |
| bool | route_static (const satcat5::ip::Subnet &subnet, const satcat5::ip::Addr &gateway, const satcat5::eth::MacAddr &dstmac=satcat5::eth::MACADDR_NONE, u8 port=0, u8 flags=0) |
| Create or update a single static route. More... | |
| bool | route_local (const satcat5::ip::Subnet &subnet, u8 port=0, u8 flags=0) |
| Create or update a local static route. More... | |
| bool | route_cache (const satcat5::ip::Addr &gateway, const satcat5::eth::MacAddr &dstmac) |
| Update matching MAC address cache entries. More... | |
| bool | route_remove (const satcat5::ip::Subnet &subnet) |
| Remove a single static route. More... | |
| bool | route_remove (const satcat5::ip::Addr &addr) |
| satcat5::ip::Route | route_lookup (const satcat5::ip::Addr &dstaddr) const |
| Next-hop routing lookup for the given destination address. | |
Protected Member Functions | |
| bool | route_wrdef (const satcat5::ip::Route &route) override |
| Internal methods used to access "m_route_default". More... | |
| bool | route_write (unsigned idx, const satcat5::ip::Route &route) override |
| Internal methods used to access "m_route_table". More... | |
| bool | route_load (u32 opcode, const satcat5::ip::Route &route) |
| const satcat5::ip::Route & | route_rddef () const |
| Internal methods used to access "m_route_default". More... | |
| const satcat5::ip::Route & | route_read (unsigned idx) const |
| Internal methods used to access "m_route_table". More... | |
Protected Attributes | |
| satcat5::cfg::Register | m_cfg |
| unsigned | m_wridx_static |
| unsigned | m_wridx_ephemeral |
Private Attributes | |
| satcat5::ip::Route | m_route_default |
| satcat5::ip::Route | m_route_table [SATCAT5_ROUTING_TABLE] |
|
inherited |
Create a log entry with the full contents of this table.
Internally, this calls Route::log_to for each ip::Route in the table. Note: Large tables may be truncated if they exceed the maximum log buffer size.
Definition at line 59 of file ip_table.cc.
|
inherited |
Update matching MAC address cache entries.
If a new cache entry is created, port number is copied from the best matching route.
Definition at line 138 of file ip_table.cc.
|
inherited |
Clear all routes, including the default.
After calling this method, all destination addresses are unreachable until new routes are loaded.
Definition at line 73 of file ip_table.cc.
|
inherited |
Flush cached MAC-addresses.
This method deletes all cached next-hop MAC addresses, i.e., those set by ARP messages using the route_cache method.
Definition at line 81 of file ip_table.cc.
|
inlineinherited |
Create or update a local static route.
Returns true if successful, false if table is full.
Definition at line 192 of file ip_table.h.
|
inlineprotectedinherited |
Internal methods used to access "m_route_default".
Child classes may override this to implement mirroring.
Definition at line 119 of file ip_table.h.
|
inlineprotectedinherited |
Internal methods used to access "m_route_table".
Child classes may override route_write() to implement mirroring.
Definition at line 127 of file ip_table.h.
|
inherited |
Remove a single static route.
Returns true if successful, false if no match is found.
Definition at line 178 of file ip_table.cc.
|
inherited |
Simplified one-step setup for a typical home network.
This method loads the single-gateway, single-subnet route typical for a small-office or home-office (SOHO) LAN.
Definition at line 105 of file ip_table.cc.
|
inherited |
Create or update a single static route.
Returns true if successful, false if table is full.
Definition at line 111 of file ip_table.cc.
|
overrideprotectedvirtual |
Internal methods used to access "m_route_default".
Child classes may override this to implement mirroring.
Reimplemented from satcat5::ip::RouteArray.
Definition at line 33 of file router2_table.cc.
|
overrideprotectedvirtual |
Internal methods used to access "m_route_table".
Child classes may override route_write() to implement mirroring.
Reimplemented from satcat5::ip::RouteArray.
Definition at line 39 of file router2_table.cc.