- case IPSECCTL_STATS:
- return sysctl_struct(oldp, oldlenp, newp, newlen,
- &ipsecstat, sizeof(ipsecstat));
- case IPSECCTL_DEF_POLICY:
- if (newp != NULL && newlen == sizeof(int)) {
- switch (*(int *)newp) {
- case IPSEC_POLICY_DISCARD:
- case IPSEC_POLICY_NONE:
- break;
- default:
- return EINVAL;
- }
- }
- return sysctl_int(oldp, oldlenp, newp, newlen,
- &ip4_def_policy.policy);
- case IPSECCTL_DEF_ESP_TRANSLEV:
- return sysctl_int(oldp, oldlenp, newp, newlen,
- &ip4_esp_trans_deflev);
- case IPSECCTL_DEF_ESP_NETLEV:
- return sysctl_int(oldp, oldlenp, newp, newlen,
- &ip4_esp_net_deflev);
- case IPSECCTL_DEF_AH_TRANSLEV:
- return sysctl_int(oldp, oldlenp, newp, newlen,
- &ip4_ah_trans_deflev);
- case IPSECCTL_DEF_AH_NETLEV:
- return sysctl_int(oldp, oldlenp, newp, newlen,
- &ip4_ah_net_deflev);
- case IPSECCTL_INBOUND_CALL_IKE:
- return sysctl_int(oldp, oldlenp, newp, newlen,
- &ip4_inbound_call_ike);
- case IPSECCTL_AH_CLEARTOS:
- return sysctl_int(oldp, oldlenp, newp, newlen,
- &ip4_ah_cleartos);
- case IPSECCTL_AH_OFFSETMASK:
- return sysctl_int(oldp, oldlenp, newp, newlen,
- &ip4_ah_offsetmask);
- case IPSECCTL_DFBIT:
- return sysctl_int(oldp, oldlenp, newp, newlen,
- &ip4_ipsec_dfbit);
- case IPSECCTL_ECN:
- return sysctl_int(oldp, oldlenp, newp, newlen, &ip4_ipsec_ecn);
- case IPSECCTL_DEBUG:
- return sysctl_int(oldp, oldlenp, newp, newlen, &ipsec_debug);
- default:
- return EOPNOTSUPP;
- }
- /* NOTREACHED */