Lines Matching refs:ap

1415 ipsec_req_from_act(ipsec_action_t *ap, ipsec_req_t *req)
1417 switch (ap->ipa_act.ipa_type) {
1423 return (ipsec_req_from_prot(&ap->ipa_act.ipa_apply, req));
1565 ipsec_check_ipsecin_action(ip_recv_attr_t *ira, mblk_t *mp, ipsec_action_t *ap,
1587 if (ap == ira->ira_ipsec_action ||
1604 switch (ap->ipa_act.ipa_type) {
1619 ipp = &ap->ipa_act.ipa_apply;
1732 IPACT_REFHOLD(ap);
1733 ira->ira_ipsec_action = ap;
1800 ipsec_action_t *ap, ipha_t *ipha, ip6_t *ip6h, const char **reason,
1842 return (ipsec_check_ipsecin_action(ira, mp, ap, ipha, ip6h, reason,
1860 ipsec_action_t *ap;
1902 for (ap = ipsp->ipsp_act; ap != NULL; ap = ap->ipa_next) {
1903 if (ipsec_check_ipsecin_action(ira, data_mp, ap,
2459 ipsec_action_t *ap;
2585 ap = connp->conn_latch_in_action;
2586 if (ap != NULL)
2587 IPACT_REFHOLD(ap);
2590 if (ap != NULL) {
2595 if (ipsec_check_ipsecin_latch(ira, mp, ipl, ap,
2599 IPACT_REFRELE(ap);
2610 IPACT_REFRELE(ap);
2978 ipsec_action_t *ap;
2981 ap = kmem_cache_alloc(ipsec_action_cache, KM_NOSLEEP);
2983 if (ap == NULL)
2986 bzero(ap, sizeof (*ap));
2987 HASH_NULL(ap, ipa_hash);
2988 ap->ipa_next = NULL;
2989 ap->ipa_refs = 1;
2994 ap->ipa_act.ipa_type = IPSEC_ACT_APPLY;
2995 ap->ipa_act.ipa_log = 0;
2999 ap->ipa_act.ipa_apply.ipp_use_ah = (ah_assoc != NULL);
3002 ap->ipa_act.ipa_apply.ipp_use_esp = (esp_assoc != NULL);
3007 ap->ipa_act.ipa_apply.ipp_use_espa = (espa_alg != 0);
3012 ap->ipa_act.ipa_apply.ipp_encr_alg = (uint8_t)encr_alg;
3013 ap->ipa_act.ipa_apply.ipp_auth_alg = (uint8_t)auth_alg;
3014 ap->ipa_act.ipa_apply.ipp_esp_auth_alg = (uint8_t)espa_alg;
3015 ap->ipa_act.ipa_apply.ipp_use_se =
3020 ap->ipa_act.ipa_apply.ipp_espa_minbits =
3022 ap->ipa_act.ipa_apply.ipp_espa_maxbits =
3024 ap->ipa_act.ipa_apply.ipp_espe_minbits =
3026 ap->ipa_act.ipa_apply.ipp_espe_maxbits =
3028 ap->ipa_act.ipa_apply.ipp_km_proto = esp_assoc->ipsa_kmp;
3029 ap->ipa_act.ipa_apply.ipp_km_cookie = esp_assoc->ipsa_kmc;
3034 ap->ipa_act.ipa_apply.ipp_ah_minbits =
3036 ap->ipa_act.ipa_apply.ipp_ah_maxbits =
3038 ap->ipa_act.ipa_apply.ipp_km_proto = ah_assoc->ipsa_kmp;
3039 ap->ipa_act.ipa_apply.ipp_km_cookie = ah_assoc->ipsa_kmc;
3043 ap->ipa_act.ipa_apply.ipp_use_unique = unique;
3044 ap->ipa_want_unique = unique;
3045 ap->ipa_allow_clear = B_FALSE;
3046 ap->ipa_want_se = !!(ira->ira_flags & IRAF_IPSEC_DECAPS);
3047 ap->ipa_want_ah = (ah_assoc != NULL);
3048 ap->ipa_want_esp = (esp_assoc != NULL);
3050 ap->ipa_ovhd = ipsec_act_ovhd(&ap->ipa_act);
3052 ap->ipa_act.ipa_apply.ipp_replay_depth = 0; /* don't care */
3054 return (ap);
3166 ipsec_action_t *ap;
3185 for (HASH_ITERATE(ap, ipa_hash,
3187 if (bcmp(&ap->ipa_act, &a[i], sizeof (*a)) != 0)
3189 if (ap->ipa_next != prev)
3193 if (ap != NULL) {
3195 prev = ap;
3201 ap = kmem_cache_alloc(ipsec_action_cache, KM_NOSLEEP);
3202 if (ap == NULL) {
3208 HASH_INSERT(ap, ipa_hash, ipss->ipsec_action_hash, hval);
3210 ap->ipa_next = prev;
3211 ap->ipa_act = a[i];
3229 ap->ipa_allow_clear = allow_clear;
3230 ap->ipa_want_ah = want_ah;
3231 ap->ipa_want_esp = want_esp;
3232 ap->ipa_want_se = want_se;
3233 ap->ipa_want_unique = want_unique;
3234 ap->ipa_refs = 1; /* from the hash table */
3235 ap->ipa_ovhd = maxovhd;
3238 prev = ap;
3242 ap->ipa_refs++; /* caller's reference */
3244 return (ap);
3254 ipsec_action_free(ipsec_action_t *ap)
3257 ipsec_action_t *np = ap->ipa_next;
3258 ASSERT(ap->ipa_refs == 0);
3259 ASSERT(ap->ipa_hash.hash_pp == NULL);
3260 kmem_cache_free(ipsec_action_cache, ap);
3261 ap = np;
3263 if (ap == NULL)
3266 if (atomic_dec_32_nv(&(ap)->ipa_refs) != 0)
3281 ipsec_action_free_table(ipsec_action_t *ap)
3283 while (ap != NULL) {
3284 ipsec_action_t *np = ap->ipa_next;
3288 (void *)ap, ap->ipa_refs);
3289 ASSERT(ap->ipa_refs > 0);
3290 IPACT_REFRELE(ap);
3291 ap = np;
3340 ipsec_action_t *ap, *np;
3347 for (ap = ipss->ipsec_action_hash[i].hash_head;
3348 ap != NULL; ap = np) {
3349 ASSERT(ap->ipa_refs > 0);
3350 np = ap->ipa_hash.hash_next;
3351 if (ap->ipa_refs > 1)
3353 HASH_UNCHAIN(ap, ipa_hash,
3355 IPACT_REFRELE(ap);
3470 ipsec_action_t *ap;
3479 ap = ipsec_act_find(a, nacts, ns);
3482 if ((ap == NULL) || (sp == NULL) || (ipp == NULL)) {
3483 if (ap != NULL) {
3484 IPACT_REFRELE(ap);
3498 ipp->ipsp_act = ap;