MdePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/** @file
|
||||
EFI IPsec Configuration Protocol Definition
|
||||
The EFI_IPSEC_CONFIG_PROTOCOL provides the mechanism to set and retrieve security and
|
||||
The EFI_IPSEC_CONFIG_PROTOCOL provides the mechanism to set and retrieve security and
|
||||
policy related information for the EFI IPsec protocol driver.
|
||||
|
||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -12,7 +12,7 @@
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
@par Revision Reference:
|
||||
@par Revision Reference:
|
||||
This Protocol is introduced in UEFI Specification 2.2
|
||||
|
||||
**/
|
||||
@@ -32,34 +32,34 @@ typedef struct _EFI_IPSEC_CONFIG_PROTOCOL EFI_IPSEC_CONFIG_PROTOCOL;
|
||||
/// EFI_IPSEC_CONFIG_DATA_TYPE
|
||||
///
|
||||
typedef enum {
|
||||
///
|
||||
/// The IPsec Security Policy Database (aka SPD) setting. In IPsec,
|
||||
/// an essential element of Security Association (SA) processing is
|
||||
/// underlying SPD that specifies what services are to be offered to
|
||||
/// IP datagram and in what fashion. The SPD must be consulted
|
||||
/// during the processing of all traffic (inbound and outbound),
|
||||
/// including traffic not protected by IPsec, that traverses the IPsec
|
||||
/// boundary. With this DataType, SetData() function is to set
|
||||
/// the SPD entry information, which may add one new entry, delete
|
||||
/// one existed entry or flush the whole database according to the
|
||||
/// parameter values. The corresponding Data is of type
|
||||
///
|
||||
/// The IPsec Security Policy Database (aka SPD) setting. In IPsec,
|
||||
/// an essential element of Security Association (SA) processing is
|
||||
/// underlying SPD that specifies what services are to be offered to
|
||||
/// IP datagram and in what fashion. The SPD must be consulted
|
||||
/// during the processing of all traffic (inbound and outbound),
|
||||
/// including traffic not protected by IPsec, that traverses the IPsec
|
||||
/// boundary. With this DataType, SetData() function is to set
|
||||
/// the SPD entry information, which may add one new entry, delete
|
||||
/// one existed entry or flush the whole database according to the
|
||||
/// parameter values. The corresponding Data is of type
|
||||
/// EFI_IPSEC_SPD_DATA
|
||||
///
|
||||
///
|
||||
IPsecConfigDataTypeSpd,
|
||||
///
|
||||
/// The IPsec Security Association Database (aka SAD) setting. A
|
||||
/// SA is a simplex connection that affords security services to the
|
||||
/// traffic carried by it. Security services are afforded to an SA by the
|
||||
/// use of AH, or ESP, but not both. The corresponding Data is of
|
||||
///
|
||||
/// The IPsec Security Association Database (aka SAD) setting. A
|
||||
/// SA is a simplex connection that affords security services to the
|
||||
/// traffic carried by it. Security services are afforded to an SA by the
|
||||
/// use of AH, or ESP, but not both. The corresponding Data is of
|
||||
/// type EFI_IPSEC_SAD_DATA.
|
||||
///
|
||||
///
|
||||
IPsecConfigDataTypeSad,
|
||||
///
|
||||
/// The IPsec Peer Authorization Database (aka PAD) setting, which
|
||||
/// provides the link between the SPD and a security association
|
||||
/// management protocol. The PAD entry specifies the
|
||||
/// authentication protocol (e.g. IKEv1, IKEv2) method used and the
|
||||
/// authentication data. The corresponding Data is of type
|
||||
///
|
||||
/// The IPsec Peer Authorization Database (aka PAD) setting, which
|
||||
/// provides the link between the SPD and a security association
|
||||
/// management protocol. The PAD entry specifies the
|
||||
/// authentication protocol (e.g. IKEv1, IKEv2) method used and the
|
||||
/// authentication data. The corresponding Data is of type
|
||||
/// EFI_IPSEC_PAD_DATA.
|
||||
///
|
||||
IPsecConfigDataTypePad,
|
||||
@@ -79,70 +79,70 @@ typedef struct _EFI_IP_ADDRESS_INFO {
|
||||
/// EFI_IPSEC_SPD_SELECTOR
|
||||
///
|
||||
typedef struct _EFI_IPSEC_SPD_SELECTOR {
|
||||
///
|
||||
///
|
||||
/// Specifies the actual number of entries in LocalAddress.
|
||||
///
|
||||
///
|
||||
UINT32 LocalAddressCount;
|
||||
///
|
||||
/// A list of ranges of IPv4 or IPv6 addresses, which refers to the
|
||||
///
|
||||
/// A list of ranges of IPv4 or IPv6 addresses, which refers to the
|
||||
/// addresses being protected by IPsec policy.
|
||||
///
|
||||
///
|
||||
EFI_IP_ADDRESS_INFO *LocalAddress;
|
||||
///
|
||||
///
|
||||
/// Specifies the actual number of entries in RemoteAddress.
|
||||
///
|
||||
///
|
||||
UINT32 RemoteAddressCount;
|
||||
///
|
||||
/// A list of ranges of IPv4 or IPv6 addresses, which are peer entities
|
||||
/// to LocalAddress.
|
||||
///
|
||||
///
|
||||
/// A list of ranges of IPv4 or IPv6 addresses, which are peer entities
|
||||
/// to LocalAddress.
|
||||
///
|
||||
EFI_IP_ADDRESS_INFO *RemoteAddress;
|
||||
///
|
||||
/// Next layer protocol. Obtained from the IPv4 Protocol or the IPv6
|
||||
/// Next Header fields. The next layer protocol is whatever comes
|
||||
/// after any IP extension headers that are present. A zero value is a
|
||||
///
|
||||
/// Next layer protocol. Obtained from the IPv4 Protocol or the IPv6
|
||||
/// Next Header fields. The next layer protocol is whatever comes
|
||||
/// after any IP extension headers that are present. A zero value is a
|
||||
/// wildcard that matches any value in NextLayerProtocol field.
|
||||
///
|
||||
UINT16 NextLayerProtocol;
|
||||
///
|
||||
/// Local Port if the Next Layer Protocol uses two ports (as do TCP,
|
||||
/// UDP, and others). A zero value is a wildcard that matches any
|
||||
///
|
||||
UINT16 NextLayerProtocol;
|
||||
///
|
||||
/// Local Port if the Next Layer Protocol uses two ports (as do TCP,
|
||||
/// UDP, and others). A zero value is a wildcard that matches any
|
||||
/// value in LocalPort field.
|
||||
///
|
||||
///
|
||||
UINT16 LocalPort;
|
||||
///
|
||||
/// A designed port range size. The start port is LocalPort, and
|
||||
/// the total number of ports is described by LocalPortRange.
|
||||
/// This field is ignored if NextLayerProtocol does not use
|
||||
/// ports.
|
||||
///
|
||||
///
|
||||
/// A designed port range size. The start port is LocalPort, and
|
||||
/// the total number of ports is described by LocalPortRange.
|
||||
/// This field is ignored if NextLayerProtocol does not use
|
||||
/// ports.
|
||||
///
|
||||
UINT16 LocalPortRange;
|
||||
///
|
||||
/// Remote Port if the Next Layer Protocol uses two ports. A zero
|
||||
///
|
||||
/// Remote Port if the Next Layer Protocol uses two ports. A zero
|
||||
/// value is a wildcard that matches any value in RemotePort field.
|
||||
///
|
||||
///
|
||||
UINT16 RemotePort;
|
||||
///
|
||||
/// A designed port range size. The start port is RemotePort, and
|
||||
/// the total number of ports is described by RemotePortRange.
|
||||
///
|
||||
/// A designed port range size. The start port is RemotePort, and
|
||||
/// the total number of ports is described by RemotePortRange.
|
||||
/// This field is ignored if NextLayerProtocol does not use ports.
|
||||
///
|
||||
///
|
||||
UINT16 RemotePortRange;
|
||||
} EFI_IPSEC_SPD_SELECTOR;
|
||||
|
||||
|
||||
///
|
||||
/// EFI_IPSEC_TRAFFIC_DIR
|
||||
/// represents the directionality in an SPD entry.
|
||||
///
|
||||
typedef enum {
|
||||
///
|
||||
/// The EfiIPsecInBound refers to traffic entering an IPsec implementation via
|
||||
/// The EfiIPsecInBound refers to traffic entering an IPsec implementation via
|
||||
/// the unprotected interface or emitted by the implementation on the unprotected
|
||||
/// side of the boundary and directed towards the protected interface.
|
||||
/// side of the boundary and directed towards the protected interface.
|
||||
///
|
||||
EfiIPsecInBound,
|
||||
///
|
||||
/// The EfiIPsecOutBound refers to traffic entering the implementation via
|
||||
/// The EfiIPsecOutBound refers to traffic entering the implementation via
|
||||
/// the protected interface, or emitted by the implementation on the protected side
|
||||
/// of the boundary and directed toward the unprotected interface.
|
||||
///
|
||||
@@ -154,54 +154,54 @@ typedef enum {
|
||||
/// represents three possible processing choices.
|
||||
///
|
||||
typedef enum {
|
||||
///
|
||||
///
|
||||
/// Refers to traffic that is not allowed to traverse the IPsec boundary.
|
||||
///
|
||||
///
|
||||
EfiIPsecActionDiscard,
|
||||
///
|
||||
/// Refers to traffic that is allowed to cross the IPsec boundary
|
||||
///
|
||||
/// Refers to traffic that is allowed to cross the IPsec boundary
|
||||
/// without protection.
|
||||
///
|
||||
///
|
||||
EfiIPsecActionBypass,
|
||||
///
|
||||
/// Refers to traffic that is afforded IPsec protection, and for such
|
||||
/// traffic the SPD must specify the security protocols to be
|
||||
/// employed, their mode, security service options, and the
|
||||
/// cryptographic algorithms to be used.
|
||||
///
|
||||
/// Refers to traffic that is afforded IPsec protection, and for such
|
||||
/// traffic the SPD must specify the security protocols to be
|
||||
/// employed, their mode, security service options, and the
|
||||
/// cryptographic algorithms to be used.
|
||||
///
|
||||
EfiIPsecActionProtect
|
||||
} EFI_IPSEC_ACTION;
|
||||
|
||||
///
|
||||
/// EFI_IPSEC_SA_LIFETIME
|
||||
/// defines the lifetime of an SA, which represents when a SA must be
|
||||
/// replaced or terminated. A value of all 0 for each field removes
|
||||
/// defines the lifetime of an SA, which represents when a SA must be
|
||||
/// replaced or terminated. A value of all 0 for each field removes
|
||||
/// the limitation of a SA lifetime.
|
||||
///
|
||||
typedef struct _EFI_IPSEC_SA_LIFETIME {
|
||||
///
|
||||
///
|
||||
/// The number of bytes to which the IPsec cryptographic algorithm
|
||||
/// can be applied. For ESP, this is the encryption algorithm and for
|
||||
/// AH, this is the authentication algorithm. The ByteCount
|
||||
/// AH, this is the authentication algorithm. The ByteCount
|
||||
/// includes pad bytes for cryptographic operations.
|
||||
///
|
||||
///
|
||||
UINT64 ByteCount;
|
||||
///
|
||||
/// A time interval in second that warns the implementation to
|
||||
///
|
||||
/// A time interval in second that warns the implementation to
|
||||
/// initiate action such as setting up a replacement SA.
|
||||
///
|
||||
///
|
||||
UINT64 SoftLifetime;
|
||||
///
|
||||
/// A time interval in second when the current SA ends and is
|
||||
///
|
||||
/// A time interval in second when the current SA ends and is
|
||||
/// destroyed.
|
||||
///
|
||||
///
|
||||
UINT64 HardLifetime;
|
||||
} EFI_IPSEC_SA_LIFETIME;
|
||||
|
||||
///
|
||||
/// EFI_IPSEC_MODE
|
||||
/// There are two modes of IPsec operation: transport mode and tunnel mode. In
|
||||
/// EfiIPsecTransport mode, AH and ESP provide protection primarily for next layer protocols;
|
||||
/// There are two modes of IPsec operation: transport mode and tunnel mode. In
|
||||
/// EfiIPsecTransport mode, AH and ESP provide protection primarily for next layer protocols;
|
||||
/// In EfiIPsecTunnel mode, AH and ESP are applied to tunneled IP packets.
|
||||
///
|
||||
typedef enum {
|
||||
@@ -226,19 +226,19 @@ typedef enum {
|
||||
/// EFI_IPSEC_TUNNEL_OPTION
|
||||
///
|
||||
typedef struct _EFI_IPSEC_TUNNEL_OPTION {
|
||||
///
|
||||
///
|
||||
/// Local tunnel address when IPsec mode is EfiIPsecTunnel.
|
||||
///
|
||||
///
|
||||
EFI_IP_ADDRESS LocalTunnelAddress;
|
||||
///
|
||||
///
|
||||
/// Remote tunnel address when IPsec mode is EfiIPsecTunnel.
|
||||
///
|
||||
///
|
||||
EFI_IP_ADDRESS RemoteTunnelAddress;
|
||||
///
|
||||
///
|
||||
/// The option of copying the DF bit from an outbound package
|
||||
/// to the tunnel mode header that it emits, when traffic is
|
||||
/// carried via a tunnel mode SA.
|
||||
///
|
||||
/// to the tunnel mode header that it emits, when traffic is
|
||||
/// carried via a tunnel mode SA.
|
||||
///
|
||||
EFI_IPSEC_TUNNEL_DF_OPTION DF;
|
||||
} EFI_IPSEC_TUNNEL_OPTION;
|
||||
|
||||
@@ -247,7 +247,7 @@ typedef struct _EFI_IPSEC_TUNNEL_OPTION {
|
||||
///
|
||||
typedef enum {
|
||||
EfiIPsecAH, ///< IP Authentication Header protocol which is specified in RFC 4302.
|
||||
EfiIPsecESP ///< IP Encapsulating Security Payload which is specified in RFC 4303.
|
||||
EfiIPsecESP ///< IP Encapsulating Security Payload which is specified in RFC 4303.
|
||||
} EFI_IPSEC_PROTOCOL_TYPE;
|
||||
|
||||
///
|
||||
@@ -255,48 +255,48 @@ typedef enum {
|
||||
/// describes a policy list for traffic processing.
|
||||
///
|
||||
typedef struct _EFI_IPSEC_PROCESS_POLICY {
|
||||
///
|
||||
/// Extended Sequence Number. Is this SA using extended sequence
|
||||
///
|
||||
/// Extended Sequence Number. Is this SA using extended sequence
|
||||
/// numbers. 64 bit counter is used if TRUE.
|
||||
///
|
||||
///
|
||||
BOOLEAN ExtSeqNum;
|
||||
///
|
||||
/// A flag indicating whether overflow of the sequence number
|
||||
/// counter should generate an auditable event and prevent
|
||||
/// transmission of additional packets on the SA, or whether rollover
|
||||
///
|
||||
/// A flag indicating whether overflow of the sequence number
|
||||
/// counter should generate an auditable event and prevent
|
||||
/// transmission of additional packets on the SA, or whether rollover
|
||||
/// is permitted.
|
||||
///
|
||||
///
|
||||
BOOLEAN SeqOverflow;
|
||||
///
|
||||
/// Is this SA using stateful fragment checking. TRUE represents
|
||||
///
|
||||
/// Is this SA using stateful fragment checking. TRUE represents
|
||||
/// stateful fragment checking.
|
||||
///
|
||||
///
|
||||
BOOLEAN FragCheck;
|
||||
///
|
||||
/// A time interval after which a SA must be replaced with a new SA
|
||||
/// (and new SPI) or terminated.
|
||||
///
|
||||
///
|
||||
/// A time interval after which a SA must be replaced with a new SA
|
||||
/// (and new SPI) or terminated.
|
||||
///
|
||||
EFI_IPSEC_SA_LIFETIME SaLifetime;
|
||||
///
|
||||
///
|
||||
/// IPsec mode: tunnel or transport.
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_MODE Mode;
|
||||
///
|
||||
///
|
||||
/// Tunnel Option. TunnelOption is ignored if Mode is EfiIPsecTransport.
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_TUNNEL_OPTION *TunnelOption;
|
||||
///
|
||||
///
|
||||
/// IPsec protocol: AH or ESP
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_PROTOCOL_TYPE Proto;
|
||||
///
|
||||
///
|
||||
/// Cryptographic algorithm type used for authentication.
|
||||
///
|
||||
///
|
||||
UINT8 AuthAlgoId;
|
||||
///
|
||||
/// Cryptographic algorithm type used for encryption. EncAlgo is
|
||||
/// NULL when IPsec protocol is AH. For ESP protocol, EncAlgo
|
||||
/// can also be used to describe the algorithm if a combined mode
|
||||
///
|
||||
/// Cryptographic algorithm type used for encryption. EncAlgo is
|
||||
/// NULL when IPsec protocol is AH. For ESP protocol, EncAlgo
|
||||
/// can also be used to describe the algorithm if a combined mode
|
||||
/// algorithm is used.
|
||||
///
|
||||
UINT8 EncAlgoId;
|
||||
@@ -307,19 +307,19 @@ typedef struct _EFI_IPSEC_PROCESS_POLICY {
|
||||
/// A triplet to identify an SA, consisting of the following members.
|
||||
///
|
||||
typedef struct _EFI_IPSEC_SA_ID {
|
||||
///
|
||||
/// Security Parameter Index (aka SPI). An arbitrary 32-bit value
|
||||
/// that is used by a receiver to identity the SA to which an incoming
|
||||
///
|
||||
/// Security Parameter Index (aka SPI). An arbitrary 32-bit value
|
||||
/// that is used by a receiver to identity the SA to which an incoming
|
||||
/// package should be bound.
|
||||
///
|
||||
///
|
||||
UINT32 Spi;
|
||||
///
|
||||
///
|
||||
/// IPsec protocol: AH or ESP
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_PROTOCOL_TYPE Proto;
|
||||
///
|
||||
/// Destination IP address.
|
||||
///
|
||||
///
|
||||
/// Destination IP address.
|
||||
///
|
||||
EFI_IP_ADDRESS DestAddress;
|
||||
} EFI_IPSEC_SA_ID;
|
||||
|
||||
@@ -330,48 +330,48 @@ typedef struct _EFI_IPSEC_SA_ID {
|
||||
/// EFI_IPSEC_SPD_DATA
|
||||
///
|
||||
typedef struct _EFI_IPSEC_SPD_DATA {
|
||||
///
|
||||
/// A null-terminated ASCII name string which is used as a symbolic
|
||||
///
|
||||
/// A null-terminated ASCII name string which is used as a symbolic
|
||||
/// identifier for an IPsec Local or Remote address.
|
||||
///
|
||||
///
|
||||
UINT8 Name[MAX_PEERID_LEN];
|
||||
///
|
||||
/// Bit-mapped list describing Populate from Packet flags. When
|
||||
/// creating a SA, if PackageFlag bit is set to TRUE, instantiate
|
||||
/// the selector from the corresponding field in the package that
|
||||
/// triggered the creation of the SA, else from the value(s) in the
|
||||
/// corresponding SPD entry. The PackageFlag bit setting for
|
||||
///
|
||||
/// Bit-mapped list describing Populate from Packet flags. When
|
||||
/// creating a SA, if PackageFlag bit is set to TRUE, instantiate
|
||||
/// the selector from the corresponding field in the package that
|
||||
/// triggered the creation of the SA, else from the value(s) in the
|
||||
/// corresponding SPD entry. The PackageFlag bit setting for
|
||||
/// corresponding selector field of EFI_IPSEC_SPD_SELECTOR:
|
||||
/// Bit 0: EFI_IPSEC_SPD_SELECTOR.LocalAddress
|
||||
/// Bit 1: EFI_IPSEC_SPD_SELECTOR.RemoteAddress
|
||||
/// Bit 2:
|
||||
/// EFI_IPSEC_SPD_SELECTOR.NextLayerProtocol
|
||||
/// Bit 3: EFI_IPSEC_SPD_SELECTOR.LocalPort
|
||||
/// Bit 4: EFI_IPSEC_SPD_SELECTOR.RemotePort
|
||||
/// Bit 0: EFI_IPSEC_SPD_SELECTOR.LocalAddress
|
||||
/// Bit 1: EFI_IPSEC_SPD_SELECTOR.RemoteAddress
|
||||
/// Bit 2:
|
||||
/// EFI_IPSEC_SPD_SELECTOR.NextLayerProtocol
|
||||
/// Bit 3: EFI_IPSEC_SPD_SELECTOR.LocalPort
|
||||
/// Bit 4: EFI_IPSEC_SPD_SELECTOR.RemotePort
|
||||
/// Others: Reserved.
|
||||
///
|
||||
UINT32 PackageFlag;
|
||||
///
|
||||
///
|
||||
/// The traffic direction of data gram.
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_TRAFFIC_DIR TrafficDirection;
|
||||
///
|
||||
/// Processing choices to indicate which action is required by this
|
||||
/// policy.
|
||||
///
|
||||
///
|
||||
/// Processing choices to indicate which action is required by this
|
||||
/// policy.
|
||||
///
|
||||
EFI_IPSEC_ACTION Action;
|
||||
///
|
||||
///
|
||||
/// The policy and rule information for a SPD entry.
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_PROCESS_POLICY *ProcessingPolicy;
|
||||
///
|
||||
///
|
||||
/// Specifies the actual number of entries in SaId list.
|
||||
///
|
||||
///
|
||||
UINTN SaIdCount;
|
||||
///
|
||||
/// The SAD entry used for the traffic processing. The
|
||||
///
|
||||
/// The SAD entry used for the traffic processing. The
|
||||
/// existed SAD entry links indicate this is the manual key case.
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_SA_ID SaId[1];
|
||||
} EFI_IPSEC_SPD_DATA;
|
||||
|
||||
@@ -389,9 +389,9 @@ typedef struct _EFI_IPSEC_AH_ALGO_INFO {
|
||||
///
|
||||
/// EFI_IPSEC_ESP_ALGO_INFO
|
||||
/// The security algorithm selection for IPsec ESP encryption and authentication.
|
||||
/// The required authentication algorithm is specified in RFC 4305.
|
||||
/// EncAlgoId fields can also specify an ESP combined mode algorithm
|
||||
/// (e.g. AES with CCM mode, specified in RFC 4309), which provides both
|
||||
/// The required authentication algorithm is specified in RFC 4305.
|
||||
/// EncAlgoId fields can also specify an ESP combined mode algorithm
|
||||
/// (e.g. AES with CCM mode, specified in RFC 4309), which provides both
|
||||
/// confidentiality and authentication services.
|
||||
///
|
||||
typedef struct _EFI_IPSEC_ESP_ALGO_INFO {
|
||||
@@ -415,40 +415,40 @@ typedef union {
|
||||
/// EFI_IPSEC_SA_DATA
|
||||
///
|
||||
typedef struct _EFI_IPSEC_SA_DATA {
|
||||
///
|
||||
///
|
||||
/// IPsec mode: tunnel or transport.
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_MODE Mode;
|
||||
///
|
||||
/// Sequence Number Counter. A 64-bit counter used to generate the
|
||||
///
|
||||
/// Sequence Number Counter. A 64-bit counter used to generate the
|
||||
/// sequence number field in AH or ESP headers.
|
||||
///
|
||||
///
|
||||
UINT64 SNCount;
|
||||
///
|
||||
/// Anti-Replay Window. A 64-bit counter and a bit-map used to
|
||||
///
|
||||
/// Anti-Replay Window. A 64-bit counter and a bit-map used to
|
||||
/// determine whether an inbound AH or ESP packet is a replay.
|
||||
///
|
||||
///
|
||||
UINT8 AntiReplayWindows;
|
||||
///
|
||||
/// AH/ESP cryptographic algorithm, key and parameters.
|
||||
///
|
||||
///
|
||||
/// AH/ESP cryptographic algorithm, key and parameters.
|
||||
///
|
||||
EFI_IPSEC_ALGO_INFO AlgoInfo;
|
||||
///
|
||||
/// Lifetime of this SA.
|
||||
///
|
||||
///
|
||||
/// Lifetime of this SA.
|
||||
///
|
||||
EFI_IPSEC_SA_LIFETIME SaLifetime;
|
||||
///
|
||||
/// Any observed path MTU and aging variables. The Path MTU
|
||||
///
|
||||
/// Any observed path MTU and aging variables. The Path MTU
|
||||
/// processing is defined in section 8 of RFC 4301.
|
||||
///
|
||||
///
|
||||
UINT32 PathMTU;
|
||||
///
|
||||
///
|
||||
/// Link to one SPD entry.
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_SPD_SELECTOR *SpdSelector;
|
||||
///
|
||||
/// Indication of whether it's manually set or negotiated automatically.
|
||||
/// If ManualSet is FALSE, the corresponding SA entry is inserted through
|
||||
///
|
||||
/// Indication of whether it's manually set or negotiated automatically.
|
||||
/// If ManualSet is FALSE, the corresponding SA entry is inserted through
|
||||
/// IKE protocol negotiation.
|
||||
///
|
||||
BOOLEAN ManualSet;
|
||||
@@ -457,41 +457,41 @@ typedef struct _EFI_IPSEC_SA_DATA {
|
||||
///
|
||||
/// EFI_IPSEC_SA_DATA2
|
||||
///
|
||||
typedef struct _EFI_IPSEC_SA_DATA2 {
|
||||
typedef struct _EFI_IPSEC_SA_DATA2 {
|
||||
///
|
||||
/// IPsec mode: tunnel or transport
|
||||
///
|
||||
EFI_IPSEC_MODE Mode;
|
||||
EFI_IPSEC_MODE Mode;
|
||||
///
|
||||
/// Sequence Number Counter. A 64-bit counter used to generate the sequence
|
||||
/// number field in AH or ESP headers.
|
||||
/// Sequence Number Counter. A 64-bit counter used to generate the sequence
|
||||
/// number field in AH or ESP headers.
|
||||
///
|
||||
UINT64 SNCount;
|
||||
UINT64 SNCount;
|
||||
///
|
||||
/// Anti-Replay Window. A 64-bit counter and a bit-map used to determine
|
||||
/// Anti-Replay Window. A 64-bit counter and a bit-map used to determine
|
||||
/// whether an inbound AH or ESP packet is a replay.
|
||||
///
|
||||
UINT8 AntiReplayWindows;
|
||||
UINT8 AntiReplayWindows;
|
||||
///
|
||||
/// AH/ESP cryptographic algorithm, key and parameters.
|
||||
///
|
||||
EFI_IPSEC_ALGO_INFO AlgoInfo;
|
||||
EFI_IPSEC_ALGO_INFO AlgoInfo;
|
||||
///
|
||||
/// Lifetime of this SA.
|
||||
///
|
||||
EFI_IPSEC_SA_LIFETIME SaLifetime;
|
||||
EFI_IPSEC_SA_LIFETIME SaLifetime;
|
||||
///
|
||||
/// Any observed path MTU and aging variables. The Path MTU processing is
|
||||
/// Any observed path MTU and aging variables. The Path MTU processing is
|
||||
/// defined in section 8 of RFC 4301.
|
||||
///
|
||||
UINT32 PathMTU;
|
||||
UINT32 PathMTU;
|
||||
///
|
||||
/// Link to one SPD entry
|
||||
///
|
||||
EFI_IPSEC_SPD_SELECTOR *SpdSelector;
|
||||
EFI_IPSEC_SPD_SELECTOR *SpdSelector;
|
||||
///
|
||||
/// Indication of whether it's manually set or negotiated automatically.
|
||||
/// If ManualSet is FALSE, the corresponding SA entry is inserted through IKE
|
||||
/// Indication of whether it's manually set or negotiated automatically.
|
||||
/// If ManualSet is FALSE, the corresponding SA entry is inserted through IKE
|
||||
/// protocol negotiation
|
||||
///
|
||||
BOOLEAN ManualSet;
|
||||
@@ -503,7 +503,7 @@ typedef struct _EFI_IPSEC_SA_DATA2 {
|
||||
/// The tunnel header IP destination address.
|
||||
///
|
||||
EFI_IP_ADDRESS TunnelDestinationAddress;
|
||||
} EFI_IPSEC_SA_DATA2;
|
||||
} EFI_IPSEC_SA_DATA2;
|
||||
|
||||
|
||||
///
|
||||
@@ -514,8 +514,8 @@ typedef struct _EFI_IPSEC_SA_DATA2 {
|
||||
typedef struct _EFI_IPSEC_PAD_ID {
|
||||
///
|
||||
/// Flag to identify which type of PAD Id is used.
|
||||
///
|
||||
BOOLEAN PeerIdValid;
|
||||
///
|
||||
BOOLEAN PeerIdValid;
|
||||
union {
|
||||
///
|
||||
/// Pointer to the IPv4 or IPv6 address range.
|
||||
@@ -523,8 +523,8 @@ typedef struct _EFI_IPSEC_PAD_ID {
|
||||
EFI_IP_ADDRESS_INFO IpAddress;
|
||||
///
|
||||
/// Pointer to a null terminated ASCII string
|
||||
/// representing the symbolic names. A PeerId can be a DNS
|
||||
/// name, Distinguished Name, RFC 822 email address or Key ID
|
||||
/// representing the symbolic names. A PeerId can be a DNS
|
||||
/// name, Distinguished Name, RFC 822 email address or Key ID
|
||||
/// (specified in section 4.4.3.1 of RFC 4301)
|
||||
///
|
||||
UINT8 PeerId[MAX_PEERID_LEN];
|
||||
@@ -533,7 +533,7 @@ typedef struct _EFI_IPSEC_PAD_ID {
|
||||
|
||||
///
|
||||
/// EFI_IPSEC_CONFIG_SELECTOR
|
||||
/// describes the expected IPsec configuration data selector
|
||||
/// describes the expected IPsec configuration data selector
|
||||
/// of type EFI_IPSEC_CONFIG_DATA_TYPE.
|
||||
///
|
||||
typedef union {
|
||||
@@ -544,7 +544,7 @@ typedef union {
|
||||
|
||||
///
|
||||
/// EFI_IPSEC_AUTH_PROTOCOL_TYPE
|
||||
/// defines the possible authentication protocol for IPsec
|
||||
/// defines the possible authentication protocol for IPsec
|
||||
/// security association management.
|
||||
///
|
||||
typedef enum {
|
||||
@@ -572,64 +572,64 @@ typedef enum {
|
||||
/// EFI_IPSEC_PAD_DATA
|
||||
///
|
||||
typedef struct _EFI_IPSEC_PAD_DATA {
|
||||
///
|
||||
///
|
||||
/// Authentication Protocol for IPsec security association management.
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_AUTH_PROTOCOL_TYPE AuthProtocol;
|
||||
///
|
||||
///
|
||||
/// Authentication method used.
|
||||
///
|
||||
///
|
||||
EFI_IPSEC_AUTH_METHOD AuthMethod;
|
||||
///
|
||||
/// The IKE ID payload will be used as a symbolic name for SPD
|
||||
/// lookup if IkeIdFlag is TRUE. Otherwise, the remote IP
|
||||
///
|
||||
/// The IKE ID payload will be used as a symbolic name for SPD
|
||||
/// lookup if IkeIdFlag is TRUE. Otherwise, the remote IP
|
||||
/// address provided in traffic selector playloads will be used.
|
||||
///
|
||||
///
|
||||
BOOLEAN IkeIdFlag;
|
||||
///
|
||||
///
|
||||
/// The size of Authentication data buffer, in bytes.
|
||||
///
|
||||
///
|
||||
UINTN AuthDataSize;
|
||||
///
|
||||
/// Buffer for Authentication data, (e.g., the pre-shared secret or the
|
||||
/// trust anchor relative to which the peer's certificate will be
|
||||
///
|
||||
/// Buffer for Authentication data, (e.g., the pre-shared secret or the
|
||||
/// trust anchor relative to which the peer's certificate will be
|
||||
/// validated).
|
||||
///
|
||||
///
|
||||
VOID *AuthData;
|
||||
///
|
||||
///
|
||||
/// The size of RevocationData, in bytes
|
||||
///
|
||||
///
|
||||
UINTN RevocationDataSize;
|
||||
///
|
||||
/// Pointer to CRL or OCSP data, if certificates are used for
|
||||
///
|
||||
/// Pointer to CRL or OCSP data, if certificates are used for
|
||||
/// authentication method.
|
||||
///
|
||||
///
|
||||
VOID *RevocationData;
|
||||
} EFI_IPSEC_PAD_DATA;
|
||||
|
||||
|
||||
/**
|
||||
Set the security association, security policy and peer authorization configuration
|
||||
information for the EFI IPsec driver.
|
||||
information for the EFI IPsec driver.
|
||||
|
||||
This function is used to set the IPsec configuration information of type DataType for
|
||||
the EFI IPsec driver.
|
||||
The IPsec configuration data has a unique selector/identifier separately to identify
|
||||
a data entry. The selector structure depends on DataType's definition.
|
||||
Using SetData() with a Data of NULL causes the IPsec configuration data entry identified
|
||||
by DataType and Selector to be deleted.
|
||||
by DataType and Selector to be deleted.
|
||||
|
||||
@param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
|
||||
@param[in] DataType The type of data to be set.
|
||||
@param[in] Selector Pointer to an entry selector on operated configuration data
|
||||
specified by DataType. A NULL Selector causes the entire
|
||||
@param[in] Selector Pointer to an entry selector on operated configuration data
|
||||
specified by DataType. A NULL Selector causes the entire
|
||||
specified-type configuration information to be flushed.
|
||||
@param[in] Data The data buffer to be set. The structure of the data buffer is
|
||||
@param[in] Data The data buffer to be set. The structure of the data buffer is
|
||||
associated with the DataType.
|
||||
@param[in] InsertBefore Pointer to one entry selector which describes the expected
|
||||
position the new data entry will be added. If InsertBefore is NULL,
|
||||
the new entry will be appended the end of database.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The specified configuration entry data is set successfully.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
|
||||
- This is NULL.
|
||||
@@ -648,20 +648,20 @@ EFI_STATUS
|
||||
);
|
||||
|
||||
/**
|
||||
Return the configuration value for the EFI IPsec driver.
|
||||
Return the configuration value for the EFI IPsec driver.
|
||||
|
||||
This function lookup the data entry from IPsec database or IKEv2 configuration
|
||||
information. The expected data type and unique identification are described in
|
||||
DataType and Selector parameters.
|
||||
DataType and Selector parameters.
|
||||
|
||||
@param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
|
||||
@param[in] DataType The type of data to retrieve.
|
||||
@param[in] Selector Pointer to an entry selector which is an identifier of the IPsec
|
||||
@param[in] Selector Pointer to an entry selector which is an identifier of the IPsec
|
||||
configuration data entry.
|
||||
@param[in, out] DataSize On output the size of data returned in Data.
|
||||
@param[out] Data The buffer to return the contents of the IPsec configuration data.
|
||||
The type of the data buffer is associated with the DataType.
|
||||
|
||||
@param[out] Data The buffer to return the contents of the IPsec configuration data.
|
||||
The type of the data buffer is associated with the DataType.
|
||||
|
||||
@retval EFI_SUCCESS The specified configuration data is got successfully.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
|
||||
- This is NULL.
|
||||
@@ -685,30 +685,30 @@ EFI_STATUS
|
||||
);
|
||||
|
||||
/**
|
||||
Enumerates the current selector for IPsec configuration data entry.
|
||||
Enumerates the current selector for IPsec configuration data entry.
|
||||
|
||||
This function is called multiple times to retrieve the entry Selector in IPsec
|
||||
configuration database. On each call to GetNextSelector(), the next entry
|
||||
configuration database. On each call to GetNextSelector(), the next entry
|
||||
Selector are retrieved into the output interface.
|
||||
|
||||
If the entire IPsec configuration database has been iterated, the error
|
||||
|
||||
If the entire IPsec configuration database has been iterated, the error
|
||||
EFI_NOT_FOUND is returned.
|
||||
If the Selector buffer is too small for the next Selector copy, an
|
||||
EFI_BUFFER_TOO_SMALL error is returned, and SelectorSize is updated to reflect
|
||||
If the Selector buffer is too small for the next Selector copy, an
|
||||
EFI_BUFFER_TOO_SMALL error is returned, and SelectorSize is updated to reflect
|
||||
the size of buffer needed.
|
||||
|
||||
On the initial call to GetNextSelector() to start the IPsec configuration database
|
||||
search, a pointer to the buffer with all zero value is passed in Selector. Calls
|
||||
to SetData() between calls to GetNextSelector may produce unpredictable results.
|
||||
search, a pointer to the buffer with all zero value is passed in Selector. Calls
|
||||
to SetData() between calls to GetNextSelector may produce unpredictable results.
|
||||
|
||||
@param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
|
||||
@param[in] DataType The type of IPsec configuration data to retrieve.
|
||||
@param[in, out] SelectorSize The size of the Selector buffer.
|
||||
@param[in, out] Selector On input, supplies the pointer to last Selector that was
|
||||
@param[in, out] Selector On input, supplies the pointer to last Selector that was
|
||||
returned by GetNextSelector().
|
||||
On output, returns one copy of the current entry Selector
|
||||
of a given DataType.
|
||||
|
||||
of a given DataType.
|
||||
|
||||
@retval EFI_SUCCESS The specified configuration data is got successfully.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
|
||||
- This is NULL.
|
||||
@@ -717,7 +717,7 @@ EFI_STATUS
|
||||
@retval EFI_NOT_FOUND The next configuration data entry was not found.
|
||||
@retval EFI_UNSUPPORTED The specified DataType is not supported.
|
||||
@retval EFI_BUFFER_TOO_SMALL The SelectorSize is too small for the result. This parameter
|
||||
has been updated with the size needed to complete the search
|
||||
has been updated with the size needed to complete the search
|
||||
request.
|
||||
|
||||
**/
|
||||
@@ -732,18 +732,18 @@ EFI_STATUS
|
||||
|
||||
/**
|
||||
Register an event that is to be signaled whenever a configuration process on the
|
||||
specified IPsec configuration information is done.
|
||||
specified IPsec configuration information is done.
|
||||
|
||||
This function registers an event that is to be signaled whenever a configuration
|
||||
process on the specified IPsec configuration data is done (e.g. IPsec security
|
||||
process on the specified IPsec configuration data is done (e.g. IPsec security
|
||||
policy database configuration is ready). An event can be registered for different
|
||||
DataType simultaneously and the caller is responsible for determining which type
|
||||
of configuration data causes the signaling of the event in such case.
|
||||
DataType simultaneously and the caller is responsible for determining which type
|
||||
of configuration data causes the signaling of the event in such case.
|
||||
|
||||
@param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
|
||||
@param[in] DataType The type of data to be registered the event for.
|
||||
@param[in] Event The event to be registered.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The event is registered successfully.
|
||||
@retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
|
||||
@retval EFI_ACCESS_DENIED The Event is already registered for the DataType.
|
||||
@@ -761,16 +761,16 @@ EFI_STATUS
|
||||
|
||||
/**
|
||||
Remove the specified event that is previously registered on the specified IPsec
|
||||
configuration data.
|
||||
configuration data.
|
||||
|
||||
This function removes a previously registered event for the specified configuration data.
|
||||
This function removes a previously registered event for the specified configuration data.
|
||||
|
||||
@param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
|
||||
@param[in] DataType The configuration data type to remove the registered event for.
|
||||
@param[in] Event The event to be unregistered.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The event is removed successfully.
|
||||
@retval EFI_NOT_FOUND The Event specified by DataType could not be found in the
|
||||
@retval EFI_NOT_FOUND The Event specified by DataType could not be found in the
|
||||
database.
|
||||
@retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
|
||||
@retval EFI_UNSUPPORTED The notify registration unsupported or the specified
|
||||
@@ -788,12 +788,12 @@ EFI_STATUS
|
||||
///
|
||||
/// EFI_IPSEC_CONFIG_PROTOCOL
|
||||
/// provides the ability to set and lookup the IPsec SAD (Security Association Database),
|
||||
/// SPD (Security Policy Database) data entry and configure the security association
|
||||
/// management protocol such as IKEv2. This protocol is used as the central
|
||||
/// SPD (Security Policy Database) data entry and configure the security association
|
||||
/// management protocol such as IKEv2. This protocol is used as the central
|
||||
/// repository of any policy-specific configuration for EFI IPsec driver.
|
||||
/// EFI_IPSEC_CONFIG_PROTOCOL can be bound to both IPv4 and IPv6 stack. User can use this
|
||||
/// EFI_IPSEC_CONFIG_PROTOCOL can be bound to both IPv4 and IPv6 stack. User can use this
|
||||
/// protocol for IPsec configuration in both IPv4 and IPv6 environment.
|
||||
///
|
||||
///
|
||||
struct _EFI_IPSEC_CONFIG_PROTOCOL {
|
||||
EFI_IPSEC_CONFIG_SET_DATA SetData;
|
||||
EFI_IPSEC_CONFIG_GET_DATA GetData;
|
||||
|
Reference in New Issue
Block a user