Main Page   Class Hierarchy   Compound List   File List   Compound Members   Examples  

usipp::UDP Class Reference

#include <udp.h>

Inheritance diagram for usipp::UDP:

usipp::IP usipp::Layer2 List of all members.

Public Methods

 UDP (const char*)
virtual ~UDP ()
 UDP (const UDP &)
UDP& operator= (const UDP&)
u_int16_t get_srcport ()
u_int16_t get_dstport ()
u_int16_t get_len ()
u_int16_t get_udpsum ()
int set_srcport (u_int16_t)
int set_dstport (u_int16_t)
int set_len (u_int16_t)
int set_udpsum (u_int16_t)
udphdr get_udphdr ()
virtual int sendpack (void*, size_t)
virtual int sendpack (char*)
virtual int sniffpack (void*, size_t)
virtual int init_device (char *, int promisc, size_t snaplen)

Detailed Description

All about UDP.


Constructor & Destructor Documentation

usipp::UDP::UDP ( const char * )
 

Expects Host.

usipp::UDP::~UDP ( ) [virtual]
 

Destructor

usipp::UDP::UDP ( const UDP & )
 

Copy-Constructor


Member Function Documentation

u_int16_t usipp::UDP::get_dstport ( )
 

Get the destinationport of the UDP-datagram

u_int16_t usipp::UDP::get_len ( )
 

Return length of UDP-header plus contained data.

u_int16_t usipp::UDP::get_srcport ( )
 

Get the sourceport of UDP-datagram.

udphdr usipp::UDP::get_udphdr ( )
 

Return complete UDP header. Usefull for some kinds of ICMP messages

u_int16_t usipp::UDP::get_udpsum ( )
 

Return the checksum of UDP-datagram.

int usipp::UDP::init_device ( char * dev,
int promisc,
size_t snaplen ) [virtual]
 

Initialize a device ("eth0" for example) for packet- capturing. It MUST be called before sniffpack() is launched. Set 'promisc' to 1 if you want the device running in promiscous mode. Fetch at most 'snaplen' bytes per call.

Reimplemented from usipp::IP.

UDP & usipp::UDP::operator= ( const UDP & )
 

Assign-operator

int usipp::UDP::sendpack ( void * payload,
size_t paylen ) [virtual]
 

Send an UDP-datagramm, containing 'paylen' bytes of data.

Reimplemented from usipp::IP.

int usipp::UDP::set_dstport ( u_int16_t )
 

Set the destinationport in the UDP-header.

int usipp::UDP::set_len ( u_int16_t )
 

Set the length of the UDP-datagramm.

int usipp::UDP::set_srcport ( u_int16_t )
 

Set the sourceport in the UDP-header.

int usipp::UDP::set_udpsum ( u_int16_t )
 

Set the UDP-checksum. Calling this function with s != 0 will prevent sendpack() from setting the checksum!!!

int usipp::UDP::sniffpack ( void * buf,
size_t buflen ) [virtual]
 

Capture packets that are not for our host.

Reimplemented from usipp::IP.


The documentation for this class was generated from the following file:
Generated at Fri May 11 13:02:56 2001 for libusi++ by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000