/*****************************************************************************
 *
 * ESP engine definitions.
 * Copyright (C) 2001  Bart Trojanowski <bart@jukie.net>.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 *
 *****************************************************************************/
#ifndef PROTO_ESP_H
#define PROTO_ESP_H

#include <linux/config.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/in.h>		/* for in_addr */
#if defined ( CONFIG_IPV6 )
#include <linux/in.h>		/* for in6_addr */
#endif

typedef union {
#if defined ( CONFIG_IPV6 )
  struct in6_addr v6;
#endif
  struct in_addr v4;
} esp_ip_address;

struct proto_esp_context_definition {

  /* ESP specifics */
  enum {ENCAPSULATE,DECAPSULATE} operation;
  u32 spi_num;
  u32 sequence;

  enum { 
    SEQUENCE_OVERFLOW_NOTIFY = 1,
    ANTI_REPLAY_32BIT = 2,
    ANTI_REPLAY_64BIT = 4
  } flags;

  /* tunnel specifics */
  sa_family_t ip_ver;		/* PF_INET or PF_INET6 */
  esp_ip_address tun_src;
  esp_ip_address tun_dst;
  
  /* crypto op specifics */
  char * cipher_name;
  void * cipher_defn;

  char * digest_name;
  void * digest_defn;

  /* anyting else? */
};



#endif /* PROTO_ESP_H */

/*****************************************************************************
 *
 * $Log: proto-esp.h,v $
 * Revision 1.4  2001/09/10 15:43:43  bart
 * updated
 *
 * Revision 1.3  2001/06/16 19:56:35  bart
 * *** empty log message ***
 *
 * Revision 1.2  2001/06/04 02:10:44  bart
 * added direction fields (FORWARD/REVERSE)
 *
 * Revision 1.1  2001/05/26 17:26:06  bart
 * first cut of proto-esp-sw engine
 *
 *
 *****************************************************************************/

