Lines Matching refs:saidx
666 if (p->saidx.mode != IPSEC_MODE_TUNNEL)
683 is = (struct sockaddr *)&r1->saidx.src;
684 id = (struct sockaddr *)&r1->saidx.dst;
690 os = (struct sockaddr *)&r2->saidx.src;
691 od = (struct sockaddr *)&r2->saidx.dst;
717 key_checkrequest(isr, saidx, sav)
719 struct secasindex *saidx;
731 if (isr == NULL || saidx == NULL)
735 switch (saidx->mode) {
753 *sav = key_allocsa_policy(saidx);
764 if (saidx->mode == IPSEC_MODE_TRANSPORT) {
765 sin = (struct sockaddr_in *)&saidx->dst;
768 if ((error = key_acquire(saidx, isr->sp)) != 0) {
787 key_allocsa_policy(saidx)
788 struct secasindex *saidx;
804 if (key_cmpsaidx(&sah->saidx, saidx, CMP_MODE | CMP_REQID))
825 sin = (struct sockaddr_in *)&saidx->dst;
827 if (saidx->mode == IPSEC_MODE_TRANSPORT)
875 if (sah->saidx.mode == IPSEC_MODE_TUNNEL && dstport &&
880 if (sah->saidx.mode == IPSEC_MODE_TRANSPORT &&
885 if ((sah->saidx.mode == IPSEC_MODE_TUNNEL &&
887 (sah->saidx.mode == IPSEC_MODE_TRANSPORT &&
944 d->sah->saidx.proto, 0, 0, d->refcnt - 1);
949 /* set sadb_address for saidx's. */
951 (struct sockaddr *)&d->sah->saidx.src,
952 d->sah->saidx.src.ss_len << 3,
958 /* set sadb_address for saidx's. */
960 (struct sockaddr *)&d->sah->saidx.src,
961 d->sah->saidx.src.ss_len << 3,
999 else if (sah->saidx.mode == IPSEC_MODE_TUNNEL && dstport)
1079 if (proto != sav->sah->saidx.proto)
1081 if (family != sav->sah->saidx.src.ss_family ||
1082 family != sav->sah->saidx.dst.ss_family)
1105 (struct sockaddr *)&sav->sah->saidx.src, 0) != 0)
1121 (struct sockaddr *)&sav->sah->saidx.src, 0) != 0)
1141 (struct sockaddr *)&sav->sah->saidx.dst, 0) != 0)
1158 (struct sockaddr *)&sav->sah->saidx.dst, 0) != 0)
1191 struct secasindex saidx;
1198 saidx.mode = outsav->sah->saidx.mode;
1199 saidx.reqid = 0;
1200 saidx.proto = outsav->sah->saidx.proto;
1201 bcopy(&outsav->sah->saidx.src, &saidx.dst, sizeof(struct sockaddr_in));
1202 bcopy(&outsav->sah->saidx.dst, &saidx.src, sizeof(struct sockaddr_in));
1208 if (key_cmpsaidx(&sah->saidx, &saidx, CMP_MODE))
1680 (*p_isr)->saidx.proto = xisr->sadb_x_ipsecrequest_proto;
1695 (*p_isr)->saidx.mode = xisr->sadb_x_ipsecrequest_mode;
1725 (*p_isr)->saidx.reqid = reqid;
1729 (*p_isr)->saidx.reqid =
1751 > sizeof((*p_isr)->saidx.src)) {
1758 bcopy(paddr, &(*p_isr)->saidx.src,
1766 > sizeof((*p_isr)->saidx.dst)) {
1773 bcopy(paddr, &(*p_isr)->saidx.dst,
1868 xisr->sadb_x_ipsecrequest_proto = isr->saidx.proto;
1869 xisr->sadb_x_ipsecrequest_mode = isr->saidx.mode;
1871 xisr->sadb_x_ipsecrequest_reqid = isr->saidx.reqid;
1874 bcopy(&isr->saidx.src, p, isr->saidx.src.ss_len);
1875 p += isr->saidx.src.ss_len;
1876 bcopy(&isr->saidx.dst, p, isr->saidx.dst.ss_len);
1877 p += isr->saidx.src.ss_len;
1881 + isr->saidx.src.ss_len
1882 + isr->saidx.dst.ss_len);
2117 if (newsp->req && newsp->req->saidx.src.ss_family) {
2120 if (sa->sa_family != newsp->req->saidx.src.ss_family) {
2121 if (newsp->req->saidx.mode != IPSEC_MODE_TUNNEL || newsp->req->saidx.proto != IPPROTO_ESP
2122 || sa->sa_family != AF_INET6 || newsp->req->saidx.src.ss_family != AF_INET) {
2128 if (newsp->req && newsp->req->saidx.dst.ss_family) {
2131 if (sa->sa_family != newsp->req->saidx.dst.ss_family) {
2132 if (newsp->req->saidx.mode != IPSEC_MODE_TUNNEL || newsp->req->saidx.proto != IPPROTO_ESP
2133 || sa->sa_family != AF_INET6 || newsp->req->saidx.dst.ss_family != AF_INET) {
2811 + isr->saidx.src.ss_len
2812 + isr->saidx.dst.ss_len;
2942 key_newsah(saidx)
2943 struct secasindex *saidx;
2948 if (saidx == NULL)
2955 bcopy(saidx, &newsah->saidx, sizeof(newsah->saidx));
2958 switch (saidx->src.ss_family) {
2960 ((struct sockaddr_in *)(&newsah->saidx.src))->sin_port = IPSEC_PORT_ANY;
2963 ((struct sockaddr_in6 *)(&newsah->saidx.src))->sin6_port = IPSEC_PORT_ANY;
2968 switch (saidx->dst.ss_family) {
2970 ((struct sockaddr_in *)(&newsah->saidx.dst))->sin_port = IPSEC_PORT_ANY;
2973 ((struct sockaddr_in6 *)(&newsah->saidx.dst))->sin6_port = IPSEC_PORT_ANY;
3227 key_getsah(saidx)
3228 struct secasindex *saidx;
3237 if (key_cmpsaidx(&sah->saidx, saidx, CMP_REQID))
3252 key_checkspidup(saidx, spi)
3253 struct secasindex *saidx;
3262 if (saidx->src.ss_family != saidx->dst.ss_family) {
3276 key_ismyaddr((struct sockaddr *)&sav->sah->saidx.dst))
3671 switch (sav->sah->saidx.proto) {
3684 switch (sav->sah->saidx.proto) {
3870 m = key_setsadbxsa2(sav->sah->saidx.mode,
3872 sav->sah->saidx.reqid);
3879 (struct sockaddr *)&sav->sah->saidx.src,
3887 (struct sockaddr *)&sav->sah->saidx.dst,
5167 struct secasindex saidx;
5244 KEY_SETSECASIDX(proto, mode, reqid, src0 + 1, dst0 + 1, &saidx);
5250 &saidx);
5257 if ((newsah = key_getsah(&saidx)) == NULL) {
5259 if ((newsah = key_newsah(&saidx)) == NULL) {
5371 key_do_getnewspi(spirange, saidx)
5373 struct secasindex *saidx;
5390 if (saidx->proto == IPPROTO_IPCOMP) {
5402 if (key_checkspidup(saidx, keymin) != NULL) {
5424 if (key_checkspidup(saidx, newspi) == NULL)
5462 struct secasindex saidx;
5516 KEY_SETSECASIDX(proto, mode, reqid, src0 + 1, dst0 + 1, &saidx);
5521 if ((sah = key_getsah(&saidx)) == NULL) {
5556 if (sav->sah->saidx.proto != proto) {
5560 sav->sah->saidx.proto, proto));
5594 (sav->sah->saidx.mode != IPSEC_MODE_TRANSPORT ||
5595 sav->sah->saidx.src.ss_family != AF_INET))
5684 struct secasindex saidx;
5738 KEY_SETSECASIDX(proto, mode, reqid, src0 + 1, dst0 + 1, &saidx);
5743 if ((newsah = key_getsah(&saidx)) == NULL) {
5745 if ((newsah = key_newsah(&saidx)) == NULL) {
5778 (newsah->saidx.mode != IPSEC_MODE_TRANSPORT ||
5779 newsah->saidx.dst.ss_family != AF_INET))
5951 struct secasindex saidx;
6002 KEY_SETSECASIDX(proto, IPSEC_MODE_ANY, 0, src0 + 1, dst0 + 1, &saidx);
6008 if (key_cmpsaidx(&sah->saidx, &saidx, CMP_HEAD) == 0)
6064 struct secasindex saidx;
6075 KEY_SETSECASIDX(proto, IPSEC_MODE_ANY, 0, src0 + 1, dst0 + 1, &saidx);
6080 if (key_cmpsaidx(&sah->saidx, &saidx, CMP_HEAD) == 0)
6154 struct secasindex saidx;
6189 KEY_SETSECASIDX(proto, IPSEC_MODE_ANY, 0, src0 + 1, dst0 + 1, &saidx);
6197 if (key_cmpsaidx(&sah->saidx, &saidx, CMP_HEAD) == 0)
6216 if ((satype = key_proto2satype(sah->saidx.proto)) == 0) {
6446 key_getprop(saidx)
6447 const struct secasindex *saidx;
6454 switch (saidx->proto) {
6510 key_acquire(saidx, sp)
6511 struct secasindex *saidx;
6525 if (saidx == NULL)
6527 if ((satype = key_proto2satype(saidx->proto)) == 0)
6539 if ((newacq = key_getacq(saidx)) != NULL) {
6551 if ((newacq = key_newacq(saidx)) == NULL) {
6572 /* set sadb_address for saidx's. */
6574 (struct sockaddr *)&saidx->src, FULLMASK, IPSEC_ULPROTO_ANY);
6582 (struct sockaddr *)&saidx->dst, FULLMASK, IPSEC_ULPROTO_ANY);
6645 m = key_getprop(saidx);
6695 key_newacq(saidx)
6696 struct secasindex *saidx;
6715 bcopy(saidx, &newacq->saidx, sizeof(newacq->saidx));
6725 key_getacq(saidx)
6726 struct secasindex *saidx;
6733 if (key_cmpsaidx(saidx, &acq->saidx, CMP_EXACTLY))
6823 struct secasindex saidx;
6906 KEY_SETSECASIDX(proto, IPSEC_MODE_ANY, 0, src0 + 1, dst0 + 1, &saidx);
6912 if (key_cmpsaidx(&sah->saidx, &saidx, CMP_MODE | CMP_REQID))
6921 error = key_acquire(&saidx, NULL);
7171 if ((satype = key_proto2satype(sav->sah->saidx.proto)) == 0)
7191 m = key_setsadbxsa2(sav->sah->saidx.mode,
7193 sav->sah->saidx.reqid);
7223 (struct sockaddr *)&sav->sah->saidx.src,
7233 (struct sockaddr *)&sav->sah->saidx.dst,
7313 && proto != sah->saidx.proto)
7416 && proto != sah->saidx.proto)
7420 if ((satype = key_proto2satype(sah->saidx.proto)) == 0) {