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_KMAC128_SUPPORT
67 #define AH_KMAC128_SUPPORT DISABLED
68 #elif (AH_KMAC128_SUPPORT != ENABLED && AH_KMAC128_SUPPORT != DISABLED)
69 #error AH_KMAC128_SUPPORT parameter is not valid
73 #ifndef AH_KMAC256_SUPPORT
74 #define AH_KMAC256_SUPPORT DISABLED
75 #elif (AH_KMAC256_SUPPORT != ENABLED && AH_KMAC256_SUPPORT != DISABLED)
76 #error AH_KMAC256_SUPPORT parameter is not valid
80 #ifndef AH_AES_128_SUPPORT
81 #define AH_AES_128_SUPPORT DISABLED
82 #elif (AH_AES_128_SUPPORT != ENABLED && AH_AES_128_SUPPORT != DISABLED)
83 #error AH_AES_128_SUPPORT parameter is not valid
87 #ifndef AH_MD5_SUPPORT
88 #define AH_MD5_SUPPORT DISABLED
89 #elif (AH_MD5_SUPPORT != ENABLED && AH_MD5_SUPPORT != DISABLED)
90 #error AH_MD5_SUPPORT parameter is not valid
94 #ifndef AH_SHA1_SUPPORT
95 #define AH_SHA1_SUPPORT ENABLED
96 #elif (AH_SHA1_SUPPORT != ENABLED && AH_SHA1_SUPPORT != DISABLED)
97 #error AH_SHA1_SUPPORT parameter is not valid
101 #ifndef AH_SHA256_SUPPORT
102 #define AH_SHA256_SUPPORT ENABLED
103 #elif (AH_SHA256_SUPPORT != ENABLED && AH_SHA256_SUPPORT != DISABLED)
104 #error AH_SHA256_SUPPORT parameter is not valid
108 #ifndef AH_SHA384_SUPPORT
109 #define AH_SHA384_SUPPORT ENABLED
110 #elif (AH_SHA384_SUPPORT != ENABLED && AH_SHA384_SUPPORT != DISABLED)
111 #error AH_SHA384_SUPPORT parameter is not valid
115 #ifndef AH_SHA512_SUPPORT
116 #define AH_SHA512_SUPPORT ENABLED
117 #elif (AH_SHA512_SUPPORT != ENABLED && AH_SHA512_SUPPORT != DISABLED)
118 #error AH_SHA512_SUPPORT parameter is not valid
122 #ifndef AH_SM3_SUPPORT
123 #define AH_SM3_SUPPORT DISABLED
124 #elif (AH_SM3_SUPPORT != ENABLED && AH_SM3_SUPPORT != DISABLED)
125 #error AH_SM3_SUPPORT parameter is not valid
129 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA512_SUPPORT == ENABLED)
130 #define AH_MAX_DIGEST_SIZE 64
131 #elif (AH_HMAC_SUPPORT == ENABLED && AH_SHA384_SUPPORT == ENABLED)
132 #define AH_MAX_DIGEST_SIZE 48
133 #elif (AH_HMAC_SUPPORT == ENABLED && AH_SHA256_SUPPORT == ENABLED)
134 #define AH_MAX_DIGEST_SIZE 32
136 #define AH_MAX_DIGEST_SIZE 12
140 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA512_SUPPORT == ENABLED)
141 #define AH_MAX_ICV_SIZE 32
142 #elif (AH_HMAC_SUPPORT == ENABLED && AH_SHA384_SUPPORT == ENABLED)
143 #define AH_MAX_ICV_SIZE 24
144 #elif (AH_HMAC_SUPPORT == ENABLED && AH_SHA256_SUPPORT == ENABLED)
145 #define AH_MAX_ICV_SIZE 16
147 #define AH_MAX_ICV_SIZE 12
151 #define AH_MAX_OVERHEAD (sizeof(AhHeader) + AH_MAX_ICV_SIZE)
159 #if defined(__CCRX__)
161 #elif defined(__CWCC__) || defined(_WIN32)
162 #pragma pack(push, 1)
182 #if defined(__CCRX__)
184 #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 ahVerifyIcv(IpsecContext *context, IpsecSadEntry *sa, const Ipv4Header *ipv4Header, const AhHeader *ahHeader, const NetBuffer *buffer, size_t offset)
ICV verification.
error_t ahGenerateIcv(IpsecContext *context, 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 ipv4ProcessAhHeader(NetInterface *interface, const Ipv4Header *ipv4Header, const NetBuffer *buffer, size_t offset, NetRxAncillary *ancillary)
Process AH protected packet.