/* $Id: defs.h,v 1.1 1999/08/23 16:18:29 naamato Exp $ */
/*
 * Copyright(c) 1998 by Hitachi.Ltd All rights reserved.
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <syslog.h>

#define IPHDR_LEN 20

#define UP 1
#define DOWN 0

extern int debug;
extern char ipstr1[];    /* in inet.c */
extern char ipstr2[];    /* in inet.c */
extern char ipstr3[];    /* in inet.c */
extern char ipstr4[];    /* in inet.c */

#define IS_DEBUG(type)  (debug & type)

typedef char byte;
#define INTF_DOWN 1
#define INTF_UP 2
#define ON 1
#define OFF 0

#define DEBUG_TRACE  0x01
#define DEBUG_PACKET 0x02
#define DEBUG_TIMER  0x04

#define TRACE_MODE_NONE   0
#define TRACE_MODE_PKT    1
#define TRACE_MODE_DETAIL 2

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

