/*
Copyright (c) 2000                      RIPE NCC


All Rights Reserved

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of the author not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.

THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

/*
-------------------------------------------------------------------------------
Module Header
Filename          : TestBoxConfig.h
Author            : Rene Wilhelm
Date              : 17-OCT-2000
Description       : Implementation of TestBoxConfig class
Language Version  : C++
OSs Tested        : Solaris 2.6

This class provides an interface between analysis software and the
configuration of the TTM network. All relevant parameters for a box
are stored in a TestBox structure. The constructor of the TestBoxConfig
class executes a specified command to retrieve configuration and
stores the result in a (private) list of TestBox structs.

$Id: TestBoxConfig.h,v 1.4 2001/06/18 17:13:01 wilhelm Exp $
-------------------------------------------------------------------------------
*/


#ifndef TestBoxConfig_included
#define TestBoxConfig_included

#include <sys/types.h>

typedef struct TestBox {
	char *name;	            // Box's name as returned by hostname
	uint id;		    // numeric id used in measurements
	TestBox **targetlist;       // List of targets associated with the box
	int number_of_targets;	    // number of targets in list.
};

// TestBoxConfig class - interface to TTM network configuration info

class TestBoxConfig {
private:
	int number_of_boxes;
	int list_size;
	TestBox *tblist;
public:
	int NumEntries() {return number_of_boxes;}
	TestBox *TBList()    {return tblist;}
	TestBoxConfig(const char* command);
	TestBox *GetBoxById(uint id);	       // return struct for given id
//	TestBox *GetBoxByName(char *name);     // return struct for given name
	TestBox **GetTargets(TestBox *source); // find active targes for given id
};

#endif
