libtins  4.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | Friends | List of all members
Tins::PacketWrapper< WrappedType, TimestampType > Class Template Reference

Represents a sniffed packet. More...

#include <packet.h>

Public Types

typedef PDUType pdu_type
typedef TimestampType timestamp_type

Public Member Functions

 operator pdu_type ()
 User defined conversion to wrapped_type. More...
pdu_type pdu ()
 Returns the wrapped_type.
const pdu_type pdu () const
 Returns the PDU const reference.
const Timestamptimestamp () const
 Returns the packet timestamp. More...


class BaseSniffer
class SnifferIterator

Detailed Description

template<typename WrappedType, typename TimestampType>
class Tins::PacketWrapper< WrappedType, TimestampType >

Represents a sniffed packet.

RefPackets contain a PDU reference and a timestamp. The difference between this class and the Packet class is that this one contains a reference to a PDU, and not a pointer to one.

This class is only used in some BaseSniffer methods as a thin wrapper to a PDU pointer/reference. Only BaseSniffer and derived objects can create instances of it.

Member Function Documentation

template<typename WrappedType , typename TimestampType >
Tins::PacketWrapper< WrappedType, TimestampType >::operator pdu_type ( )

User defined conversion to wrapped_type.

This conversion is defined so that BaseSniffer::sniff_loop callback or code that calls BaseSniffer::next_packet can still receive a PDU pointer/reference without modifying the code at all.

template<typename WrappedType , typename TimestampType >
const Timestamp& Tins::PacketWrapper< WrappedType, TimestampType >::timestamp ( ) const

Returns the packet timestamp.

This is the timestamp in which the packet was taken out of the network interface/pcap file.

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