/**
 * @file placement_types.h
 *
 * @brief Placement (types).
 *
 * Copyright 2007-2008, Freie Universitaet Berlin. All rights reserved.
 * Please refer to the COPYING file for detailed licensing information.
 *
 * @author Georg Wittenburg
 *
 * $Id: placement_types.h 2685 2008-06-25 16:38:56Z wittenbu $
 */

#ifndef PLACEMENT_TYPES_H
#define PLACEMENT_TYPES_H

#include "../types.h"



/**
 * @brief Node statistics.
 */
typedef struct {
	node_t		node;				///< Node to which these statistics belong.
	uint32_t	service_requests_count;		///< Number of service requests from this node.
	uint32_t	service_requests_traffic;	///< Traffic of service requests from this node in bytes.
	uint32_t	last_hop_count;			///< Number of service requests this node was the last routing hop for.
	uint32_t	last_hop_traffic;		///< Traffic of service requests this node was the last routing hop for in bytes.
	bool		refused_migration;		///< Flag whether this node has refused a migration in the past.
} PLACEMENT_node_stats_t;

/**
 * @brief Service placement data and statistics.
 */
typedef struct {
	bool		active;				///< Flag whether a placement algorithm is active.
	uint16_t	callback_id;			///< ID of the periodic callback.
	uint32_t	service_request_count;		///< Number of service requests (data, update or stream).
	uint32_t	service_request_traffic;	///< Traffic caused by these service requests in bytes.
	list_t*		node_stats;			///< List of node statistics for a service.
} PLACEMENT_data_t;



/*
 * Packet types.
 */



#endif	// PLACEMENT_TYPES_H
