SatCat5
satcat5::coap::EndpointSppFwd Class Reference

Detailed Description

EndpointSpp variant that forwards all requests to another Endpoint.

Variant CCSDS-SPP server used in conjunction with another CoAP server on a different network interface. This allows one backing Endpoint to serve the same CoAP resources to multiple networks.

Definition at line 165 of file coap_endpoint.h.

#include <coap_endpoint.h>

Inheritance diagram for satcat5::coap::EndpointSppFwd:
[legend]
Collaboration diagram for satcat5::coap::EndpointSppFwd:
[legend]

Public Member Functions

 EndpointSppFwd (satcat5::ccsds_spp::Dispatch *iface, u16 apid, satcat5::coap::Endpoint *backing_endpoint)
 
satcat5::net::Dispatchiface () const
 Fetch the associated network interface.
 
satcat5::udp::Port srcport () const
 For UDP only, query the local port number.
 
Connectionfind_token (u32 token) const
 Scan connections for a matching proxy-ID. More...
 
satcat5::coap::Connectionget_idle_connection () const
 Get the first idle connection, or null if all are busy.
 
void set_connection (satcat5::coap::Connection *obj)
 Set the preferred connection for outgoing requests. More...
 
void set_filter (const satcat5::net::Type &filter)
 Set network interface filter. More...
 
satcat5::coap::ConnectionSppconnection ()
 Accessor for the internal connection object.
 

Protected Member Functions

void coap_request (Connection *obj, Reader *msg) override
 The Child class overrides these event-handlers: More...
 
void coap_response (Connection *obj, Reader *msg) override
 The Child class overrides these event-handlers: More...
 
void coap_error (Connection *obj) override
 The Child class overrides these event-handlers: More...
 
void coap_ping (const Reader *msg) override
 The Child class overrides these event-handlers: More...
 
void frame_rcvd (satcat5::io::LimitedRead &src) override
 Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value. More...
 
void add_connection (Connection *item)
 
void remove_connection (Connection *item)
 
bool reply (u8 type, const satcat5::coap::ReadHeader *msg)
 
virtual void coap_reqwait (Connection *obj, Reader *msg)
 The Child class overrides these event-handlers: More...
 
virtual void coap_separate (Connection *obj, Reader *msg)
 The Child class overrides these event-handlers: More...
 
virtual void coap_timeout (Connection *obj)
 The Child class overrides these event-handlers: More...
 

Protected Attributes

satcat5::coap::Endpoint *const m_endpoint
 
satcat5::net::Dispatch *const m_iface
 
satcat5::util::List< satcat5::coap::Connectionm_list
 
satcat5::coap::Connectionm_prefer
 
satcat5::coap::Endpointm_aux_ep
 
satcat5::net::Type m_filter
 Incoming packet filter.
 
satcat5::coap::ConnectionSpp m_connection
 Point-to-point link, only one Connection is required.
 

Private Attributes

satcat5::net::Protocolm_next
 Linked list of Protocols.
 

Member Function Documentation

◆ coap_error()

void EndpointSppFwd::coap_error ( Connection obj)
overrideprotectedvirtual

The Child class overrides these event-handlers:

  • coap_request = Received incoming request. The default implementation always responds with "5.01 Not Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
    See also
    coap::Connection.
  • coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
    See also
    Connection::open_request. Multicast queries may result in multiple responses.
  • coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
  • coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
    See also
    Connection::ping.
  • coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.

Reimplemented from satcat5::coap::Endpoint.

Definition at line 139 of file coap_endpoint.cc.

◆ coap_ping()

void EndpointSppFwd::coap_ping ( const Reader msg)
overrideprotectedvirtual

The Child class overrides these event-handlers:

  • coap_request = Received incoming request. The default implementation always responds with "5.01 Not Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
    See also
    coap::Connection.
  • coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
    See also
    Connection::open_request. Multicast queries may result in multiple responses.
  • coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
  • coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
    See also
    Connection::ping.
  • coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.

Reimplemented from satcat5::coap::Endpoint.

Definition at line 141 of file coap_endpoint.cc.

◆ coap_request()

void EndpointSppFwd::coap_request ( Connection obj,
Reader msg 
)
overrideprotectedvirtual

The Child class overrides these event-handlers:

  • coap_request = Received incoming request. The default implementation always responds with "5.01 Not Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
    See also
    coap::Connection.
  • coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
    See also
    Connection::open_request. Multicast queries may result in multiple responses.
  • coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
  • coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
    See also
    Connection::ping.
  • coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.

Reimplemented from satcat5::coap::Endpoint.

Definition at line 135 of file coap_endpoint.cc.

◆ coap_reqwait()

virtual void satcat5::coap::Endpoint::coap_reqwait ( Connection obj,
Reader msg 
)
inlineprotectedvirtualinherited

The Child class overrides these event-handlers:

  • coap_request = Received incoming request. The default implementation always responds with "5.01 Not Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
    See also
    coap::Connection.
  • coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
    See also
    Connection::open_request. Multicast queries may result in multiple responses.
  • coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
  • coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
    See also
    Connection::ping.
  • coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.

Reimplemented in satcat5::coap::ProxyServer.

Definition at line 104 of file coap_endpoint.h.

◆ coap_response()

void EndpointSppFwd::coap_response ( Connection obj,
Reader msg 
)
overrideprotectedvirtual

The Child class overrides these event-handlers:

  • coap_request = Received incoming request. The default implementation always responds with "5.01 Not Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
    See also
    coap::Connection.
  • coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
    See also
    Connection::open_request. Multicast queries may result in multiple responses.
  • coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
  • coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
    See also
    Connection::ping.
  • coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.

Reimplemented from satcat5::coap::Endpoint.

Definition at line 137 of file coap_endpoint.cc.

◆ coap_separate()

virtual void satcat5::coap::Endpoint::coap_separate ( Connection obj,
Reader msg 
)
inlineprotectedvirtualinherited

The Child class overrides these event-handlers:

  • coap_request = Received incoming request. The default implementation always responds with "5.01 Not Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
    See also
    coap::Connection.
  • coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
    See also
    Connection::open_request. Multicast queries may result in multiple responses.
  • coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
  • coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
    See also
    Connection::ping.
  • coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.

Reimplemented in satcat5::coap::ProxyServer.

Definition at line 105 of file coap_endpoint.h.

◆ coap_timeout()

virtual void satcat5::coap::Endpoint::coap_timeout ( Connection obj)
inlineprotectedvirtualinherited

The Child class overrides these event-handlers:

  • coap_request = Received incoming request. The default implementation always responds with "5.01 Not Implemented". The child class SHOULD override this method if it accepts incoming requests. Call open_response() or open_separate() to send the reply.
    See also
    coap::Connection.
  • coap_response = Received the response to a pending request. The default implementation discards the incoming response. The child class SHOULD override this method if it issues requests.
    See also
    Connection::open_request. Multicast queries may result in multiple responses.
  • coap_reqwait = Received duplicate request in "await" state. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_separate = Received separated-response notification. Child classes that require special event handling, such as reverse-proxies, MAY override this method as needed.
  • coap_error = A pending request failed (i.e., reset or timeout). The child class SHOULD override this method if it issues requests, in order to process errors.
  • coap_ping = Received response to a ping request. The child class MAY override this method if it issues ping requests.
    See also
    Connection::ping.
  • coap_timeout = Benign timeout for a non-confirmable request. For unicast queries, this event indicates no response. For multicast queries, this event marks the end of the waiting period, whether or not request(s) were received.

Definition at line 108 of file coap_endpoint.h.

◆ find_token()

Connection * Endpoint::find_token ( u32  token) const
inherited

Scan connections for a matching proxy-ID.

See also
coap::ProxyServer.

Definition at line 40 of file coap_endpoint.cc.

◆ frame_rcvd()

void Endpoint::frame_rcvd ( satcat5::io::LimitedRead src)
overrideprotectedvirtualinherited

Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value.

The child class SHOULD read the frame contents from the provided "src" object, which is only valid until the function returns.

To send a reply:

  • Call m_iface->open_reply() to obtain a Writable object. (This also writes out any applicable frame headers.)
  • Write frame contents, then call write_finalize().

The child class MUST override this method.

Implements satcat5::net::Protocol.

Definition at line 56 of file coap_endpoint.cc.

◆ set_connection()

void satcat5::coap::Endpoint::set_connection ( satcat5::coap::Connection obj)
inlineinherited

Set the preferred connection for outgoing requests.

Usually called indirectly through ManageSpp or ManageUdp.

Definition at line 58 of file coap_endpoint.h.

◆ set_filter()

void satcat5::coap::Endpoint::set_filter ( const satcat5::net::Type filter)
inlineinherited

Set network interface filter.

Usually called indirectly through ManageSpp or ManageUdp.

Definition at line 63 of file coap_endpoint.h.


The documentation for this class was generated from the following files: