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

#ifndef SERVICE_REPLICATION_H
#define SERVICE_REPLICATION_H

#include "../types.h"
#include "service_types.h"

void handle_SERVICE_REPLICATION_REQUEST(const packet_header_t* header, const SERVICE_REPLICATION_REQUEST_packet_t* request);
void handle_SERVICE_REPLICATION_DATA(const packet_header_t* header, const SERVICE_REPLICATION_DATA_packet_t* data_header, const char* segment_data, size_t segment_size);
void handle_SERVICE_REPLICATION_ACK(const packet_header_t* header, const SERVICE_REPLICATION_ACK_packet_t* ack);
void handle_SERVICE_REPLICATION_NACK(const packet_header_t* header, const SERVICE_REPLICATION_NACK_packet_t* nack);
void replicate_service(SERVICE_service_t* service_id, C_addr_t to, callback_function_t callback, SERVICE_replication_result_t* result);
void migrate_service(SERVICE_service_t* service_id, C_addr_t to, callback_function_t callback, SERVICE_migration_result_t* result);

#endif	// SERVICE_REPLICATION_H
