~ubuntu-branches/ubuntu/precise/xprobe/precise

« back to all changes in this revision

Viewing changes to libs-external/USI++/usi++/TX_IP.h

  • Committer: Bazaar Package Importer
  • Author(s): Richard Atterer
  • Date: 2005-02-22 22:54:24 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050222225424-6cqy8rr45pkna819
Tags: 0.2.2-1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*** This Programs/Libraries are (C)opyright by Sebastian Krahmer.
 
2
 *** You may use it under the terms of the GPL. You should have
 
3
 *** already received the file COPYING that shows you your rights.
 
4
 *** Please look at COPYING for further license-details.
 
5
 ***  
 
6
 *** THERE IS ABSOLUTELY NO WARRANTY. SO YOU USE IT AT YOUR OWN RISK.
 
7
 *** IT WAS WRITTEN IN THE HOPE THAT IT WILL BE USEFULL. I AM NOT RESPONSIBLE
 
8
 *** FOR ANY DAMAGE YOU MAYBE GET DUE TO USING MY PROGRAMS.
 
9
 ***/
 
10
#ifndef _TX_IP_H_
 
11
#define _TX_IP_H_
 
12
 
 
13
#include "config.h"
 
14
#include "usi++/usi-structs.h"
 
15
#include "TX.h"
 
16
#include <stdio.h>
 
17
 
 
18
namespace usipp {
 
19
 
 
20
/*! \class TX_IP
 
21
 *      This sends IP datagrams over
 
22
 *  a raw socket */
 
23
class TX_IP : public TX {
 
24
private:
 
25
        int rawfd;
 
26
        struct timeval tx_tv;
 
27
    bool tx_timeout;
 
28
public:
 
29
        TX_IP() : rawfd(-1) { tx_timeout = false; }
 
30
 
 
31
        virtual ~TX_IP() {}
 
32
 
 
33
        /*! Send a packet on raw socket (starting with IP-hdr) */
 
34
        virtual int sendpack(void *, size_t, struct sockaddr*);
 
35
 
 
36
        /*! Enable broadcast option on socket */
 
37
        virtual int broadcast();
 
38
 
 
39
        /*! Set a timeout. Implements TX::timeout() = 0. */
 
40
        int timeout(struct timeval);
 
41
 
 
42
        /*! Returns true when sendto() timed out */
 
43
        bool timeout();
 
44
        
 
45
 
 
46
};
 
47
 
 
48
}       // namespace
 
49
#endif
 
50