Lines Matching refs:key
400 *state = pf_find_state(kif, &key, direction); \
1101 pf_find_state_byid(struct pf_state_cmp *key)
1106 (struct pf_state *)(void *)key));
1110 pf_find_state(struct pfi_kif *kif, struct pf_state_key_cmp *key, u_int dir)
1120 (struct pf_state_key *)key);
1124 (struct pf_state_key *)key);
1140 pf_find_state_all(struct pf_state_key_cmp *key, u_int dir, int *more)
1150 &pf_statetbl_lan_ext, (struct pf_state_key *)key);
1154 &pf_statetbl_ext_gwy, (struct pf_state_key *)key);
1417 /* key exists. check for same kif, if none, add to key */
1429 /* if cur != NULL, we already found a state key and attached to it */
2945 struct pf_poolhashkey *key, sa_family_t af)
2947 u_int32_t a = 0x9e3779b9, b = 0x9e3779b9, c = key->key32[0];
2953 b += key->key32[1];
2955 hash->addr32[0] = c + key->key32[2];
2966 c += key->key32[1];
2971 c += key->key32[2];
2976 c += key->key32[3];
3100 &rpool->key, af);
3174 struct pf_state_key_cmp key;
3251 key.af = af;
3252 key.proto = proto;
3253 PF_ACPY(&key.ext.addr, daddr, key.af);
3254 PF_ACPY(&key.gwy.addr, naddr, key.af);
3257 key.proto_variant = r->extfilter;
3260 key.proto_variant = 0;
3264 key.ext.xport = *dxport;
3266 memset(&key.ext.xport, 0, sizeof (key.ext.xport));
3274 key.gwy.xport = *dxport;
3276 memset(&key.gwy.xport, 0,
3277 sizeof (key.ext.xport));
3278 if (pf_find_state_all(&key, PF_IN, NULL) == NULL)
3281 key.gwy.xport = *nxport;
3282 if (pf_find_state_all(&key, PF_IN, NULL) == NULL)
3285 key.gwy.xport.port = htons(low);
3286 if (pf_find_state_all(&key, PF_IN, NULL) == NULL) {
3301 key.gwy.xport.port = htons(tmp);
3302 if (pf_find_state_all(&key, PF_IN, NULL) ==
3309 key.gwy.xport.port = htons(tmp);
3310 if (pf_find_state_all(&key, PF_IN, NULL) ==
3956 /* initialize state key from psk, if provided */
4626 /* prepare state key, for flowhash and/or the state (if created) */
4921 /* allocate state key and import values from psk */
5644 struct pf_state_key_cmp key;
5646 key.af = gsk->af;
5647 key.proto = IPPROTO_GRE;
5648 key.proto_variant = PF_GRE_PPTP_VARIANT;
5649 PF_ACPY(&key.gwy.addr, &gsk->gwy.addr, key.af);
5650 PF_ACPY(&key.ext.addr, &gsk->ext.addr, key.af);
5651 key.gwy.xport.call_id = gsk->gwy.xport.call_id;
5652 key.ext.xport.call_id = gsk->ext.xport.call_id;
5657 while (pf_find_state_all(&key, PF_IN, 0)) {
5663 key.gwy.xport.call_id = call_id;
5669 key.gwy.xport.call_id = 0;
5795 struct pf_state_key_cmp key;
5804 key.app_state = 0;
5805 key.af = pd->af;
5806 key.proto = IPPROTO_TCP;
5808 PF_ACPY(&key.ext.addr, pd->src, key.af);
5809 PF_ACPY(&key.gwy.addr, pd->dst, key.af);
5810 key.ext.xport.port = th->th_sport;
5811 key.gwy.xport.port = th->th_dport;
5813 PF_ACPY(&key.lan.addr, pd->src, key.af);
5814 PF_ACPY(&key.ext.addr, pd->dst, key.af);
5815 key.lan.xport.port = th->th_sport;
5816 key.ext.xport.port = th->th_dport;
6319 struct pf_state_key_cmp key;
6323 key.app_state = 0;
6324 key.proto_variant = PF_EXTFILTER_APD;
6326 key.af = pd->af;
6327 key.proto = IPPROTO_UDP;
6329 PF_ACPY(&key.ext.addr, pd->src, key.af);
6330 PF_ACPY(&key.gwy.addr, pd->dst, key.af);
6331 key.ext.xport.port = uh->uh_sport;
6332 key.gwy.xport.port = uh->uh_dport;
6335 PF_ACPY(&key.lan.addr, pd->src, key.af);
6336 PF_ACPY(&key.ext.addr, pd->dst, key.af);
6337 key.lan.xport.port = uh->uh_sport;
6338 key.ext.xport.port = uh->uh_dport;
6357 key.app_state = &as;
6374 *state = pf_find_state(kif, &key, dx);
6376 if (!key.app_state && *state == 0) {
6377 key.proto_variant = PF_EXTFILTER_AD;
6378 *state = pf_find_state(kif, &key, dx);
6381 if (!key.app_state && *state == 0) {
6382 key.proto_variant = PF_EXTFILTER_EI;
6383 *state = pf_find_state(kif, &key, dx);
6416 (*state)->state_key->ext.xport.port = key.ext.xport.port;
6419 &key.ext.addr, key.af);
6466 struct pf_state_key_cmp key;
6469 key.app_state = 0;
6507 key.af = pd->af;
6508 key.proto = pd->proto;
6510 PF_ACPY(&key.ext.addr, pd->src, key.af);
6511 PF_ACPY(&key.gwy.addr, pd->dst, key.af);
6512 key.ext.xport.port = 0;
6513 key.gwy.xport.port = icmpid;
6515 PF_ACPY(&key.lan.addr, pd->src, key.af);
6516 PF_ACPY(&key.ext.addr, pd->dst, key.af);
6517 key.lan.xport.port = icmpid;
6518 key.ext.xport.port = 0;
6733 key.af = pd2.af;
6734 key.proto = IPPROTO_TCP;
6736 PF_ACPY(&key.ext.addr, pd2.dst, key.af);
6737 PF_ACPY(&key.gwy.addr, pd2.src, key.af);
6738 key.ext.xport.port = th.th_dport;
6739 key.gwy.xport.port = th.th_sport;
6741 PF_ACPY(&key.lan.addr, pd2.dst, key.af);
6742 PF_ACPY(&key.ext.addr, pd2.src, key.af);
6743 key.lan.xport.port = th.th_dport;
6744 key.ext.xport.port = th.th_sport;
6844 key.af = pd2.af;
6845 key.proto = IPPROTO_UDP;
6847 PF_ACPY(&key.ext.addr, pd2.dst, key.af);
6848 PF_ACPY(&key.gwy.addr, pd2.src, key.af);
6849 key.ext.xport.port = uh.uh_dport;
6850 key.gwy.xport.port = uh.uh_sport;
6853 PF_ACPY(&key.lan.addr, pd2.dst, key.af);
6854 PF_ACPY(&key.ext.addr, pd2.src, key.af);
6855 key.lan.xport.port = uh.uh_dport;
6856 key.ext.xport.port = uh.uh_sport;
6860 key.proto_variant = PF_EXTFILTER_APD;
6879 key.app_state = &as;
6885 *state = pf_find_state(kif, &key, dx);
6887 if (key.app_state && *state == 0) {
6888 key.app_state = 0;
6889 *state = pf_find_state(kif, &key, dx);
6893 key.proto_variant = PF_EXTFILTER_AD;
6894 *state = pf_find_state(kif, &key, dx);
6898 key.proto_variant = PF_EXTFILTER_EI;
6899 *state = pf_find_state(kif, &key, dx);
6963 key.af = pd2.af;
6964 key.proto = IPPROTO_ICMP;
6966 PF_ACPY(&key.ext.addr, pd2.dst, key.af);
6967 PF_ACPY(&key.gwy.addr, pd2.src, key.af);
6968 key.ext.xport.port = 0;
6969 key.gwy.xport.port = iih.icmp_id;
6971 PF_ACPY(&key.lan.addr, pd2.dst, key.af);
6972 PF_ACPY(&key.ext.addr, pd2.src, key.af);
6973 key.lan.xport.port = iih.icmp_id;
6974 key.ext.xport.port = 0;
7017 key.af = pd2.af;
7018 key.proto = IPPROTO_ICMPV6;
7020 PF_ACPY(&key.ext.addr, pd2.dst, key.af);
7021 PF_ACPY(&key.gwy.addr, pd2.src, key.af);
7022 key.ext.xport.port = 0;
7023 key.gwy.xport.port = iih.icmp6_id;
7025 PF_ACPY(&key.lan.addr, pd2.dst, key.af);
7026 PF_ACPY(&key.ext.addr, pd2.src, key.af);
7027 key.lan.xport.port = iih.icmp6_id;
7028 key.ext.xport.port = 0;
7063 key.af = pd2.af;
7064 key.proto = pd2.proto;
7066 PF_ACPY(&key.ext.addr, pd2.dst, key.af);
7067 PF_ACPY(&key.gwy.addr, pd2.src, key.af);
7068 key.ext.xport.port = 0;
7069 key.gwy.xport.port = 0;
7071 PF_ACPY(&key.lan.addr, pd2.dst, key.af);
7072 PF_ACPY(&key.ext.addr, pd2.src, key.af);
7073 key.lan.xport.port = 0;
7074 key.ext.xport.port = 0;
7130 struct pf_state_key_cmp key;
7134 key.app_state = 0;
7135 key.af = pd->af;
7136 key.proto = IPPROTO_GRE;
7137 key.proto_variant = PF_GRE_PPTP_VARIANT;
7139 PF_ACPY(&key.ext.addr, pd->src, key.af);
7140 PF_ACPY(&key.gwy.addr, pd->dst, key.af);
7141 key.gwy.xport.call_id = grev1->call_id;
7143 PF_ACPY(&key.lan.addr, pd->src, key.af);
7144 PF_ACPY(&key.ext.addr, pd->dst, key.af);
7145 key.ext.xport.call_id = grev1->call_id;
7232 struct pf_state_key_cmp key;
7236 memset(&key, 0, sizeof (key));
7237 key.af = pd->af;
7238 key.proto = IPPROTO_ESP;
7240 PF_ACPY(&key.ext.addr, pd->src, key.af);
7241 PF_ACPY(&key.gwy.addr, pd->dst, key.af);
7242 key.gwy.xport.spi = esp->spi;
7244 PF_ACPY(&key.lan.addr, pd->src, key.af);
7245 PF_ACPY(&key.ext.addr, pd->dst, key.af);
7246 key.ext.xport.spi = esp->spi;
7249 *state = pf_find_state(kif, &key, direction);
7261 key.gwy.xport.spi = 0;
7263 s = pf_find_state(kif, &key, direction);
7279 key.ext.xport.spi = 0;
7281 s = pf_find_state(kif, &key, direction);
7388 struct pf_state_key_cmp key;
7390 key.app_state = 0;
7391 key.af = pd->af;
7392 key.proto = pd->proto;
7394 PF_ACPY(&key.ext.addr, pd->src, key.af);
7395 PF_ACPY(&key.gwy.addr, pd->dst, key.af);
7396 key.ext.xport.port = 0;
7397 key.gwy.xport.port = 0;
7399 PF_ACPY(&key.lan.addr, pd->src, key.af);
7400 PF_ACPY(&key.ext.addr, pd->dst, key.af);
7401 key.lan.xport.port = 0;
7402 key.ext.xport.port = 0;