|
version 1.1, 2019/10/21 14:25:31
|
version 1.1.1.3, 2023/09/27 11:18:58
|
|
Line 4
|
Line 4
|
| Copyright (C) 2005 R.E.Wolff@BitWizard.nl |
Copyright (C) 2005 R.E.Wolff@BitWizard.nl |
| |
|
| This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
| it under the terms of the GNU General Public License version 2 as | it under the terms of the GNU General Public License version 2 as |
| published by the Free Software Foundation. |
published by the Free Software Foundation. |
| |
|
| This program is distributed in the hope that it will be useful, |
This program is distributed in the hope that it will be useful, |
|
Line 12
|
Line 12
|
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
GNU General Public License for more details. |
| |
|
| You should have received a copy of the GNU General Public License | You should have received a copy of the GNU General Public License along |
| along with this program; if not, write to the Free Software | with this program; if not, write to the Free Software Foundation, Inc., |
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| */ |
*/ |
| |
|
| #ifndef MTR_MTR_H |
#ifndef MTR_MTR_H |
|
Line 23
|
Line 23
|
| #include "config.h" |
#include "config.h" |
| |
|
| #include <stdint.h> |
#include <stdint.h> |
| |
#include <netdb.h> |
| #include <sys/socket.h> |
#include <sys/socket.h> |
| #include <arpa/inet.h> |
#include <arpa/inet.h> |
| |
|
|
Line 32
|
Line 33
|
| |
|
| /* Typedefs */ |
/* Typedefs */ |
| #ifdef ENABLE_IPV6 |
#ifdef ENABLE_IPV6 |
| |
#define DEFAULT_AF AF_UNSPEC |
| typedef struct in6_addr ip_t; |
typedef struct in6_addr ip_t; |
| #else |
#else |
| |
#define DEFAULT_AF AF_INET |
| typedef struct in_addr ip_t; |
typedef struct in_addr ip_t; |
| #endif |
#endif |
| |
|
|
Line 61 typedef int time_t;
|
Line 64 typedef int time_t;
|
| |
|
| /* net related definitions */ |
/* net related definitions */ |
| #define SAVED_PINGS 200 |
#define SAVED_PINGS 200 |
| #define MAXPATH 8 | #define MAX_PATH 8 |
| #define MaxHost 256 |
#define MaxHost 256 |
| #define MinPort 1024 |
#define MinPort 1024 |
| #define MaxPort 65535 |
#define MaxPort 65535 |
|
Line 82 struct mtr_ctl {
|
Line 85 struct mtr_ctl {
|
| int MaxPing; |
int MaxPing; |
| float WaitTime; |
float WaitTime; |
| float GraceTime; |
float GraceTime; |
| char *Hostname; | const char *Hostname; |
| | char *InterfaceName; |
| char *InterfaceAddress; |
char *InterfaceAddress; |
| char LocalHostname[128]; |
char LocalHostname[128]; |
| int ipinfo_no; |
int ipinfo_no; |
|
Line 132 extern const struct fields data_fields[MAXFLD];
|
Line 136 extern const struct fields data_fields[MAXFLD];
|
| /* MPLS label object */ |
/* MPLS label object */ |
| struct mplslen { |
struct mplslen { |
| unsigned long label[MAXLABELS]; /* label value */ |
unsigned long label[MAXLABELS]; /* label value */ |
| uint8_t exp[MAXLABELS]; /* experimental bits */ | uint8_t tc[MAXLABELS]; /* Traffic Class bits */ |
| uint8_t ttl[MAXLABELS]; /* MPLS TTL */ |
uint8_t ttl[MAXLABELS]; /* MPLS TTL */ |
| char s[MAXLABELS]; /* bottom of stack */ |
char s[MAXLABELS]; /* bottom of stack */ |
| char labels; /* how many labels did we get? */ |
char labels; /* how many labels did we get? */ |
| }; |
}; |
| |
|
| |
|
| |
#ifdef USING_CYGWIN |
| |
#define running_as_root() 1 |
| |
#else |
| |
#define running_as_root() (getuid() == 0) |
| |
#endif |
| |
|
| |
int get_addrinfo_from_name( |
| |
struct mtr_ctl *ctl, |
| |
struct addrinfo **res, |
| |
const char *name); |
| |
|
| #endif /* MTR_MTR_H */ |
#endif /* MTR_MTR_H */ |