~balkan/adeona/trunk

« back to all changes in this revision

Viewing changes to location/traceroute.h

  • Committer: Vjekoslav Brajkovic
  • Date: 2009-02-17 02:24:59 UTC
  • Revision ID: vjeko@v.dyn.cs.washington.edu-20090217022459-0scqerw4j8oydzqs
Initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2007-2008 University of Washington
 
3
 * 
 
4
 * All rights reserved. For information, contact the Adeona research
 
5
 * team at adeona@cs.washington.edu
 
6
 *
 
7
 * See the file License.txt included in this distribution for details.
 
8
 *
 
9
 */
 
10
#ifndef _TRACEROUTE_H_
 
11
#define _TRACEROUTE_H_
 
12
 
 
13
#include <netinet/in.h>
 
14
#include "common.h"
 
15
 
 
16
#define TR_HOP_LIMIT_STR "20"
 
17
#define TR_HOP_LIMIT 20
 
18
#define TR_NPROBES 1
 
19
 
 
20
typedef enum
 
21
{
 
22
    NORMAL,
 
23
    COMPACT,
 
24
    FRIENDLY
 
25
} trpstyle_t;
 
26
 
 
27
typedef struct _hop_t
 
28
{
 
29
    struct in_addr ip;
 
30
    float rtt;
 
31
} hop_t;
 
32
 
 
33
typedef struct _probe_t
 
34
{
 
35
    struct in_addr target;
 
36
    hop_t hops[TR_HOP_LIMIT];
 
37
} probe_t;
 
38
 
 
39
#define TR_DATA_UPPERBOUND \
 
40
   ( TR_NPROBES * ( sizeof( probe_t ) ) )
 
41
 
 
42
int get_traceroutes( uchar** data OUT, int* len OUT );
 
43
 
 
44
int print_traceroutes( FILE* file, uchar* data IN, int len IN, trpstyle_t style IN );
 
45
 
 
46
#endif // _TRACEROUTE_H_
 
47