MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ipsec_run_hhooks

Function ipsec_run_hhooks

freebsd/netipsec/ipsec.c:843–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

841#endif /* INET6 */
842
843int
844ipsec_run_hhooks(struct ipsec_ctx_data *ctx, int type)
845{
846 int idx;
847
848 switch (ctx->af) {
849#ifdef INET
850 case AF_INET:
851 idx = HHOOK_IPSEC_INET;
852 break;
853#endif
854#ifdef INET6
855 case AF_INET6:
856 idx = HHOOK_IPSEC_INET6;
857 break;
858#endif
859 default:
860 return (EPFNOSUPPORT);
861 }
862 if (type == HHOOK_TYPE_IPSEC_IN)
863 HHOOKS_RUN_IF(V_ipsec_hhh_in[idx], ctx, NULL);
864 else
865 HHOOKS_RUN_IF(V_ipsec_hhh_out[idx], ctx, NULL);
866 if (*ctx->mp == NULL)
867 return (EACCES);
868 return (0);
869}
870
871/*
872 * Return current level.

Callers 5

ipsec4_common_input_cbFunction · 0.85
ipsec6_common_input_cbFunction · 0.85
ipsec_input.cFile · 0.85
ipsec4_perform_requestFunction · 0.85
ipsec6_perform_requestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected