Lines Matching refs:spidx
322 /* set spidx in pcb */
327 /* set spidx in pcb */
371 kernsp = key_allocsp(&currsp->spidx, dir);
418 kernsp = key_allocsp(&currsp->spidx, dir);
502 struct secpolicyindex spidx;
505 bzero(&spidx, sizeof(spidx));
508 *error = ipsec_setspidx_mbuf(&spidx, dir, AF_INET, m,
516 sp = key_allocsp(&spidx, dir);
584 /* set spidx in pcb */
618 kernsp = key_allocsp(&currsp->spidx, dir);
661 kernsp = key_allocsp(&currsp->spidx, dir);
744 struct secpolicyindex spidx;
746 bzero(&spidx, sizeof(spidx));
749 *error = ipsec_setspidx_mbuf(&spidx, dir, AF_INET6, m,
755 sp = key_allocsp(&spidx, dir);
783 * set IP address into spidx from mbuf.
794 struct secpolicyindex *spidx,
803 if (spidx == NULL || m == NULL)
806 bzero(spidx, sizeof(*spidx));
808 error = ipsec_setspidx(m, spidx, needport);
811 spidx->dir = dir;
817 bzero(spidx, sizeof(*spidx));
826 struct secpolicyindex *spidx;
840 bzero(&pcb->inp_sp->sp_in->spidx, sizeof(*spidx));
841 bzero(&pcb->inp_sp->sp_out->spidx, sizeof(*spidx));
843 spidx = &pcb->inp_sp->sp_in->spidx;
844 error = ipsec_setspidx(m, spidx, 1);
847 spidx->dir = IPSEC_DIR_INBOUND;
849 spidx = &pcb->inp_sp->sp_out->spidx;
850 error = ipsec_setspidx(m, spidx, 1);
853 spidx->dir = IPSEC_DIR_OUTBOUND;
858 bzero(&pcb->inp_sp->sp_in->spidx, sizeof(*spidx));
859 bzero(&pcb->inp_sp->sp_out->spidx, sizeof(*spidx));
869 struct secpolicyindex *spidx;
880 bzero(&pcb->in6p_sp->sp_in->spidx, sizeof(*spidx));
881 bzero(&pcb->in6p_sp->sp_out->spidx, sizeof(*spidx));
883 spidx = &pcb->in6p_sp->sp_in->spidx;
884 error = ipsec_setspidx(m, spidx, 1);
887 spidx->dir = IPSEC_DIR_INBOUND;
889 spidx = &pcb->in6p_sp->sp_out->spidx;
890 error = ipsec_setspidx(m, spidx, 1);
893 spidx->dir = IPSEC_DIR_OUTBOUND;
898 bzero(&pcb->in6p_sp->sp_in->spidx, sizeof(*spidx));
899 bzero(&pcb->in6p_sp->sp_out->spidx, sizeof(*spidx));
907 * the caller is responsible for error recovery (like clearing up spidx).
910 ipsec_setspidx(m, spidx, needport)
912 struct secpolicyindex *spidx;
963 error = ipsec4_setspidx_ipaddr(m, spidx);
966 ipsec4_get_ulp(m, spidx, needport);
977 error = ipsec6_setspidx_ipaddr(m, spidx);
980 ipsec6_get_ulp(m, spidx, needport);
992 ipsec4_get_ulp(m, spidx, needport)
994 struct secpolicyindex *spidx;
1011 spidx->ul_proto = IPSEC_ULPROTO_ANY;
1012 ((struct sockaddr_in *)&spidx->src)->sin_port = IPSEC_PORT_ANY;
1013 ((struct sockaddr_in *)&spidx->dst)->sin_port = IPSEC_PORT_ANY;
1029 spidx->ul_proto = nxt;
1035 ((struct sockaddr_in *)&spidx->src)->sin_port =
1037 ((struct sockaddr_in *)&spidx->dst)->sin_port =
1041 spidx->ul_proto = nxt;
1047 ((struct sockaddr_in *)&spidx->src)->sin_port =
1049 ((struct sockaddr_in *)&spidx->dst)->sin_port =
1062 spidx->ul_proto = nxt;
1070 ipsec4_setspidx_ipaddr(m, spidx)
1072 struct secpolicyindex *spidx;
1085 sin = (struct sockaddr_in *)&spidx->src;
1090 spidx->prefs = sizeof(struct in_addr) << 3;
1092 sin = (struct sockaddr_in *)&spidx->dst;
1097 spidx->prefd = sizeof(struct in_addr) << 3;
1103 ipsec6_get_ulp(m, spidx, needport)
1105 struct secpolicyindex *spidx;
1120 spidx->ul_proto = IPSEC_ULPROTO_ANY;
1121 ((struct sockaddr_in6 *)&spidx->src)->sin6_port = IPSEC_PORT_ANY;
1122 ((struct sockaddr_in6 *)&spidx->dst)->sin6_port = IPSEC_PORT_ANY;
1131 spidx->ul_proto = nxt;
1137 ((struct sockaddr_in6 *)&spidx->src)->sin6_port = th.th_sport;
1138 ((struct sockaddr_in6 *)&spidx->dst)->sin6_port = th.th_dport;
1141 spidx->ul_proto = nxt;
1147 ((struct sockaddr_in6 *)&spidx->src)->sin6_port = uh.uh_sport;
1148 ((struct sockaddr_in6 *)&spidx->dst)->sin6_port = uh.uh_dport;
1153 spidx->ul_proto = nxt;
1160 ipsec6_setspidx_ipaddr(m, spidx)
1162 struct secpolicyindex *spidx;
1175 sin6 = (struct sockaddr_in6 *)&spidx->src;
1184 spidx->prefs = sizeof(struct in6_addr) << 3;
1186 sin6 = (struct sockaddr_in6 *)&spidx->dst;
1195 spidx->prefd = sizeof(struct in6_addr) << 3;
1678 if (((struct sockaddr *)&isr->sp->spidx.src)->sa_family
1679 != ((struct sockaddr *)&isr->sp->spidx.dst)->sa_family)
1695 switch (((struct sockaddr *)&isr->sp->spidx.src)->sa_family) {
1714 ((struct sockaddr *)&isr->sp->spidx.src)->sa_family);