Lines Matching refs:spidx

178    struct secpolicyindex spidx;	/* secpolicyindex */
619 static struct secpolicy *key_do_allocsp(struct secpolicyindex *spidx, u_int dir);
741 const struct secpolicyindex *spidx,
854 key_do_allocsp(struct secpolicyindex *spidx, u_int dir)
859 IPSEC_ASSERT(spidx != NULL, ("null spidx"));
865 if (key_cmpspidx_withmask(&sp->spidx, spidx)) {
882 key_allocsp(struct secpolicyindex *spidx, u_int dir)
890 sp = key_do_allocsp(spidx, dir);
894 hashv = SPDCACHE_HASHVAL(spidx);
907 if (!key_cmpspidx_exactly(&entry->spidx, spidx)) {
924 sp = key_do_allocsp(spidx, dir);
925 entry = spdcache_entry_alloc(spidx, sp);
946 kdebug_secpolicyindex(spidx, NULL));
1206 IPSEC_ASSERT(sp->spidx.dir == IPSEC_DIR_INBOUND ||
1207 sp->spidx.dir == IPSEC_DIR_OUTBOUND,
1208 ("invalid direction %u", sp->spidx.dir));
1220 TAILQ_REMOVE(&V_sptree[sp->spidx.dir], sp, chain);
1239 TAILQ_FOREACH(sp, &V_sptree[newsp->spidx.dir], chain) {
1245 TAILQ_INSERT_TAIL(&V_sptree[newsp->spidx.dir], newsp, chain);
1275 IPSEC_ASSERT(spp[i]->spidx.dir == IPSEC_DIR_INBOUND ||
1276 spp[i]->spidx.dir == IPSEC_DIR_OUTBOUND,
1277 ("invalid direction %u", spp[i]->spidx.dir));
1285 TAILQ_INSERT_TAIL(&V_sptree_ifnet[spp[i]->spidx.dir],
1316 IPSEC_ASSERT(spp[i]->spidx.dir == IPSEC_DIR_INBOUND ||
1317 spp[i]->spidx.dir == IPSEC_DIR_OUTBOUND,
1318 ("invalid direction %u", spp[i]->spidx.dir));
1323 TAILQ_REMOVE(&V_sptree_ifnet[spp[i]->spidx.dir],
1402 key_getsp(struct secpolicyindex *spidx)
1407 IPSEC_ASSERT(spidx != NULL, ("null spidx"));
1410 TAILQ_FOREACH(sp, &V_sptree[spidx->dir], chain) {
1411 if (key_cmpspidx_exactly(spidx, &sp->spidx)) {
1493 newsp->spidx.dir = xpl0->sadb_x_policy_dir;
1797 xpl->sadb_x_policy_dir = sp->spidx.dir;
1942 struct secpolicyindex spidx;
2022 &spidx);
2024 newsp = key_getsp(&spidx);
2049 bcopy(&spidx, &newsp->spidx, sizeof(spidx));
2163 struct secpolicyindex spidx;
2222 &spidx);
2225 if ((sp = key_getsp(&spidx)) == NULL) {
2437 newspacq = key_getspacq(&sp->spidx);
2451 newspacq = key_newspacq(&sp->spidx);
2638 &sp->spidx.src.sa, sp->spidx.prefs,
2639 sp->spidx.ul_proto);
2645 &sp->spidx.dst.sa, sp->spidx.prefd,
2646 sp->spidx.ul_proto);
2777 &sp->spidx.src.sa,
2778 sp->spidx.prefs, sp->spidx.ul_proto);
2787 &sp->spidx.dst.sa,
2788 sp->spidx.prefd, sp->spidx.ul_proto);
4219 /* if spidx.ul_proto == IPSEC_ULPROTO_ANY, ignore. */
4453 TAILQ_REMOVE(&V_sptree[sp->spidx.dir], sp, chain);
6581 if (sp != NULL && (sp->spidx.ul_proto == IPPROTO_TCP ||
6582 sp->spidx.ul_proto == IPPROTO_UDP))
6583 ul_proto = sp->spidx.ul_proto;
6588 switch (sp->spidx.src.sa.sa_family) {
6590 if (sp->spidx.src.sin.sin_port != IPSEC_PORT_ANY) {
6591 addr.sin.sin_port = sp->spidx.src.sin.sin_port;
6592 mask = sp->spidx.prefs;
6596 if (sp->spidx.src.sin6.sin6_port != IPSEC_PORT_ANY) {
6598 sp->spidx.src.sin6.sin6_port;
6599 mask = sp->spidx.prefs;
6616 switch (sp->spidx.dst.sa.sa_family) {
6618 if (sp->spidx.dst.sin.sin_port != IPSEC_PORT_ANY) {
6619 addr.sin.sin_port = sp->spidx.dst.sin.sin_port;
6620 mask = sp->spidx.prefd;
6624 if (sp->spidx.dst.sin6.sin6_port != IPSEC_PORT_ANY) {
6626 sp->spidx.dst.sin6.sin6_port;
6627 mask = sp->spidx.prefd;
6647 m = key_setsadbxpolicy(sp->policy, sp->spidx.dir, sp->id,
6883 key_newspacq(struct secpolicyindex *spidx)
6895 bcopy(spidx, &acq->spidx, sizeof(acq->spidx));
6908 key_getspacq(struct secpolicyindex *spidx)
6914 if (key_cmpspidx_exactly(spidx, &acq->spidx)) {
8201 spdcache_entry_alloc(const struct secpolicyindex *spidx, struct secpolicy *sp)
8213 entry->spidx = *spidx;