Namespaces Class Hierarchy Compound List File List Header Files Compound Members File Members Examples
Datalink Class Reference
the hardware-layer, ethernet for example.
More...
#include <usi++.h>
Class diagram for Datalink:
List of all members.Public Members
- Datalink ()
- Datalink (char *)
- virtual ~Datalink ()
- char* get_hwsrc (char *, int)
- char* get_hwdst (char *, int)
- int get_etype ()
- int get_datalink ()
- int get_framelen ()
- const char* set_host (const char *)
- virtual int init_device (char *, int, int)
- virtual int setfilter (char *)
- virtual int sniffpack (char *, int)
Protected Members
- char host [MAXHOSTLEN]
- char filter_string [1000]
Detailed Description
the hardware-layer, ethernet for example.
Member Function Documentation
Datalink::Datalink (char * filterStr)
This constructor should be used to initialize raw-datalink-objects, means not IP/TCP/ICMP etc.
char * Datalink::get_hwsrc (char * hwaddr, int len)
Fill buffer with src-hardware-adress of actuall packet, use 'datalink' to determine what HW the device is. Now only ethernet s supportet, but it's extensinable.
-
Examples:
-
arpw.cc, hardSpy.cc and icmp_sniff.cc.
char * Datalink::get_hwdst (char * hwaddr, int len)
Fill buffer with dst-hardware-adress of actuall packet, use 'datalink' to determine what HW the device is. Now only ethernet s supportet, but it's extensinable.
-
Examples:
-
arpw.cc and icmp_sniff.cc.
int Datalink::get_etype ()
Get protocol-type of ethernet-frame Maybe moves to ethernet-class in future?
int Datalink::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 in UDP, TCP, IP and ICMP.
int Datalink::setfilter (char * s) [virtual]
set a new filter for capturing
Member Data Documentation
char Datalink::host[MAXHOSTLEN] [protected]
derived classes need access to these
The documentation for this class was generated from the following file:
Generated at Sun Oct 10 13:51:35 1999 for libusi++ by
written by Dimitri van Heesch, © 1997-1999