udp.h Source File

Main Page Class Hierarchy Compound List File List Compound Members Examples

# udp.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 _UDP_H_
    00013 #define _UDP_H_
    00014
    00015 #include "usi-structs.h"
    00016 #include "datalink.h"
    00017 #include "ip.h"
    00018
    00019 namespace usipp {
    00020
    00024 class UDP : public IP {
    00025 private:
    00026         struct udphdr d_udph;
    00027         struct pseudohdr d_pseudo;
    00028 public:
    00029
    00032         UDP(const char*);
    00033
    00036         virtual ~UDP();
    00037
    00040         UDP(const UDP &);
    00041
    00044         UDP &operator=(const UDP&);
    00045
    00048         u_int16_t get_srcport();
    00049
    00050
    00053         u_int16_t get_dstport();
    00054
    00057         u_int16_t get_len();
    00058
    00061         u_int16_t get_udpsum();
    00062
    00065         int set_srcport(u_int16_t);
    00066
    00069         int set_dstport(u_int16_t);
    00070
    00073         int set_len(u_int16_t);
    00074
    00078         int set_udpsum(u_int16_t);
    00079
    00083         udphdr get_udphdr();
    00084
    00087         virtual int sendpack(void*, size_t);
    00088
    00089
    00090         virtual int sendpack(char*);
    00091
    00094         virtual int sniffpack(void*, size_t);
    00095
    00101         virtual int init_device(char *, int promisc, size_t snaplen);
    00102
    00103 };   // class UDP {}
    00104
    00105 } // namespace usipp
    00106
    00107 #endif // _UDP_H_
    00108
    00109