#ifndef SIM_H
#define SIM_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>

/*Port to connect, we start in this port depending
  on the number of the node it'ss binf to a different
  portt. 1 -> 10001, 2 - > 10002, ...*/
#define PORT 10000
#define MAXLEN 255
#define MAXLINE 1024

	/*Waits and reads a packet assuming it is node "node"*/
	char *recPacketNode(int node);

	/*Send a packet to nodelist nodes*/
	int sndPacketNode(int *nodelist, int nnodes, char *packet, int plen);

	/*Stores ins list the neighbours of nnode, in the file filen*/
	int readNeighbours(int **list, int nnode, char *filen);

	void *__crealloc(void *ptr, size_t npos, size_t nmemb, size_t size);

#endif
