/*
#  This is version 0.3 of absent
#
#               Copyright (c) 1999 by AT&T.
#  Permission to use, copy, and modify this software without fee is
#  hereby granted, provided that this entire notice is included in all
#  copies of any software which is or includes a copy or modification
#  of this software and in all copies of the supporting documentation
#  for such software.
#
#  SOME PARTS OF ABSENT MAY BE RESTRICTED UNDER UNITED STATES EXPORT
#  REGULATIONS.
#
#  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
#  IMPLIED WARRANTY.  IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE
#  ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
#  MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
#  PURPOSE.
*/


#ifndef _ABSENT_H
#define _ABSENT_H

/* global.h is misnamed.  it contains globals for the RFC MD5 implementation */
#include "global.h"
#include "md5.h"

/* we need these because there's a sockaddr in the control messages */
#include <sys/types.h>
#include <sys/socket.h>

extern int errno;

#define CONTROL_PORT 4431
#define DATA_PORT 4430
#define PUSHWEB_PORT 4500

#define MAXCONN 256


/* some size-related constants.  this is mostly internal network
   stuff, so be wary of changing it. */
#define ABSENT_SSLPMAX     32767    /* largest ssl packet (not really.) */

/* control messages */
typedef struct {
  enum {ABSENT_HELO,ABSENT_COPEN,ABSENT_PING,ABSENT_PONG,ABSENT_COPEN_R} msg;
  long id;
  int tstamp;
  struct sockaddr sa_client;
  char mac[16];
} absent_cmsg;

#ifndef C_Block
/* normally, this would be defined for us by libdes, but we don't HAVE
   libdes anymore */
typedef unsigned char absent_cblock[8];
#define C_Block absent_cblock
#endif /* C_Block */
#endif /* _ABSENT_H */

