libtins  3.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Member Functions | List of all members
Tins::TCPStreamFollower Class Reference

Follows TCP streams and notifies the user when data is available. More...

#include <tcp_stream.h>

Public Member Functions

 TCPStreamFollower ()
 Default constructor.
 
template<typename DataFunctor , typename EndFunctor >
void follow_streams (BaseSniffer &sniffer, DataFunctor data_fun, EndFunctor end_fun)
 Starts following TCP streams. More...
 
template<typename ForwardIterator , typename DataFunctor , typename EndFunctor >
void follow_streams (ForwardIterator start, ForwardIterator end, DataFunctor data_fun, EndFunctor end_fun)
 Starts following TCP streams. More...
 
template<typename DataFunctor >
void follow_streams (BaseSniffer &sniffer, DataFunctor data_fun)
 Starts following TCP streams. More...
 
template<typename ForwardIterator , typename DataFunctor >
void follow_streams (ForwardIterator start, ForwardIterator end, DataFunctor data_fun)
 Starts following TCP streams. More...
 

Detailed Description

Follows TCP streams and notifies the user when data is available.

Member Function Documentation

template<typename DataFunctor , typename EndFunctor >
void Tins::TCPStreamFollower::follow_streams ( BaseSniffer sniffer,
DataFunctor  data_fun,
EndFunctor  end_fun 
)

Starts following TCP streams.

The template functors must accept a TCPStream& as argument, which will point to the stream which has been modified.

Parameters
snifferThe sniffer which will be used to sniff PDUs.
data_funThe function which will be called whenever one of the peers in a connection sends data.
end_funThis function will be called when a stream is closed.
template<typename ForwardIterator , typename DataFunctor , typename EndFunctor >
void Tins::TCPStreamFollower::follow_streams ( ForwardIterator  start,
ForwardIterator  end,
DataFunctor  data_fun,
EndFunctor  end_fun 
)

Starts following TCP streams.

This overload takes a range of iterators containing the PDUs in which TCP streams will be looked up and followed. The iterators will be dereferenced until a PDU& is found, so iterators can hold not only PDUs, but also smart pointers, etc.

The template functors must accept a TCPStream& as argument, which will point to the stream which has been modified.

The state of the PDUs stored in the iterator range provided might be modified internally.

Parameters
startThe start of the range of PDUs.
endThe start of the range of PDUs.
data_funThe function which will be called whenever one of the peers in a connection sends data.
end_funThis function will be called when a stream is closed.
template<typename DataFunctor >
void Tins::TCPStreamFollower::follow_streams ( BaseSniffer sniffer,
DataFunctor  data_fun 
)

Starts following TCP streams.

The template functor must accept a TCPStream& as argument, which will point to the stream which has been modified.

Parameters
snifferThe sniffer which will be used to sniff PDUs.
data_funThe function which will be called whenever one of the peers in a connection sends data. closed.
template<typename ForwardIterator , typename DataFunctor >
void Tins::TCPStreamFollower::follow_streams ( ForwardIterator  start,
ForwardIterator  end,
DataFunctor  data_fun 
)

Starts following TCP streams.

This overload takes a range of iterators containing the PDUs in which TCP streams will be looked up and followed. The iterators will be dereferenced until a PDU& is found, so iterators can hold not only PDUs, but also smart pointers, etc.

The template functors must accept a TCPStream& as argument, which will point to the stream which has been modified.

The state of the PDUs stored in the iterator range provided might be modified internally.

Parameters
startThe start of the range of PDUs.
endThe start of the range of PDUs.
data_funThe function which will be called whenever one of the peers in a connection sends data.

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