#include <datalink.h>
Inheritance diagram for usipp::Pcap:

Public Methods | |
| Pcap (char *) | |
| Pcap () | |
| Pcap (const Pcap &) | |
| virtual | ~Pcap () |
| Pcap& | operator= (const Pcap &) |
| char* | get_hwsrc (char *, size_t) |
| char* | get_hwdst (char *, size_t) |
| u_int16_t | get_etype () |
| int | get_datalink () |
| int | get_framelen () |
| virtual int | init_device (char *dev, int promisc, size_t snaplen) |
| virtual int | setfilter (char *filter) |
| virtual int | sniffpack (void *, size_t) |
| void* | get_frame (void *, size_t) |
| pcap_t* | pcap () |
| int | timeout (struct timeval) |
| bool | timeout () |
Protected Attributes | |
| struct ether_header | d_ether |
| char | d_filter_string [1000] |
|
|
This constructor should be used to initialize raw-datalink-objects, means not IP/TCP/ICMP etc. We need this b/c unlike in derived classes, datalink::init_device() cannot set a filter! |
|
|
Copy-constructor |
|
|
Return the actual datalink of the object. |
|
|
Get protocol-type of ethernet-frame Maybe moves to ethernet-class in future? |
|
|
Return HW-frame |
|
|
Return the actual framlen of the object. (framelen depends on datalink) |
|
|
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. |
|
|
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. |
|
|
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::RX. |
|
|
Get pcap_t struct to obtain fileno etc for select. |
|
|
set a new filter for capturing Reimplemented from usipp::RX. |
|
|
sniff a packet Reimplemented from usipp::RX. |
|
|
Returns true when recv() timed out Reimplemented from usipp::RX. |
|
|
Set a timeout. Implements RX::timeout() = 0. Reimplemented from usipp::RX. |
1.2.3 written by Dimitri van Heesch,
© 1997-2000