Sync usage with man page.
[netbsd-mini2440.git] / sys / dev / pci / n8 / common / api / n8_packet_IPSec.h
blob34cfc86c71eb350e2e3112ff4facdc2554d8b23a
1 /*-
2 * Copyright (C) 2001-2003 by NBMK Encryption Technologies.
3 * All rights reserved.
5 * NBMK Encryption Technologies provides no support of any kind for
6 * this software. Questions or concerns about it may be addressed to
7 * the members of the relevant open-source community at
8 * <tech-crypto@netbsd.org>.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are
12 * met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above
18 * copyright notice, this list of conditions and the following
19 * disclaimer in the documentation and/or other materials provided
20 * with the distribution.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 /*****************************************************************************
36 * @(#) n8_packet_IPSec.h 1.14@(#)
37 *****************************************************************************/
39 /*****************************************************************************/
40 /** @file n8_packet_IPSec.h
41 * @brief Header for IPSec Packet functions.
44 *****************************************************************************/
46 /*****************************************************************************
47 * Revision history:
48 * 06/06/03 brr Move useful defines to public include.
49 * 04/19/02 bac Corrected IPSEC_DATA_LENGTH_MIN and
50 * IPSEC_DECRYPTED_DATA_LENGTH_MIN values. Created a new define
51 * IPSEC_DATA_BLOCK_SIZE. Fixes BUG #716.
52 * 10/12/01 dkm Moved public portion to n8_pub_packet.h.
53 * 08/27/01 mel Deleted IPSEC_SET.. definisions - they are not in use.
54 * 06/25/01 bac Added IPSEC_AUTHENTICATION_DATA_LENGTH
55 * 05/23/01 bac Original version.
56 ****************************************************************************/
57 #ifndef N8_PACKET_IPSEC_H
58 #define N8_PACKET_IPSEC_H
60 #include "n8_packet.h"
61 #include "n8_pub_packet.h"
62 #include "n8_pub_errors.h"
64 #define IPSEC_DATA_BLOCK_SIZE 8
65 #define IPSEC_DECRYPTED_DATA_LENGTH_MIN 36
66 #define IPSEC_AUTHENTICATION_DATA_LENGTH 12
68 #define IPSEC_SPI_OFFSET 0
69 #define IPSEC_SEQUENCE_NIMBER_OFFSET 4
71 #define IPSEC_EXTRACT_SPI(PACKET_P) ((uint32_t) BE_to_uint32(&PACKET_P[IPSEC_SPI_OFFSET]))
72 #define IPSEC_EXTRACT_SEQUENCE_NIMBER(PACKET_P) ((uint32_t) BE_to_uint32(&PACKET_P[IPSEC_SEQUENCE_NIMBER_OFFSET]))
74 #endif