~ubuntu-branches/ubuntu/trusty/xprobe/trusty

« back to all changes in this revision

Viewing changes to libs-external/USI++/usi++/TX.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_H_
 
11
#define _TX_H_
 
12
 
 
13
#include "config.h"
 
14
#include "usi++/usi-structs.h"
 
15
#include <stdio.h>
 
16
 
 
17
namespace usipp {
 
18
 
 
19
/*! \class TX
 
20
 * The transmitter lets you send packets on the net.
 
21
 * You can write your own and register them with
 
22
 * register_tx() but you must provide at least
 
23
 * sendpack(). Shipped with USI++ is TX_IP which
 
24
 * is in fact a RAW socket */ 
 
25
class TX {
 
26
public:
 
27
        TX() {}
 
28
        virtual ~TX() {}
 
29
        
 
30
        /*! Do the send. You don't call this directly. IP::sendpack() etc
 
31
         * deliver the request to here. YOur task is only to provide a sendpack()
 
32
         * when you write your own TX classes. */
 
33
        virtual int sendpack(void *, size_t, struct sockaddr *) = 0;
 
34
 
 
35
        /*! Must have capability to send broadcast packets. May be
 
36
         * just a dummy. */
 
37
        virtual int broadcast() = 0;
 
38
 
 
39
 
 
40
        /*! set a timeout */
 
41
        virtual int timeout(struct timeval) = 0;
 
42
 
 
43
        /*! RX derived class must also tell user when timeout occurs */
 
44
        virtual bool timeout() = 0;
 
45
};
 
46
 
 
47
} // namespace usipp
 
48
 
 
49
#endif
 
50