Changeset View
Changeset View
Standalone View
Standalone View
sys/netipsec/ipsec_support.h
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | #define IPSEC_OUTPUT(proto, m, ...) \ | ||||
(*(proto ## _ipsec_support)->methods->output)(m, __VA_ARGS__) | (*(proto ## _ipsec_support)->methods->output)(m, __VA_ARGS__) | ||||
#define IPSEC_PCBCTL(proto, inp, sopt) \ | #define IPSEC_PCBCTL(proto, inp, sopt) \ | ||||
(*(proto ## _ipsec_support)->methods->pcbctl)(inp, sopt) | (*(proto ## _ipsec_support)->methods->pcbctl)(inp, sopt) | ||||
#define IPSEC_CAPS(proto, m, ...) \ | #define IPSEC_CAPS(proto, m, ...) \ | ||||
(*(proto ## _ipsec_support)->methods->capability)(m, __VA_ARGS__) | (*(proto ## _ipsec_support)->methods->capability)(m, __VA_ARGS__) | ||||
#define IPSEC_HDRSIZE(proto, inp) \ | #define IPSEC_HDRSIZE(proto, inp) \ | ||||
(*(proto ## _ipsec_support)->methods->hdrsize)(inp) | (*(proto ## _ipsec_support)->methods->hdrsize)(inp) | ||||
#define UDPENCAP_INPUT(m, ...) \ | #define UDPENCAP_INPUT(proto, m, ...) \ | ||||
(*ipv4_ipsec_support->methods->udp_input)(m, __VA_ARGS__) | (*(proto ## _ipsec_support)->methods->udp_input)(m, __VA_ARGS__) | ||||
#define UDPENCAP_PCBCTL(inp, sopt) \ | #define UDPENCAP_PCBCTL(proto, inp, sopt) \ | ||||
(*ipv4_ipsec_support->methods->udp_pcbctl)(inp, sopt) | (*(proto ## _ipsec_support)->methods->udp_pcbctl)(inp, sopt) | ||||
#elif defined(IPSEC_SUPPORT) | #elif defined(IPSEC_SUPPORT) | ||||
struct ipsec_support { | struct ipsec_support { | ||||
volatile u_int enabled; | volatile u_int enabled; | ||||
const struct ipsec_methods * volatile methods; | const struct ipsec_methods * volatile methods; | ||||
}; | }; | ||||
extern struct ipsec_support * const ipv4_ipsec_support; | extern struct ipsec_support * const ipv4_ipsec_support; | ||||
extern struct ipsec_support * const ipv6_ipsec_support; | extern struct ipsec_support * const ipv6_ipsec_support; | ||||
Show All 11 Lines | |||||
int ipsec_kmod_pcbctl(struct ipsec_support * const, struct inpcb *, | int ipsec_kmod_pcbctl(struct ipsec_support * const, struct inpcb *, | ||||
struct sockopt *); | struct sockopt *); | ||||
int ipsec_kmod_capability(struct ipsec_support * const, struct mbuf *, u_int); | int ipsec_kmod_capability(struct ipsec_support * const, struct mbuf *, u_int); | ||||
size_t ipsec_kmod_hdrsize(struct ipsec_support * const, struct inpcb *); | size_t ipsec_kmod_hdrsize(struct ipsec_support * const, struct inpcb *); | ||||
int ipsec_kmod_udp_input(struct ipsec_support * const, struct mbuf *, int, int); | int ipsec_kmod_udp_input(struct ipsec_support * const, struct mbuf *, int, int); | ||||
int ipsec_kmod_udp_pcbctl(struct ipsec_support * const, struct inpcb *, | int ipsec_kmod_udp_pcbctl(struct ipsec_support * const, struct inpcb *, | ||||
struct sockopt *); | struct sockopt *); | ||||
#define UDPENCAP_INPUT(m, ...) \ | #define UDPENCAP_INPUT(proto, m, ...) \ | ||||
ipsec_kmod_udp_input(ipv4_ipsec_support, m, __VA_ARGS__) | ipsec_kmod_udp_input(proto ## _ipsec_support, m, __VA_ARGS__) | ||||
#define UDPENCAP_PCBCTL(inp, sopt) \ | #define UDPENCAP_PCBCTL(proto, inp, sopt) \ | ||||
ipsec_kmod_udp_pcbctl(ipv4_ipsec_support, inp, sopt) | ipsec_kmod_udp_pcbctl(proto ## _ipsec_support, inp, sopt) | ||||
#define IPSEC_INPUT(proto, ...) \ | #define IPSEC_INPUT(proto, ...) \ | ||||
ipsec_kmod_input(proto ## _ipsec_support, __VA_ARGS__) | ipsec_kmod_input(proto ## _ipsec_support, __VA_ARGS__) | ||||
#define IPSEC_CHECK_POLICY(proto, ...) \ | #define IPSEC_CHECK_POLICY(proto, ...) \ | ||||
ipsec_kmod_check_policy(proto ## _ipsec_support, __VA_ARGS__) | ipsec_kmod_check_policy(proto ## _ipsec_support, __VA_ARGS__) | ||||
#define IPSEC_FORWARD(proto, ...) \ | #define IPSEC_FORWARD(proto, ...) \ | ||||
ipsec_kmod_forward(proto ## _ipsec_support, __VA_ARGS__) | ipsec_kmod_forward(proto ## _ipsec_support, __VA_ARGS__) | ||||
#define IPSEC_OUTPUT(proto, ...) \ | #define IPSEC_OUTPUT(proto, ...) \ | ||||
Show All 10 Lines |