|
SatCat5
|
Defines a generic API for sending data to a specific destination, such as a MAC address, IP, or Port.
Each Address object wraps a particular net::Dispatch + net::Address + net::Type, to provide an open_write() method for generic net::Protocols. Every net::Dispatch implementation SHOULD provide a net::Address wrapper.
Implementations are available for sending data to a:
Implementations MUST derive from this class. The child class also maintains any required state for opening and closing connections.
Definition at line 30 of file net_address.h.
#include <net_address.h>
Public Member Functions | |
| virtual satcat5::net::Dispatch * | iface () const =0 |
| Fetch a pointer to the underlying interface. More... | |
| virtual satcat5::io::Writeable * | open_write (unsigned len)=0 |
| Open a new frame to the designated address and type. More... | |
| virtual void | close ()=0 |
| Close any open connections and revert to idle. More... | |
| virtual bool | ready () const =0 |
| Is this address object ready for use? Child MUST override this method. | |
| virtual void | retry () |
| If this Address is not in the ready() state, reattempt any steps required to do so, such as MAC address resolution. More... | |
| virtual bool | is_multicast () const =0 |
| Is the destination a broadcast or multicast address? Child MUST override these method. | |
| virtual bool | matches_reply_address () const =0 |
| Does this Address object match the parent interface's current reply address? Multicast destinations should match any source address expected to receive the multicast message. More... | |
| virtual bool | reply_is_multicast () const =0 |
| Was the parent interface's incoming message sent to a multicast address? (i.e., Could that message have many other recipients?) Child MUST override this method. | |
| virtual void | save_reply_address ()=0 |
| Bind this Address object to the parent interface's current reply address, as provided in net::Dispatch::open_reply(). More... | |
| bool | write_packet (unsigned nbytes, const void *data) |
| All-in-one call that writes an entire packet. More... | |
|
pure virtual |
Close any open connections and revert to idle.
Child MUST override this method.
Implemented in satcat5::udp::Address, satcat5::ip::Address, satcat5::eth::Address, satcat5::ccsds_spp::Address, and satcat5::test::DebugAddress.
|
pure virtual |
Fetch a pointer to the underlying interface.
Child MUST override this method.
Implemented in satcat5::udp::Address, satcat5::ip::Address, satcat5::eth::Address, satcat5::ccsds_spp::Address, and satcat5::test::DebugAddress.
|
pure virtual |
Does this Address object match the parent interface's current reply address? Multicast destinations should match any source address expected to receive the multicast message.
Child MUST override this method.
Implemented in satcat5::udp::Address, satcat5::ip::Address, satcat5::eth::Address, and satcat5::ccsds_spp::Address.
|
pure virtual |
Open a new frame to the designated address and type.
Child MUST override this method.
Implemented in satcat5::udp::Address, satcat5::ip::Address, satcat5::eth::Address, satcat5::ccsds_spp::Address, and satcat5::test::DebugAddress.
|
inlinevirtual |
If this Address is not in the ready() state, reattempt any steps required to do so, such as MAC address resolution.
Child SHOULD override this method if applicable.
Reimplemented in satcat5::udp::Address, and satcat5::ip::Address.
Definition at line 52 of file net_address.h.
|
pure virtual |
Bind this Address object to the parent interface's current reply address, as provided in net::Dispatch::open_reply().
Child MUST override this method.
Implemented in satcat5::udp::Address, satcat5::ip::Address, satcat5::eth::Address, and satcat5::ccsds_spp::Address.
| bool Address::write_packet | ( | unsigned | nbytes, |
| const void * | data | ||
| ) |
All-in-one call that writes an entire packet.
Equivalent to open_write(), io::Writeable::write_bytes(), io::Writeable::write_finalize().
Definition at line 11 of file net_address.cc.