Go to the documentation of this file.
37 #if (IPSEC_SUPPORT == ENABLED)
59 if(context != NULL && selector != NULL)
65 entry = &context->
spd[i];
108 sa = &context->
sad[i];
147 sa = &context->
sad[i];
189 if(context != NULL && selector != NULL)
195 sa = &context->
sad[i];
217 else if((
time - sa->lifetimeStart) < (
time - bestSa->lifetimeStart))
244 const uint8_t *
id,
size_t idLen)
250 if(context != NULL &&
id != NULL)
256 entry = &context->
pad[i];
266 if(idLen == entry->
idLen &&
277 if(idLen == entry->
idLen &&
288 if(idLen == entry->
idLen &&
299 if(idLen == entry->
idLen &&
306 #if (IPV4_SUPPORT == ENABLED)
323 #if (IPV6_SUPPORT == ENABLED)
365 #if (IPV4_SUPPORT == ENABLED)
430 #if (IPV6_SUPPORT == ENABLED)
548 #if (IPV4_SUPPORT == ENABLED)
639 #if (IPV6_SUPPORT == ENABLED)
IpsecSadEntry * sad
Security Association Database (SAD)
IpsecAddrRange ipAddr
IPv4 or IPv6 address range.
@ IPSEC_ID_TYPE_KEY_ID
Key ID.
char_t email[IPSEC_MAX_ID_LEN+1]
RFC 822 email address.
@ IPSEC_ID_TYPE_IPV4_ADDR
IPv4 address.
uint_t numPadEntries
Number of entries in the PAD database.
uint8_t keyId[IPSEC_MAX_ID_LEN]
Key ID.
IpsecPadEntry * ipsecFindPadEntry(IpsecContext *context, uint8_t idType, const uint8_t *id, size_t idLen)
Find PAD entry that matches the specified identification data.
#define IPSEC_PORT_START_OPAQUE
IpAddr remoteIpAddr
Remote IP address.
const uint8_t IPSEC_INVALID_SPI[4]
#define osMemcmp(p1, p2, length)
@ IPSEC_PFP_FLAG_REMOTE_ADDR
@ IPSEC_PFP_FLAG_LOCAL_ADDR
uint32_t Ipv4Addr
IPv4 network address.
uint_t numSadEntries
Number of entries in the SAD database.
@ IPSEC_ID_TYPE_RFC822_ADDR
RFC 822 email address.
Peer Authorization Database (PAD) entry.
uint16_t remotePort
Remote port.
char_t fqdn[IPSEC_MAX_ID_LEN+1]
Fully-qualified domain name.
IpsecSpdEntry * spd
Security Policy Database (SPD)
IpsecAuthMethod authMethod
Authentication method (IKEv1, IKEv2, KINK)
uint8_t nextProtocol
Next layer protocol.
uint8_t nextProtocol
Next layer protocol.
uint16_t localPort
Local port.
@ IPSEC_ID_TYPE_FQDN
Fully-qualified domain name.
IpsecPolicyAction
Policy action.
IpsecPolicyAction policyAction
Processing choice (DISCARD, BYPASS or PROTECT)
#define IPSEC_PORT_END_ANY
@ IPSEC_PFP_FLAG_REMOTE_PORT
IpsecPortRange remotePort
Remote port range.
IpsecSadEntry * ipsecFindOutboundSadEntry(IpsecContext *context, const IpsecSelector *selector)
Search the SAD database for a matching outbound entry.
bool_t ipsecIntersectSelectors(const IpsecSelector *selector1, const IpsecSelector *selector2, IpsecSelector *result)
Calculate the intersection of two selectors.
IpsecPadEntry * pad
Peer Authorization Database (PAD)
Helper routines for IPsec.
bool_t ipsecIsSubsetSelector(const IpsecSelector *selector1, const IpsecSelector *selector2)
Test if a selector is a subset of another selector.
@ IPSEC_ID_TYPE_IPV6_ADDR
IPv6 address.
@ IPSEC_AUTH_METHOD_IKEV2
IpsecSadEntry * ipsecFindInboundSadEntry(IpsecContext *context, IpsecProtocol protocol, uint32_t spi)
Search the SAD database for a matching inbound entry.
uint_t pfpFlags
PFP flags.
IpsecIdType idType
ID type.
IpsecProtocol
Security protocols.
IpsecSpdEntry * ipsecFindSpdEntry(IpsecContext *context, IpsecPolicyAction policyAction, const IpsecSelector *selector)
Search the SPD database for a matching entry.
uint32_t systime_t
System time.
int_t ipsecAllocateSadEntry(IpsecContext *context)
Allocate a new entry in the SAD database.
size_t idLen
Length of the ID, in bytes.
#define IPSEC_PORT_END_OPAQUE
uint8_t dn[IPSEC_MAX_ID_LEN]
X.500 Distinguished Name.
#define IPSEC_PROTOCOL_ANY
IpsecAddrRange localIpAddr
Local IP address range.
@ IPSEC_POLICY_ACTION_INVALID
IpAddr localIpAddr
Local IP address.
@ IPSEC_PFP_FLAG_NEXT_PROTOCOL
@ IPSEC_ID_TYPE_DN
X.500 distinguished name.
uint_t numSpdEntries
Number of entries in the SPD database.
@ IPSEC_PFP_FLAG_LOCAL_PORT
#define IPSEC_PORT_START_ANY
error_t ipsecDeriveSelector(const IpsecSpdEntry *spdEntry, const IpsecPacketInfo *packet, IpsecSelector *selector)
Derive SAD selector from SPD entry and triggering packet.
Security Policy Database (SPD) entry.
IpsecSelector selector
Traffic selector.
@ IPSEC_SA_STATE_RESERVED
IpsecPortRange localPort
Local port range.
IpsecAddrRange remoteIpAddr
Remote IP address range.
systime_t osGetSystemTime(void)
Retrieve system time.