Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 366159 | Differences between
and this patch

Collapse All | Expand All

(-)hping3-20051105.orig//binding.c (-1 / +1 lines)
Lines 46-52 Link Here
46
	} else
46
	} else
47
		(*p)++;
47
		(*p)++;
48
	
48
	
49
	printf("\b\b\b\b\b\b\b\b\b");
49
	printf("\r");
50
	printf("%d: ", *p);
50
	printf("%d: ", *p);
51
	fflush(stdout);
51
	fflush(stdout);
52
52
(-)hping3-20051105.orig//globals.h (+2 lines)
Lines 110-115 Link Here
110
		opt_force_icmp,
110
		opt_force_icmp,
111
		icmp_ip_protocol,
111
		icmp_ip_protocol,
112
		icmp_cksum,
112
		icmp_cksum,
113
		ttl_count,
114
		sent_pkt_this_ttl,
113
		raw_ip_protocol;
115
		raw_ip_protocol;
114
116
115
extern unsigned char 	lsr[255],
117
extern unsigned char 	lsr[255],
(-)hping3-20051105.orig//hping2.h (+1 lines)
Lines 126-131 Link Here
126
#define DEFAULT_ICMP_IP_PROTOCOL	6 /* TCP */
126
#define DEFAULT_ICMP_IP_PROTOCOL	6 /* TCP */
127
#define DEFAULT_RAW_IP_PROTOCOL		6 /* TCP */
127
#define DEFAULT_RAW_IP_PROTOCOL		6 /* TCP */
128
#define DEFAULT_TRACEROUTE_TTL		1
128
#define DEFAULT_TRACEROUTE_TTL		1
129
#define DEFAULT_TTL_COUNT		-1	/* default packets-per-ttl count: -1 means forever */
129
130
130
#define BIND_NONE	0		/* no bind */
131
#define BIND_NONE	0		/* no bind */
131
#define BIND_DPORT	1		/* bind destination port */
132
#define BIND_DPORT	1		/* bind destination port */
(-)hping3-20051105.orig//main.c (+2 lines)
Lines 61-66 Link Here
61
	sent_pkt = 0,
61
	sent_pkt = 0,
62
	recv_pkt = 0,
62
	recv_pkt = 0,
63
	out_of_sequence_pkt = 0,
63
	out_of_sequence_pkt = 0,
64
	sent_pkt_this_ttl = 0,
64
	sending_wait = DEFAULT_SENDINGWAIT,	/* see DEFAULT_SENDINGWAIT */
65
	sending_wait = DEFAULT_SENDINGWAIT,	/* see DEFAULT_SENDINGWAIT */
65
	opt_rawipmode	= FALSE,
66
	opt_rawipmode	= FALSE,
66
	opt_icmpmode	= FALSE,
67
	opt_icmpmode	= FALSE,
Lines 129-134 Link Here
129
	icmp_ip_dstport	= DEFAULT_DPORT,
130
	icmp_ip_dstport	= DEFAULT_DPORT,
130
	opt_force_icmp  = FALSE,
131
	opt_force_icmp  = FALSE,
131
	icmp_cksum	= DEFAULT_ICMP_CKSUM,
132
	icmp_cksum	= DEFAULT_ICMP_CKSUM,
133
	ttl_count	= DEFAULT_TTL_COUNT,
132
	raw_ip_protocol	= DEFAULT_RAW_IP_PROTOCOL;
134
	raw_ip_protocol	= DEFAULT_RAW_IP_PROTOCOL;
133
135
134
char
136
char
(-)hping3-20051105.orig//parseoptions.c (-1 / +9 lines)
Lines 35-41 Link Here
35
	OPT_RAND_DEST, OPT_RAND_SOURCE, OPT_LSRR, OPT_SSRR, OPT_ROUTE_HELP,
35
	OPT_RAND_DEST, OPT_RAND_SOURCE, OPT_LSRR, OPT_SSRR, OPT_ROUTE_HELP,
36
	OPT_ICMP_IPSRC, OPT_ICMP_IPDST, OPT_ICMP_SRCPORT, OPT_ICMP_DSTPORT,
36
	OPT_ICMP_IPSRC, OPT_ICMP_IPDST, OPT_ICMP_SRCPORT, OPT_ICMP_DSTPORT,
37
	OPT_ICMP_GW, OPT_FORCE_ICMP, OPT_APD_SEND, OPT_SCAN, OPT_FASTER,
37
	OPT_ICMP_GW, OPT_FORCE_ICMP, OPT_APD_SEND, OPT_SCAN, OPT_FASTER,
38
	OPT_BEEP, OPT_FLOOD };
38
	OPT_BEEP, OPT_FLOOD, OPT_TTL_COUNT };
39
39
40
static struct ago_optlist hping_optlist[] = {
40
static struct ago_optlist hping_optlist[] = {
41
	{ 'c',	"count",	OPT_COUNT,		AGO_NEEDARG },
41
	{ 'c',	"count",	OPT_COUNT,		AGO_NEEDARG },
Lines 124-129 Link Here
124
	{ '\0', "force-icmp",	OPT_FORCE_ICMP,		AGO_NOARG },
124
	{ '\0', "force-icmp",	OPT_FORCE_ICMP,		AGO_NOARG },
125
	{ '\0', "beep",		OPT_BEEP,		AGO_NOARG },
125
	{ '\0', "beep",		OPT_BEEP,		AGO_NOARG },
126
	{ '\0', "flood",	OPT_FLOOD,		AGO_NOARG },
126
	{ '\0', "flood",	OPT_FLOOD,		AGO_NOARG },
127
	{ '\0', "tr-try-per-ttl", OPT_TTL_COUNT,	AGO_NEEDARG },
127
	AGO_LIST_TERM
128
	AGO_LIST_TERM
128
};
129
};
129
130
Lines 552-557 Link Here
552
		case OPT_FLOOD:
553
		case OPT_FLOOD:
553
			opt_flood = TRUE;
554
			opt_flood = TRUE;
554
			break;
555
			break;
556
		case OPT_TTL_COUNT:
557
			ttl_count = strtol(ago_optarg, NULL, 0);
558
			break;
555
		}
559
		}
556
	}
560
	}
557
561
Lines 628-633 Link Here
628
			"when the --rand-dest option is enabled\n");
632
			"when the --rand-dest option is enabled\n");
629
		exit(1);
633
		exit(1);
630
	}
634
	}
635
	else if (ttl_count <= 0 && ttl_count != -1) {
636
		printf("Option error: ttl_count must > 0\n");
637
		exit(1);
638
	}
631
639
632
	/* dependences */
640
	/* dependences */
633
	if (opt_safe == TRUE)
641
	if (opt_safe == TRUE)
(-)hping3-20051105.orig//send.c (+6 lines)
Lines 79-86 Link Here
79
	else			send_tcp();
79
	else			send_tcp();
80
80
81
	sent_pkt++;
81
	sent_pkt++;
82
	sent_pkt_this_ttl++;
82
	Signal(SIGALRM, send_packet);
83
	Signal(SIGALRM, send_packet);
83
84
85
	if (ttl_count != -1 && ttl_count <= sent_pkt_this_ttl && ctrlzbind == BIND_TTL) {
86
		sent_pkt_this_ttl = 0;
87
		kill(getpid(), SIGTSTP);
88
	}
89
84
	if (count != -1 && count == sent_pkt) { /* count reached? */
90
	if (count != -1 && count == sent_pkt) { /* count reached? */
85
		Signal(SIGALRM, print_statistics);
91
		Signal(SIGALRM, print_statistics);
86
		alarm(COUNTREACHED_TIMEOUT);
92
		alarm(COUNTREACHED_TIMEOUT);
(-)hping3-20051105.orig//usage.c (+1 lines)
Lines 100-105 Link Here
100
"  --tr-stop        Exit when receive the first not ICMP in traceroute mode\n"
100
"  --tr-stop        Exit when receive the first not ICMP in traceroute mode\n"
101
"  --tr-keep-ttl    Keep the source TTL fixed, useful to monitor just one hop\n"
101
"  --tr-keep-ttl    Keep the source TTL fixed, useful to monitor just one hop\n"
102
"  --tr-no-rtt	    Don't calculate/show RTT information in traceroute mode\n"
102
"  --tr-no-rtt	    Don't calculate/show RTT information in traceroute mode\n"
103
"  --tr-try-per-ttl Max tries at a given TTL value before auto-incrementing\n"
103
"ARS packet description (new, unstable)\n"
104
"ARS packet description (new, unstable)\n"
104
"  --apd-send       Send the packet described with APD (see docs/APD.txt)\n"
105
"  --apd-send       Send the packet described with APD (see docs/APD.txt)\n"
105
	);
106
	);
(-)hping3-20051105.orig//waitpacket.c (+3 lines)
Lines 124-130 Link Here
124
	}
124
	}
125
125
126
	if (match)
126
	if (match)
127
	{
127
		recv_pkt++;
128
		recv_pkt++;
129
		sent_pkt_this_ttl = 0;
130
	}
128
131
129
	/* Dump the packet in hex */
132
	/* Dump the packet in hex */
130
	if (opt_hexdump && match && !opt_quiet)
133
	if (opt_hexdump && match && !opt_quiet)

Return to bug 366159