Lines Matching defs:state

1270 	new->sp_in->state = IPSEC_SPSTATE_ALIVE;
1278 new->sp_out->state = IPSEC_SPSTATE_ALIVE;
1359 dst->state = src->state;
1413 newsp->state = IPSEC_SPSTATE_ALIVE;
2993 struct ipsec_output_state *state,
3008 if (!state)
3009 panic("state == NULL in ipsec4_output");
3010 if (!state->m)
3011 panic("state->m == NULL in ipsec4_output");
3012 if (!state->dst)
3013 panic("state->dst == NULL in ipsec4_output");
3035 ip = mtod(state->m, struct ip *);
3068 if (state->m->m_len < hlen + sizeof(struct udphdr)) {
3069 state->m = m_pullup(state->m, hlen + sizeof(struct udphdr));
3070 if (!state->m) {
3076 ip = mtod(state->m, struct ip *);
3117 if (sav->state != SADB_SASTATE_MATURE
3118 && sav->state != SADB_SASTATE_DYING) {
3142 state->m = ipsec4_splithdr(state->m);
3143 if (!state->m) {
3147 error = ipsec4_encapsulate(state->m, sav);
3149 state->m = NULL;
3152 ip = mtod(state->m, struct ip *);
3185 * adjust state->dst if tunnel endpoint is offlink
3187 * XXX: caching rt_gateway value in the state is
3196 if (state->ro.ro_rt != NULL) {
3197 rtfree(state->ro.ro_rt);
3198 state->ro.ro_rt = NULL;
3200 route_copyout(&state->ro, ro4, sizeof(state->ro));
3201 state->dst = (struct sockaddr *)dst4;
3202 state->tunneled = 4;
3207 state->m = ipsec4_splithdr(state->m);
3208 if (!state->m) {
3215 if ((error = esp4_output(state->m, sav)) != 0) {
3216 state->m = NULL;
3221 m_freem(state->m);
3222 state->m = NULL;
3227 if ((error = ah4_output(state->m, sav)) != 0) {
3228 state->m = NULL;
3233 if ((error = ipcomp4_output(state->m, sav)) != 0) {
3234 state->m = NULL;
3242 m_freem(state->m);
3243 state->m = NULL;
3248 if (state->m == 0) {
3252 ip = mtod(state->m, struct ip *);
3263 m_freem(state->m);
3264 state->m = NULL;
3276 struct ipsec_output_state *state,
3293 if (!state)
3294 panic("state == NULL in ipsec6_output_trans");
3295 if (!state->m)
3296 panic("state->m == NULL in ipsec6_output_trans");
3318 ip6 = mtod(state->m, struct ip6_hdr *);
3368 icmp6_error(state->m, ICMP6_DST_UNREACH,
3370 state->m = NULL; /* icmp6_error freed the mbuf */
3389 if (sav->state != SADB_SASTATE_MATURE
3390 && sav->state != SADB_SASTATE_DYING) {
3399 error = esp6_output(state->m, nexthdrp, mprev->m_next, sav);
3401 m_freem(state->m);
3406 error = ah6_output(state->m, nexthdrp, mprev->m_next, sav);
3409 error = ipcomp6_output(state->m, nexthdrp, mprev->m_next, sav);
3414 m_freem(state->m);
3420 state->m = NULL;
3423 plen = state->m->m_pkthdr.len - sizeof(struct ip6_hdr);
3431 ip6 = mtod(state->m, struct ip6_hdr *);
3446 m_freem(state->m);
3447 state->m = NULL;
3456 struct ipsec_output_state *state,
3471 if (!state)
3472 panic("state == NULL in ipsec6_output_tunnel");
3473 if (!state->m)
3474 panic("state->m == NULL in ipsec6_output_tunnel");
3504 ip6 = mtod(state->m, struct ip6_hdr *);
3561 if (sav->state != SADB_SASTATE_MATURE
3562 && sav->state != SADB_SASTATE_DYING) {
3572 state->m = ipsec6_splithdr(state->m);
3573 if (!state->m) {
3580 error = ipsec6_encapsulate(state->m, sav);
3582 state->m = 0;
3585 ip6 = mtod(state->m, struct ip6_hdr *);
3606 state->tunneled = 4; /* must not process any further in ip6_output */
3607 error = ipsec64_encapsulate(state->m, sav);
3609 state->m = 0;
3613 ip = mtod(state->m, struct ip *);
3640 state->m = ipsec4_splithdr(state->m);
3641 if (!state->m) {
3651 if ((error = esp4_output(state->m, sav)) != 0) {
3652 state->m = NULL;
3661 m_freem(state->m);
3662 state->m = NULL;
3670 if ((error = ah4_output(state->m, sav)) != 0) {
3671 state->m = NULL;
3679 if ((error = ipcomp4_output(state->m, sav)) != 0) {
3680 state->m = NULL;
3691 m_freem(state->m);
3692 state->m = NULL;
3700 if (state->m == 0) {
3707 ip = mtod(state->m, struct ip *);
3709 error = ip_output(state->m, NULL, &ro4_copy, IP_OUTARGS, NULL, &ipoa);
3710 state->m = NULL;
3762 * adjust state->dst if tunnel endpoint is offlink
3764 * XXX: caching rt_gateway value in the state is
3773 if (state->ro.ro_rt != NULL) {
3774 rtfree(state->ro.ro_rt);
3775 state->ro.ro_rt = NULL;
3777 route_copyout(&state->ro, ro6, sizeof(state->ro));
3778 state->dst = (struct sockaddr *)dst6;
3779 state->tunneled = 6;
3784 state->m = ipsec6_splithdr(state->m);
3785 if (!state->m) {
3790 ip6 = mtod(state->m, struct ip6_hdr *);
3794 error = esp6_output(state->m, &ip6->ip6_nxt, state->m->m_next, sav);
3796 m_freem(state->m);
3801 error = ah6_output(state->m, &ip6->ip6_nxt, state->m->m_next, sav);
3809 m_freem(state->m);
3815 state->m = NULL;
3818 plen = state->m->m_pkthdr.len - sizeof(struct ip6_hdr);
3826 ip6 = mtod(state->m, struct ip6_hdr *);
3837 if (state->m)
3838 m_freem(state->m);
3839 state->m = NULL;