Scopira 20080306

scopira::tool::udpflow Class Reference

#include <netflow.h>

Inheritance diagram for scopira::tool::udpflow:

List of all members.

Public Member Functions

 udpflow (void)
 udpflow (int _port)
 ctor, on the given port, 0 for any
virtual ~udpflow ()
bool failed (void) const
 in a failed state?
size_t read (netaddr &actualsrc, int &actualport, byte_t *_buf, size_t _maxsize)
size_t write (netaddr dest, int destport, const byte_t *_buf, size_t _size)
void open (int _port)
 opens a udp socket, with the given port, 0 for any
void close (void)
 close the file
bool read_ready (int msec)
int get_port (void) const
 gets the port

Detailed Description

A UDP socket.

Aleksander Demko

Member Function Documentation

size_t scopira::tool::udpflow::read ( netaddr actualsrc,
int &  actualport,
byte_t *  _buf,
size_t  _maxsize 

read raw block data, returns num read in src may be netaddr::any(). actualsrc may be null, but if it isnt, it will be the actual src if the packet is bigger than the _maxsize, it will be trunced. if the packet is smaller than the _maxsize, the actual size is returned

bool scopira::tool::udpflow::read_ready ( int  msec)

is anything in the input buffer, within the given time? (false==timeout) 1000msec = 1 second

size_t scopira::tool::udpflow::write ( netaddr  dest,
int  destport,
const byte_t *  _buf,
size_t  _size 

write a raw block of data if return 0 and not failed, then your _size > MTU remember that OS's fragmentation system pushes the perceived MTU much higher

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