SatCat5
net_protocol.h
Go to the documentation of this file.
1 // Copyright 2023-2024 The Aerospace Corporation.
3 // This file is a part of SatCat5, licensed under CERN-OHL-W v2 or later.
8 
9 #pragma once
10 
11 #include <satcat5/io_readable.h>
12 #include <satcat5/net_type.h>
13 #include <satcat5/types.h>
14 
15 namespace satcat5 {
16  namespace net {
28  class Protocol {
29  public:
41  virtual void frame_rcvd(satcat5::io::LimitedRead& src) = 0;
42 
43  protected:
47  explicit Protocol(const satcat5::net::Type& type)
48  : m_filter(type), m_next(0) {}
49  ~Protocol() {}
51 
53 
54  private:
61  };
62  }
63 }
Limited read of next N bytes.
Definition: io_readable.h:255
The "Dispatch" is a generic interface that knows how to read a designated protocol layer and sort inc...
Definition: net_dispatch.h:36
A net::Protocol is the counterpart to net::Dispatch that handles a particular data stream,...
Definition: net_protocol.h:28
~Protocol()
Constructor and destructor access restricted to children.
Definition: net_protocol.h:49
virtual void frame_rcvd(satcat5::io::LimitedRead &src)=0
Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value.
satcat5::net::Type m_filter
Incoming packet filter.
Definition: net_protocol.h:52
satcat5::net::Protocol * m_next
Linked list of Protocols.
Definition: net_protocol.h:60
Protocol(const satcat5::net::Type &type)
Constructor and destructor access restricted to children.
Definition: net_protocol.h:47
Helper functions for manipulating singly-linked lists.
Definition: list.h:52
"Readable" I/O interface core definitions
Generic numeric "Type" for use with net::Protocol.
Multipurpose filter for matching fields in network packets.
Definition: net_type.h:38
Basic type aliases and prototypes used throughout SatCat5.