/************************************************************************/
/*	Routing Protocol Simulator	Relese 1.0	1994/3/17	*/
/*									*/
/*		module 	: common routine	      			*/
/*		file	: rps.h						*/
/*									*/
/*   Copyright (c) 1994 by Systems Development Laboratory Hitachi,Ltd.	*/
/*   All rights reserved.						*/
/*----------------------------------------------------------------------*/
/*	UPDATE HISTORY							*/
/*									*/
/************************************************************************/
#ifdef VXWORKS

#include "stdioLib.h"
#include "types.h"
#include "socket.h"
#include "sockLib.h"
#include "in.h"
#include "inetLib.h"
#include "netLib.h"
#include "memLib.h"

#else

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdlib.h>
/*#include <malloc.h>*/

#endif

#define 	INTF_DOWN	1
#define		INTF_UP		2

#define 	FALSE		0
#define		TRUE		1

#define 	OFF		0
#define 	ON		1

#define		NO_SEND		0
#define		SEND_OK		1

typedef		char	byte;

extern	int	used_memory;

#define MALLOC(ptr,type) \
  { \
      if((ptr = (struct type *)calloc(1,sizeof(struct type))) == NULL) { \
          printf("memory allocation error \n"); \
          return NULL; \
      }\
      else { \
	       used_memory += sizeof(struct type); \
	       bzero(ptr,sizeof(struct type)); \
      }\
  }










