| 841 | #endif /* INET6 */ |
| 842 | |
| 843 | int |
| 844 | ipsec_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. |
no outgoing calls
no test coverage detected