Namespaces Class Hierarchy Compound List File List Header Files Compound Members File Members Examples
IP Class Reference
The IP-class.
More...
#include <usi++.h>
Class diagram for IP:
List of all members.Public Members
- IP (const char*, u_int8_t)
- IP (u_int32_t, u_int8_t)
- virtual ~IP ()
- u_int8_t get_hlen ()
- u_int8_t get_vers ()
- u_int8_t get_tos ()
- u_int16_t get_totlen ()
- u_int16_t get_id ()
- u_int16_t get_fragoff ()
- u_int16_t get_fflags ()
- u_int8_t get_ttl ()
- u_int8_t get_proto ()
- u_int16_t get_sum ()
- u_int32_t get_src ()
- u_int32_t get_dst ()
- char* get_src (int, char *, int)
- char* get_dst (int, char *, int)
- int set_hlen (u_int8_t)
- int set_vers (u_int8_t)
- int set_tos (u_int8_t)
- int set_totlen (u_int16_t)
- int set_id (u_int16_t)
- int set_fragoff (u_int16_t)
- int set_fflags (u_int16_t)
- int set_ttl (u_int8_t)
- int set_proto (u_int8_t)
- int set_sum (u_int16_t)
- int set_src (u_int32_t)
- int set_dst (u_int32_t)
- int set_src (const char*)
- int set_dst (const char*)
- virtual int sendpack (void*, int)
- virtual int sendpack (char*)
- virtual int recvpack (void*, int)
- virtual int sniffpack (void*, int)
- virtual int init_device (char*, int, int)
Friends
Detailed Description
The IP-class.
Member Function Documentation
IP::IP (const char * dst, u_int8_t proto)
Create a IP-packet, with 'dst' for destination-adress. Set the protocol-filed in the IP-header to 'proto'. This is used by the derived classes (TCP etc.) to set the correct protocol (IPPROTO_TCP etc.)
IP::IP (u_int32_t dst, u_int8_t proto)
Same as above, but use networkbyte-ordered int32 for destination-adress. This is usefull in case you do sth. like ip.set_src(ip2.get_src())
u_int16_t IP::get_id ()
u_int8_t IP::get_ttl ()
u_int8_t IP::get_proto ()
Obtain the actuall protocol.
u_int32_t IP::get_src ()
u_int32_t IP::get_dst ()
char * IP::get_src (int resolv, char * s, int len)
Get the sourceadress in human-readable form. If 'resolv' == 1, return hostname, if 0 only IP-adress.
char * IP::get_dst (int resolv, char * s, int len)
Get the destination-adress in human-readable form. If resolv == 1, then resolve to a hostname if possible, otherwise give back IP (resolv == 0).
int IP::set_id (u_int16_t id)
int IP::set_ttl (u_int8_t ttl)
int IP::set_proto (u_int8_t p)
Change the protocol-filed of IP header to 'p' in case you need to.
int IP::set_src (u_int32_t s)
Set the source-adress, use networkbyteorderes adress.
int IP::set_dst (u_int32_t d)
int IP::set_src (const char * host)
int IP::set_dst (const char * host)
int IP::sendpack (void * payload, int paylen) [virtual]
Send a packet, containing 'paylen' bytes of data.
Reimplemented in UDP, TCP and ICMP.
int IP::recvpack (void * buf, int len) [virtual]
Handle packets that are dedicated to one of our local adresses.
Reimplemented in UDP, TCP and ICMP.
int IP::sniffpack (void * buf, int len) [virtual]
Handle packets, that are NOT actually for the local adress!
Reimplemented in UDP, TCP and ICMP.
int IP::init_device (char * dev, int promisc, int 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 Datalink.
Reimplemented in UDP, TCP and ICMP.
The documentation for this class was generated from the following file:
Generated at Sun Oct 10 13:51:36 1999 for libusi++ by
written by Dimitri van Heesch, © 1997-1999