~ubuntu-branches/ubuntu/karmic/xprobe/karmic

« back to all changes in this revision

Viewing changes to libs-external/USI++/samples/tel.cc

  • 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
#include <iostream>
 
2
#include <stdio.h>
 
3
#include <errno.h>
 
4
#include <stdlib.h>
 
5
#include <string.h>
 
6
#include <unistd.h>
 
7
#include <usi++/usi++.h>
 
8
#include <stddef.h>
 
9
 
 
10
int main(int argc, char **argv)
 
11
{
 
12
        char buf[100];
 
13
        
 
14
        if (argc < 2) {
 
15
                cout<<"Usage: "<<argv[0]<<" host\n";
 
16
                exit(1);
 
17
        }
 
18
        TCP tcp(argv[1]);
 
19
 
 
20
        tcp.init_device("eth0", 1, 100);
 
21
        tcp.setfilter("tcp and port 2620");
 
22
 
 
23
        tcp.set_flags(TH_PUSH);
 
24
        tcp.set_dstport(23);
 
25
        tcp.set_srcport(2624);
 
26
        tcp.set_src("192.0.0.1");
 
27
 
 
28
        int i;
 
29
/*      for (i = 1220000000U; i < 1800000000U; i += 1000) {
 
30
                printf("%d\r", i);
 
31
                tcp.set_seq(i);
 
32
                usleep(100);
 
33
                tcp.sendpack(";id>x\n");
 
34
        }
 
35
*/
 
36
 
 
37
        tcp.set_seq(567815162U);
 
38
        tcp.sendpack(";id>x\n");
 
39
                        
 
40
        return 0;
 
41
}