/** @file
The Implementations for Information Exchange.
Copyright (c) 2010, 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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "Utility.h"
#include "IpSecDebug.h"
#include "IpSecConfigImpl.h"
/**
Generate Information Packet.
The information Packet may contain one Delete Payload, or Notify Payload, which
dependes on the Context's parameters.
@param[in] SaSession Pointer to IKE SA Session or Child SA Session which is
related to the information Exchange.
@param[in] Context The Data passed from the caller. If the Context is not NULL
it should contain the information for Notification Data.
@retval Pointer of IKE_PACKET generated.
**/
)
{
InfoContext = NULL;
IkePacket = IkePacketAlloc ();
//
// Fill IkePacket Header.
//
}
//
// For Liveness Check
//
if (InfoContext != NULL &&
) {
//
// TODO: add Notify Payload for Notification Information.
//
return IkePacket;
}
//
// For delete SAs
//
//
// If the information message is response message,the MessageId should
// be same as the request MessageId which passed through the Context.
//
if (InfoContext != NULL) {
} else {
}
//
// If the state is on deleting generate a Delete Payload for it.
//
0,
0,
);
if (IkePayload == NULL) {
goto ERROR_EXIT;
}
//
// Fill the next payload in IkePacket's Header.
//
//
// TODO: If contest is not NULL Generate a Notify Payload.
//
} else {
//
// The input parameter is not correct.
//
goto ERROR_EXIT;
}
} else {
//
// Delete the Child SA Information Exchagne
//
//
// If the information message is response message,the MessageId should
// be same as the request MessageId which passed through the Context.
//
} else {
}
4,
1,
);
if (IkePayload == NULL) {
goto ERROR_EXIT;
}
//
// Fill the Next Payload in IkePacket's Header.
//
//
// If responder, use the MessageId fromt the initiator.
//
}
//
// Change the IsOnDeleting Flag
//
}
if (InfoContext == NULL) {
} else {
}
return IkePacket;
}
return NULL;
}
/**
Parse the Info Exchange.
@param[in] SaSession Pointer to IKEV2_SA_SESSION.
@param[in] IkePacket Pointer to IkePacket related to the Information Exchange.
@retval EFI_SUCCESS The operation finised successed.
**/
)
{
//
// For Liveness Check
//
(IkePacket->PayloadTotalSize == 0)
) {
//
// If it is Liveness check request, reply it.
//
if (RespondPacket == NULL) {
return Status;
}
0
);
} else {
//
// Todo: verify the liveness check response packet.
//
}
return Status;
}
//
// For SA Delete
//
//
//
//
// Delete IKE SA.
//
//
// Checking the Private status.
//
//
// when all IKE SAs were disabled by calling "IPsecConfig -disable", the IPsec
// status should be changed.
//
//
// After all IKE SAs were deleted, set the IPSEC_STATUS_DISABLED value in
// IPsec status variable.
//
) {
sizeof (Value),
);
//
// Set the DisabledFlag in Private data.
//
}
}
}
} else {
if (RespondPacket == NULL) {
return Status;
}
0
);
}
//
// Move the Child SAs to DeleteList
//
) {
//
// Insert the ChildSa Session into Delete List.
//
if (RespondPacket == NULL) {
return Status;
}
0
);
} else {
//
// Delete the Child SA.
//
}
}
}
}
}
}
}
return Status;
}
};