Flow 1.0.2
Flow project: Full implementation reference.
|
Internal net_flow
struct
that encapsulates the Flow-protocol low-level RST packet.
More...
#include <low_lvl_packet.hpp>
Public Member Functions | |
size_t | serialize_to_raw_data (Const_buffer_sequence *raw_bufs) const override |
Implements Low_lvl_packet API. More... | |
Public Member Functions inherited from flow::net_flow::Low_lvl_packet | |
virtual size_t | serialize_to_raw_data (Const_buffer_sequence *raw_bufs) const =0 |
Serializes the current logical packet data from *this into the given Const_buffer_sequence , which is a sequence of pointers and lengths of existing scattered areas in memory, presumably for transmission over the wire to a compatible serializing Node. More... | |
size_t | serialize_to_raw_data_and_log (Const_buffer_sequence *raw_bufs) const |
Identical to serialize_to_raw_data() but adds log-level-appropriate logging after the operation. More... | |
Public Member Functions inherited from flow::util::Null_interface | |
virtual | ~Null_interface ()=0 |
Boring virtual destructor. More... | |
Public Member Functions inherited from flow::log::Log_context | |
Log_context (Logger *logger=0) | |
Constructs Log_context by storing the given pointer to a Logger and a null Component. More... | |
template<typename Component_payload > | |
Log_context (Logger *logger, Component_payload component_payload) | |
Constructs Log_context by storing the given pointer to a Logger and a new Component storing the specified generically typed payload (an enum value). More... | |
Log_context (const Log_context &src) | |
Copy constructor that stores equal Logger* and Component values as the source. More... | |
Log_context (Log_context &&src) | |
Move constructor that makes this equal to src , while the latter becomes as-if default-constructed. More... | |
Log_context & | operator= (const Log_context &src) |
Assignment operator that behaves similarly to the copy constructor. More... | |
Log_context & | operator= (Log_context &&src) |
Move assignment operator that behaves similarly to the move constructor. More... | |
void | swap (Log_context &other) |
Swaps Logger pointers and Component objects held by *this and other . More... | |
Logger * | get_logger () const |
Returns the stored Logger pointer, particularly as many FLOW_LOG_*() macros expect. More... | |
const Component & | get_log_component () const |
Returns reference to the stored Component object, particularly as many FLOW_LOG_*() macros expect. More... | |
Static Public Attributes | |
static const uint8_t | S_RAW_TYPE_ID |
In serialized packet, the type ID byte identifying this as an RST packet. Must not equal any other packet type's. More... | |
Private Member Functions | |
Rst_packet (log::Logger *logger_ptr) | |
The implementation of Low_lvl_packet::create_uninit_packet() for this sub-type of Low_lvl_packet. More... | |
bool | deserialize_type_specific_data_from_raw_data_packet (Const_buffer *raw_buf, bool prefer_no_move, util::Blob *raw_packet) override |
Implements Low_lvl_packet API. More... | |
Friends | |
boost::shared_ptr< Rst_packet > | Low_lvl_packet::create_uninit_packet (log::Logger *) |
Friend of Rst_packet: For access to private constructor Rst_packet(Logger*) . | |
Additional Inherited Members | |
Public Types inherited from flow::net_flow::Low_lvl_packet | |
using | Const_buffer = boost::asio::const_buffer |
Short-hand for boost.asio immutable buffer, which essentially is a pointer to and length of a memory area. More... | |
using | Const_buffer_sequence = std::vector< Const_buffer > |
Short-hand for sequence of immutable buffers; i.e., a sequence of 1 or more scattered areas in memory. More... | |
using | security_token_t = uint64_t |
Type used for m_security_token member of a couple different packet types. More... | |
using | rexmit_id_t = uint8_t |
Type used to store the retransmission count in DATA and ACK packets. More... | |
using | rcv_wnd_t = uint32_t |
Type used to store the size of m_rcv_wnd member in a couple of different packet types. More... | |
Public Types inherited from flow::util::Shared_ptr_alias_holder< boost::shared_ptr< Low_lvl_packet > > | |
using | Ptr = boost::shared_ptr< Low_lvl_packet > |
Short-hand for ref-counted pointer to mutable values of type Target_type::element_type (a-la T* ). More... | |
using | Const_ptr = Const_target_ptr |
Short-hand for ref-counted pointer to immutable values of type Target_type::element_type (a-la T const * ). More... | |
Static Public Member Functions inherited from flow::net_flow::Low_lvl_packet | |
template<typename Low_lvl_packet_sub > | |
static boost::shared_ptr< Low_lvl_packet_sub > | create_uninit_packet (log::Logger *logger_ptr) |
Constructs packet with uninitialized (essentially random) values, of the Low_lvl_packet sub-type specified as the template parameter (Ack_packet, Rst_packet, etc.). More... | |
template<typename Low_lvl_packet_sub > | |
static Ptr | create_uninit_packet_base (log::Logger *logger_ptr) |
A simple convenience method that casts the result of create_uninit_packet() from shared_ptr<T> , where T is a sub-type of Low_lvl_packet, to shared_ptr<Low_lvl_packet> a/k/a Ptr. More... | |
static Ptr | create_from_raw_data_packet (log::Logger *logger_ptr, util::Blob *raw_packet, bool prefer_no_move) |
Constructs packet on the heap with values determined by the given raw binary data as presumably received from the wire and originally serialized by a compatible serializing Node. More... | |
static const std::string & | type_id_to_str (const std::type_index &type_id) |
Returns a brief (a few characters) string description of the given packet type given as type_index(typeid(p)) , where p is a reference to an instance of a concrete Low_lvl_packet sub-type. More... | |
Static Public Member Functions inherited from flow::util::Shared_ptr_alias_holder< boost::shared_ptr< Low_lvl_packet > > | |
static Ptr | ptr_cast (const From_ptr &ptr_to_cast) |
Provides syntactic-sugary way to perform a static_pointer_cast<> from a compatible smart pointer type From_ptr , typically From_ptr::element_type being in the same class hierarchy as Target_ptr::element_type . More... | |
static Const_ptr | const_ptr_cast (const From_ptr &ptr_to_cast) |
Identical to ptr_cast() but adds const -ness (immutability) to the pointed-to type. More... | |
static Ptr | dynamic_ptr_cast (const From_ptr &ptr_to_cast) |
Equivalent to ptr_cast() but a dynamic_pointer_cast instead of static. More... | |
static Const_ptr | dynamic_const_ptr_cast (const From_ptr &ptr_to_cast) |
Identical to const_ptr_cast() but a dynamic_pointer_cast instead of static. More... | |
Public Attributes inherited from flow::net_flow::Low_lvl_packet | |
bool | m_opt_rexmit_on |
Option indicating whether this connection is using retransmission or not. More... | |
struct { | |
flow_port_t m_src_port | |
Flow-protocol port # of socket in sending Node. More... | |
flow_port_t m_dst_port | |
Flow-protocol port # of socket in receiving Node. More... | |
} | m_packed |
Packed group affected by #pragma pack . | |
const Function< std::ostream &(std::ostream &)> | m_type_ostream_manip |
ostream manipulator (argument to ostream << ) that will output packet's type ("ACK", "RST", etc.). More... | |
const Function< std::ostream &(std::ostream &)> | m_verbose_ostream_manip |
ostream manipulator (argument to ostream << ) that will output packet info suitable for DATA log level. More... | |
const Function< std::ostream &(std::ostream &)> | m_concise_ostream_manip |
ostream manipulator (argument to ostream << ) that will output packet info suitable for TRACE log level. More... | |
Protected Member Functions inherited from flow::net_flow::Low_lvl_packet | |
Low_lvl_packet (log::Logger *logger_ptr) | |
Constructs packet with uninitialized (essentially random) values. More... | |
size_t | serialize_common_header_to_raw_data (Const_buffer_sequence *raw_bufs) const |
Helper for serialize_to_raw_data() implementations in sub-types that encodes the header common to all packet types, starting with the packet type ID leading that header. More... | |
virtual std::ostream & | to_ostream (std::ostream &os, bool verbose=false) const |
Writes a multi-line representation of *this to an output stream. More... | |
Static Protected Member Functions inherited from flow::net_flow::Low_lvl_packet | |
static constexpr bool | native_is_big_endian () |
Returns true , at compile time, if and only if the native memory representation is big-endian, meaning, for example, the value uint32_t(1) is stored as the bytes, in order, 0x00 0x00 0x00 0x01, and not the reverse. More... | |
Internal net_flow
struct
that encapsulates the Flow-protocol low-level RST packet.
See Low_lvl_packet doc header for information common to all low-level packets including this one.
An RST means the sender is immediately shutting down the connection without waiting for any feedback from the receiver and is recommending that the latter do the same ASAP. This is sent in a variety of error situations.
The one peculiar thing about Rst_packet is it contains no data beyond the super-struct
Low_lvl_packet, other than the fact it is an Rst_packet (i.e., its typeid()
identifies it as such). Thus its various virtual
methods are typically either simple or even don't exist and defer to the Low_lvl_packet implementation.
Definition at line 1332 of file low_lvl_packet.hpp.
|
explicitprivate |
The implementation of Low_lvl_packet::create_uninit_packet() for this sub-type of Low_lvl_packet.
logger_ptr | Logger to use subsequently. |
Definition at line 102 of file low_lvl_packet.cpp.
|
overrideprivatevirtual |
Implements Low_lvl_packet API.
See that super-method's doc header.
Implements flow::net_flow::Low_lvl_packet.
Definition at line 893 of file low_lvl_packet.cpp.
References FLOW_LOG_WARNING, and flow::net_flow::Low_lvl_packet::m_type_ostream_manip.
|
overridevirtual |
Implements Low_lvl_packet API.
See that super-method's doc header.
raw_bufs | See Low_lvl_packet::serialize_to_raw_data(). |
Implements flow::net_flow::Low_lvl_packet.
Definition at line 375 of file low_lvl_packet.cpp.
|
static |
In serialized packet, the type ID byte identifying this as an RST packet. Must not equal any other packet type's.
Definition at line 1349 of file low_lvl_packet.hpp.