Go to the documentation of this file.
39 #define AH_SUPPORT DISABLED
40 #elif (AH_SUPPORT != ENABLED && AH_SUPPORT != DISABLED)
41 #error AH_SUPPORT parameter is not valid
45 #ifndef AH_ESN_SUPPORT
46 #define AH_ESN_SUPPORT ENABLED
47 #elif (AH_ESN_SUPPORT != ENABLED && AH_ESN_SUPPORT != DISABLED)
48 #error AH_ESN_SUPPORT parameter is not valid
52 #ifndef AH_CMAC_SUPPORT
53 #define AH_CMAC_SUPPORT DISABLED
54 #elif (AH_CMAC_SUPPORT != ENABLED && AH_CMAC_SUPPORT != DISABLED)
55 #error AH_CMAC_SUPPORT parameter is not valid
59 #ifndef AH_HMAC_SUPPORT
60 #define AH_HMAC_SUPPORT ENABLED
61 #elif (AH_HMAC_SUPPORT != ENABLED && AH_HMAC_SUPPORT != DISABLED)
62 #error AH_HMAC_SUPPORT parameter is not valid
66 #ifndef AH_AES_128_SUPPORT
67 #define AH_AES_128_SUPPORT DISABLED
68 #elif (AH_AES_128_SUPPORT != ENABLED && AH_AES_128_SUPPORT != DISABLED)
69 #error AH_AES_128_SUPPORT parameter is not valid
73 #ifndef AH_MD5_SUPPORT
74 #define AH_MD5_SUPPORT DISABLED
75 #elif (AH_MD5_SUPPORT != ENABLED && AH_MD5_SUPPORT != DISABLED)
76 #error AH_MD5_SUPPORT parameter is not valid
80 #ifndef AH_SHA1_SUPPORT
81 #define AH_SHA1_SUPPORT ENABLED
82 #elif (AH_SHA1_SUPPORT != ENABLED && AH_SHA1_SUPPORT != DISABLED)
83 #error AH_SHA1_SUPPORT parameter is not valid
87 #ifndef AH_SHA256_SUPPORT
88 #define AH_SHA256_SUPPORT ENABLED
89 #elif (AH_SHA256_SUPPORT != ENABLED && AH_SHA256_SUPPORT != DISABLED)
90 #error AH_SHA256_SUPPORT parameter is not valid
94 #ifndef AH_SHA384_SUPPORT
95 #define AH_SHA384_SUPPORT ENABLED
96 #elif (AH_SHA384_SUPPORT != ENABLED && AH_SHA384_SUPPORT != DISABLED)
97 #error AH_SHA384_SUPPORT parameter is not valid
101 #ifndef AH_SHA512_SUPPORT
102 #define AH_SHA512_SUPPORT ENABLED
103 #elif (AH_SHA512_SUPPORT != ENABLED && AH_SHA512_SUPPORT != DISABLED)
104 #error AH_SHA512_SUPPORT parameter is not valid
108 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA512_SUPPORT == ENABLED)
109 #define AH_MAX_ICV_SIZE 32
110 #elif (AH_HMAC_SUPPORT == ENABLED && AH_SHA384_SUPPORT == ENABLED)
111 #define AH_MAX_ICV_SIZE 24
112 #elif (AH_HMAC_SUPPORT == ENABLED && AH_SHA256_SUPPORT == ENABLED)
113 #define AH_MAX_ICV_SIZE 16
115 #define AH_MAX_ICV_SIZE 12
119 #define AH_MAX_OVERHEAD (sizeof(AhHeader) + AH_MAX_ICV_SIZE)
127 #if defined(__CCRX__)
129 #elif defined(__CWCC__) || defined(_WIN32)
130 #pragma pack(push, 1)
150 #if defined(__CCRX__)
152 #elif defined(__CWCC__) || defined(_WIN32)
Structure describing a buffer that spans multiple chunks.
typedef __packed_struct
AH header.
void ahProcessMutableIpv4Options(Ipv4Header *header)
Zeroize mutable IPv4 options.
error_t ahGenerateIcv(IpsecSadEntry *sa, const Ipv4Header *ipv4Header, AhHeader *ahHeader, const NetBuffer *buffer, size_t offset)
ICV generation.
void ahDumpHeader(const AhHeader *ahHeader)
Dump AH header for debugging purpose.
error_t ahVerifyIcv(IpsecSadEntry *sa, const Ipv4Header *ipv4Header, const AhHeader *ahHeader, const NetBuffer *buffer, size_t offset)
ICV verification.
error_t ipv4ProcessAhHeader(NetInterface *interface, const Ipv4Header *ipv4Header, const NetBuffer *buffer, size_t offset, NetRxAncillary *ancillary)
Process AH protected packet.