59#include <netinet6/ip6_ecn.h>
100 if (!outer || !inner)
101 panic(
"NULL pointer passed to ip_ecn_ingress");
111 *outer &= ~IPTOS_ECN_ECT1;
117 *outer &= ~IPTOS_ECN_MASK;
132 if (!outer || !inner)
133 panic(
"NULL pointer passed to ip_ecn_egress");
163ip6_ecn_ingress(
int mode, u_int32_t *outer,
const u_int32_t *inner)
165 u_int8_t outer8, inner8;
167 if (!outer || !inner)
168 panic(
"NULL pointer passed to ip6_ecn_ingress");
170 inner8 = (ntohl(*inner) >> 20) & 0xff;
172 *outer &= ~htonl(0xff << 20);
173 *outer |= htonl((u_int32_t)outer8 << 20);
177ip6_ecn_egress(
int mode,
const u_int32_t *outer, u_int32_t *inner)
179 u_int8_t outer8, inner8, oinner8;
181 if (!outer || !inner)
182 panic(
"NULL pointer passed to ip6_ecn_egress");
184 outer8 = (ntohl(*outer) >> 20) & 0xff;
185 inner8 = oinner8 = (ntohl(*inner) >> 20) & 0xff;
188 if (inner8 != oinner8) {
189 *inner &= ~htonl(0xff << 20);
190 *inner |= htonl((u_int32_t)inner8 << 20);
void ip_ecn_ingress(int mode, u_int8_t *outer, const u_int8_t *inner)
int ip_ecn_egress(int mode, const u_int8_t *outer, u_int8_t *inner)