arp.h Source File

Main Page Class Hierarchy Compound List File List Compound Members Examples

# arp.h

    00001 /*** This Programs/Libraries are (C)opyright by Sebastian Krahmer.
    00002  *** You may use it under the terms of the GPL. You should have
    00003  *** already received the file COPYING that shows you your rights.
    00004  *** Please look at COPYING for further license-details.
    00005  ***
    00006  *** THERE IS ABSOLUTELY NO WARRANTY. SO YOU USE IT AT YOUR OWN RISK.
    00007  *** IT WAS WRITTEN IN THE HOPE THAT IT WILL BE USEFULL. I AM NOT RESPONSIBLE
    00008  *** FOR ANY DAMAGE YOU MAYBE GET DUE TO USING MY PROGRAMS.
    00009  ***/
    00010
    00011
    00012 #ifndef _ARP_H_
    00013 #define _ARP_H_
    00014
    00015 #include "usi-structs.h"
    00016 #include "Layer2.h"
    00017 #include <stdio.h>
    00018
    00019 namespace usipp {
    00020
    00021 /* ARP arp.h
    00022  * RFC826, the adress resolution protocol
    00023  */
    00026 class ARP : public Layer2 {
    00027 private:
    00028         struct ether_arp arphdr;
    00029
    00030 public:
    00031
    00035         ARP();
    00036
    00037         virtual ~ARP();
    00038
    00041         char *get_sha(char *hwaddr, size_t len) const;
    00042
    00045         char *get_tha(char *hwaddr, size_t len) const;
    00046
    00050         char *get_spa(int resolve, char *paddr, size_t len) const;
    00051
    00057         char *get_tpa(int resolve, char *paddr, size_t len) const;
    00058
    00061         u_int16_t get_op() const;
    00062
    00066         virtual int sniffpack();
    00067
    00068
    00069         virtual int init_device(char *, int, size_t);
    00070
    00071
    00072         virtual int setfilter(char *);
    00073 };
    00074
    00075 } // namespace usipp
    00076 #endif  // _ARP_H_
    00077