int ipinfo_no = -1;
int ipinfo_max = -1;
-int iihash = 0;
+static int iihash = 0;
char fmtinfo[32];
extern int af; /* address family of remote target */
int iiwidth_len = sizeof(iiwidth)/sizeof((iiwidth)[0]);
typedef char* items_t[ITEMSMAX + 1];
-items_t items_a; // without hash: items
-char txtrec[NAMELEN + 1]; // without hash: txtrec
-items_t* items = &items_a;
+static items_t items_a; // without hash: items
+static char txtrec[NAMELEN + 1]; // without hash: txtrec
+static items_t* items = &items_a;
static char *ipinfo_lookup(const char *domain) {
extern int ipinfo_no;
extern int ipinfo_max;
extern int iiwidth_len;
-extern int iihash;
extern void asn_open();
extern void asn_close();
extern char *fmt_ipinfo(ip_t *addr);
extern int af;
extern int mtrtype;
-static int __unused_int;
static void pwcenter(char *str)
{
int maxx;
int cx;
+ int __unused_int UNUSED;
getmaxyx(stdscr, __unused_int, maxx);
cx = (signed)(maxx - strlen(str)) / 2;
int i, j, k;
int hd_len;
char buf[1024];
+ int __unused_int UNUSED;
max = net_max();
#define NUM_FACTORS 8
static double factors[NUM_FACTORS];
static int scale[NUM_FACTORS];
-static int low_ms, high_ms;
static void mtr_gen_scale(void)
{
int *saved, i, max, at;
int range;
+ static int low_ms, high_ms;
low_ms = 1000000;
high_ms = -1;
int max, at, y;
ip_t * addr;
char* name;
+ int __unused_int UNUSED;
max = net_max();
int startstat;
int rowstat;
time_t t;
+ int __unused_int UNUSED;
int i, j;
int hd_len = 0;
int DisplayMode;
int display_mode;
int Interactive = 1;
-int PrintVersion = 0;
-int PrintHelp = 0;
int MaxPing = 10;
int ForceMaxPing = 0;
float WaitTime = 1.0;
switch(opt) {
case 'v':
- PrintVersion = 1;
+ printf ("mtr " PACKAGE_VERSION "\n");
+ exit(EXIT_SUCCESS);
break;
case 'h':
- PrintHelp = 1;
+ usage(stdout);
break;
case 'r':
error(EXIT_FAILURE, 0, "Couldn't determine raw socket type");
}
- if (PrintVersion) {
- printf ("mtr " PACKAGE_VERSION "\n");
- exit(EXIT_SUCCESS);
- }
-
- if (PrintHelp) {
- usage(stdout);
- }
-
time_t now = time(NULL);
if (!names) append_to_names ("localhost"); // default: localhost.
#include "net.h"
#include "dns.h"
-static int havename[MaxHost];
-
-extern int af;
#if 0
static char *addr_to_str(ip_t addr)
// Log an echo reply, or a "pong"
extern void raw_rawping (int host, int msec, int seq)
{
+ static int havename[MaxHost];
char *name;
if (dns && !havename[host]) {