#ifndef CORE_MESSAGE_H
#define CORE_MESSAGE_H


#include <stdlib.h>
#include "base/dblock.h"
#include "base/itag.h"

typedef struct Message {
//identify what type of message this is
	int MessageType;
//identity info (so we can know what to do with the message (route/reply/reject/drop/fold/spindle/mutilate))
	//todo: workout better identifying elements
	ITag msgitag;
	ITag fromitag;//PipeFace *from;
//data
	DataBlock *body;
} Message;

#include "pipeface/pipeface.h" //leave this after the struct Message


//Message types.
#define MSGT_UNKNOWN 0
#define MSGT_RAW 100		//primitve raw proxy


#define BLANKMESSAGE {MSGT_UNKNOWN, 0, 0, NULL}


void messageFree(Message *msg);
Message *messageMake(void);
Message *messageClone(Message *msg);


#endif //CORE_MESSAGE_H
