17 #ifndef HH_SENF_Socket_QueueReadWritePolicy_ 18 #define HH_SENF_Socket_QueueReadWritePolicy_ 1 21 #include <linux/if_packet.h> 22 #include <boost/optional.hpp> 33 struct QueueReadPolicy;
34 struct QueueWritePolicy;
60 const_iterator
begin()
const;
61 const_iterator
end()
const;
62 size_type
size()
const;
79 boost::optional<unsigned>
vlan()
const;
81 unsigned tpid()
const;
85 #ifdef SENF_ENABLE_TPACKET_OFFSET
93 struct ::tpacket2_hdr & hdr();
94 struct ::tpacket2_hdr
const & hdr()
const;
113 private detail::QueuePolicyBase
118 static boost::optional<Buffer> dequeue(
FileHandle & handle);
122 static unsigned read(
FileHandle & handle,
char * buffer,
unsigned size);
131 private detail::QueuePolicyBase
136 static boost::optional<Buffer> enqueue(
FileHandle & handle);
141 static unsigned write(
FileHandle & handle,
char const * buffer,
unsigned size);
config::time_type clock_type
unsigned tpid() const
return the preprocessed VLAN TPID
unsigned char const * const_iterator
Policy Framework public header.
WritePolicy for sockets writeable via packet queue API.
void resize(size_type sz)
resize active packet data to given size
ReadPolicy for sockets readable via packet queue API.
Basic file handle wrapper.
LLSocketAddress and LLAddressingPolicy public header.
SocketQueueBuffer::size_type size_type
SocketQueueBuffer::size_type size_type
Policy defining the readability.
size_type frameSize() const
senf::ClockService::clock_type timestamp() const
return packet receive timestamp
senf::LLSocketAddress address() const
return incoming interface address
boost::optional< unsigned > vlan() const
return the preprocessed VLAN TCI if any
FileHandle public header.
unsigned dataOffset() const
std::uint32_t const * timestampPtr() const
return a pointer to the tp_hdr sec/nsec fieldes
Buffer used by QueueReadPolicy / QueueWritePolicy.
Policy defining the writability.