]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/IpSec.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Protocol / IpSec.h
1 /** @file
2 EFI IPSEC Protocol Definition
3 The EFI_IPSEC_PROTOCOL is used to abstract the ability to deal with the individual
4 packets sent and received by the host and provide packet-level security for IP datagram.
5
6 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 @par Revision Reference:
16 This Protocol is introduced in UEFI Specification 2.3
17
18 **/
19
20 #ifndef __EFI_IPSEC_PROTOCOL_H__
21 #define __EFI_IPSEC_PROTOCOL_H__
22
23 #include <Protocol/IpSecConfig.h>
24
25 #define EFI_IPSEC_PROTOCOL_GUID \
26 { \
27 0xdfb386f7, 0xe100, 0x43ad, {0x9c, 0x9a, 0xed, 0x90, 0xd0, 0x8a, 0x5e, 0x12 } \
28 }
29
30 typedef struct _EFI_IPSEC_PROTOCOL EFI_IPSEC_PROTOCOL;
31
32 ///
33 /// EFI_IPSEC_FRAGMENT_DATA
34 /// defines the instances of packet fragments.
35 ///
36 typedef struct _EFI_IPSEC_FRAGMENT_DATA {
37 UINT32 FragmentLength;
38 VOID *FragmentBuffer;
39 } EFI_IPSEC_FRAGMENT_DATA;
40
41
42 /**
43 Handles IPsec packet processing for inbound and outbound IP packets.
44
45 The EFI_IPSEC_PROCESS process routine handles each inbound or outbound packet.
46 The behavior is that it can perform one of the following actions:
47 bypass the packet, discard the packet, or protect the packet.
48
49 @param[in] This Pointer to the EFI_IPSEC_PROTOCOL instance.
50 @param[in] NicHandle Instance of the network interface.
51 @param[in] IpVer IPV4 or IPV6.
52 @param[in, out] IpHead Pointer to the IP Header.
53 @param[in] LastHead The protocol of the next layer to be processed by IPsec.
54 @param[in] OptionsBuffer Pointer to the options buffer.
55 @param[in] OptionsLength Length of the options buffer.
56 @param[in, out] FragmentTable Pointer to a list of fragments.
57 @param[in] FragmentCount Number of fragments.
58 @param[in] TrafficDirection Traffic direction.
59 @param[out] RecycleSignal Event for recycling of resources.
60
61 @retval EFI_SUCCESS The packet was bypassed and all buffers remain the same.
62 @retval EFI_SUCCESS The packet was protected.
63 @retval EFI_ACCESS_DENIED The packet was discarded.
64
65 **/
66 typedef
67 EFI_STATUS
68 (EFIAPI *EFI_IPSEC_PROCESS)(
69 IN EFI_IPSEC_PROTOCOL *This,
70 IN EFI_HANDLE NicHandle,
71 IN UINT8 IpVer,
72 IN OUT VOID *IpHead,
73 IN UINT8 *LastHead,
74 IN VOID *OptionsBuffer,
75 IN UINT32 OptionsLength,
76 IN OUT EFI_IPSEC_FRAGMENT_DATA **FragmentTable,
77 IN UINT32 *FragmentCount,
78 IN EFI_IPSEC_TRAFFIC_DIR TrafficDirection,
79 OUT EFI_EVENT *RecycleSignal
80 );
81
82 ///
83 /// EFI_IPSEC_PROTOCOL
84 /// provides the ability for securing IP communications by authenticating
85 /// and/or encrypting each IP packet in a data stream.
86 // EFI_IPSEC_PROTOCOL can be consumed by both the IPv4 and IPv6 stack.
87 // A user can employ this protocol for IPsec package handling in both IPv4
88 // and IPv6 environment.
89 ///
90 struct _EFI_IPSEC_PROTOCOL {
91 EFI_IPSEC_PROCESS Process; ///< Handle the IPsec message.
92 EFI_EVENT DisabledEvent; ///< Event signaled when the interface is disabled.
93 BOOLEAN DisabledFlag; ///< State of the interface.
94 };
95
96 extern EFI_GUID gEfiIpSecProtocolGuid;
97
98 #endif