/*

TCP Testing Tool (ttt)

Main program.

Eloy Paris 

$Id: ttt.c,v 1.1.1.1 2003/04/28 23:00:20 peloy Exp $

*/

#include "includes.h"

char *program_name;

int main(int argc, char **argv)
{
	int forever;

	if ((program_name = strrchr(argv[0], '/')) )
		program_name++;
	else
		program_name = argv[0];

	srand(time(NULL) );

	process_options(argc, argv);

	/*
	 * options.count == 0 means we flood packets until the end of
	 * times.
	 */
	forever = options.count == 0;

	while (forever || options.count--) {
		if (send_segment() == -1)
			error(1, "send_segment()");

		if (options.delay)
			usleep(options.delay);
	}

	return 0;
}
