Lines Matching refs:pkt
931 dyn_update_tcp_state(struct dyn_data *data, const struct ipfw_flow_id *pkt,
940 th_flags = pkt->_flags & (TH_FIN | TH_SYN | TH_RST);
1006 dyn_update_proto_state(struct dyn_data *data, const struct ipfw_flow_id *pkt,
1012 switch (pkt->proto) {
1018 expire = dyn_update_tcp_state(data, pkt, ulp, dir);
1041 dyn_lookup_ipv4_state(const struct ipfw_flow_id *pkt, const void *ulp,
1055 if (s->proto != pkt->proto)
1059 if (s->sport == pkt->src_port && s->dport == pkt->dst_port &&
1060 s->src == pkt->src_ip && s->dst == pkt->dst_ip) {
1064 if (s->sport == pkt->dst_port && s->dport == pkt->src_port &&
1065 s->src == pkt->dst_ip && s->dst == pkt->src_ip) {
1072 dyn_update_proto_state(s->data, pkt, ulp, pktlen,
1082 dyn_lookup_ipv4_state_locked(const struct ipfw_flow_id *pkt,
1091 if (s->proto != pkt->proto ||
1094 if (s->sport == pkt->src_port &&
1095 s->dport == pkt->dst_port &&
1096 s->src == pkt->src_ip && s->dst == pkt->dst_ip) {
1100 if (s->sport == pkt->dst_port && s->dport == pkt->src_port &&
1101 s->src == pkt->dst_ip && s->dst == pkt->src_ip) {
1107 dyn_update_proto_state(s->data, pkt, ulp, pktlen, dir);
1112 dyn_lookup_ipv4_parent(const struct ipfw_flow_id *pkt, const void *rule,
1133 s->proto == pkt->proto &&
1134 s->sport == pkt->src_port &&
1135 s->dport == pkt->dst_port &&
1136 s->src == pkt->src_ip && s->dst == pkt->dst_ip) {
1148 dyn_lookup_ipv4_parent_locked(const struct ipfw_flow_id *pkt,
1158 s->proto == pkt->proto &&
1159 s->sport == pkt->src_port &&
1160 s->dport == pkt->dst_port &&
1161 s->src == pkt->src_ip && s->dst == pkt->dst_ip)
1188 dyn_lookup_ipv6_state(const struct ipfw_flow_id *pkt, uint32_t zoneid,
1202 if (s->proto != pkt->proto || s->zoneid != zoneid)
1206 if (s->sport == pkt->src_port && s->dport == pkt->dst_port &&
1207 IN6_ARE_ADDR_EQUAL(&s->src, &pkt->src_ip6) &&
1208 IN6_ARE_ADDR_EQUAL(&s->dst, &pkt->dst_ip6)) {
1212 if (s->sport == pkt->dst_port && s->dport == pkt->src_port &&
1213 IN6_ARE_ADDR_EQUAL(&s->src, &pkt->dst_ip6) &&
1214 IN6_ARE_ADDR_EQUAL(&s->dst, &pkt->src_ip6)) {
1220 dyn_update_proto_state(s->data, pkt, ulp, pktlen,
1230 dyn_lookup_ipv6_state_locked(const struct ipfw_flow_id *pkt, uint32_t zoneid,
1239 if (s->proto != pkt->proto || s->kidx != kidx ||
1242 if (s->sport == pkt->src_port && s->dport == pkt->dst_port &&
1243 IN6_ARE_ADDR_EQUAL(&s->src, &pkt->src_ip6) &&
1244 IN6_ARE_ADDR_EQUAL(&s->dst, &pkt->dst_ip6)) {
1248 if (s->sport == pkt->dst_port && s->dport == pkt->src_port &&
1249 IN6_ARE_ADDR_EQUAL(&s->src, &pkt->dst_ip6) &&
1250 IN6_ARE_ADDR_EQUAL(&s->dst, &pkt->src_ip6)) {
1256 dyn_update_proto_state(s->data, pkt, ulp, pktlen, dir);
1261 dyn_lookup_ipv6_parent(const struct ipfw_flow_id *pkt, uint32_t zoneid,
1282 s->proto == pkt->proto &&
1283 s->sport == pkt->src_port &&
1284 s->dport == pkt->dst_port && s->zoneid == zoneid &&
1285 IN6_ARE_ADDR_EQUAL(&s->src, &pkt->src_ip6) &&
1286 IN6_ARE_ADDR_EQUAL(&s->dst, &pkt->dst_ip6)) {
1298 dyn_lookup_ipv6_parent_locked(const struct ipfw_flow_id *pkt, uint32_t zoneid,
1308 s->proto == pkt->proto &&
1309 s->sport == pkt->src_port &&
1310 s->dport == pkt->dst_port && s->zoneid == zoneid &&
1311 IN6_ARE_ADDR_EQUAL(&s->src, &pkt->src_ip6) &&
1312 IN6_ARE_ADDR_EQUAL(&s->dst, &pkt->dst_ip6))
1322 * pkt - filled by ipfw_chk() ipfw_flow_id;
1483 const struct ipfw_flow_id *pkt, const void *ulp, int pktlen,
1505 dyn_update_proto_state(data, pkt, ulp, pktlen, MATCH_FORWARD);
1510 dyn_alloc_ipv4_state(const struct ipfw_flow_id *pkt, uint16_t kidx,
1521 s->proto = pkt->proto;
1522 s->sport = pkt->src_port;
1523 s->dport = pkt->dst_port;
1524 s->src = pkt->src_ip;
1525 s->dst = pkt->dst_ip;
1538 const struct ipfw_flow_id *pkt, uint32_t hashval, uint32_t version,
1552 s = dyn_lookup_ipv4_parent_locked(pkt, rule, ruleid,
1572 s = dyn_alloc_ipv4_state(pkt, kidx, O_LIMIT_PARENT);
1591 const struct ipfw_flow_id *pkt, const void *ulp, int pktlen,
1609 if (dyn_lookup_ipv4_state_locked(pkt, ulp, pktlen,
1616 data = dyn_alloc_dyndata(parent, ruleid, rulenum, pkt, ulp,
1623 s = dyn_alloc_ipv4_state(pkt, kidx, type);
1640 dyn_alloc_ipv6_state(const struct ipfw_flow_id *pkt, uint32_t zoneid,
1652 s->proto = pkt->proto;
1653 s->sport = pkt->src_port;
1654 s->dport = pkt->dst_port;
1655 s->src = pkt->src_ip6;
1656 s->dst = pkt->dst_ip6;
1669 const struct ipfw_flow_id *pkt, uint32_t zoneid, uint32_t hashval,
1683 s = dyn_lookup_ipv6_parent_locked(pkt, zoneid, rule, ruleid,
1703 s = dyn_alloc_ipv6_state(pkt, zoneid, kidx, O_LIMIT_PARENT);
1722 const struct ipfw_flow_id *pkt, uint32_t zoneid, const void *ulp,
1740 if (dyn_lookup_ipv6_state_locked(pkt, zoneid, ulp, pktlen,
1747 data = dyn_alloc_dyndata(parent, ruleid, rulenum, pkt, ulp,
1754 s = dyn_alloc_ipv6_state(pkt, zoneid, kidx, type);
1771 dyn_get_parent_state(const struct ipfw_flow_id *pkt, uint32_t zoneid,
1783 if (IS_IP4_FLOW_ID(pkt)) {
1787 s = dyn_lookup_ipv4_parent(pkt, rule, rule->id,
1797 rule->rulenum, pkt, hashval, version, kidx);
1806 else if (IS_IP6_FLOW_ID(pkt)) {
1810 s = dyn_lookup_ipv6_parent(pkt, zoneid, rule, rule->id,
1820 rule->rulenum, pkt, zoneid, hashval, version,
1842 print_dyn_rule_flags(pkt, O_LIMIT,
1863 dyn_install_state(const struct ipfw_flow_id *pkt, uint32_t zoneid,
1878 id.addr_type = pkt->addr_type;
1879 id.proto = pkt->proto;
1882 pkt->src_port: 0;
1884 pkt->dst_port: 0;
1885 if (IS_IP4_FLOW_ID(pkt)) {
1887 pkt->src_ip: 0;
1889 pkt->dst_ip: 0;
1892 else if (IS_IP6_FLOW_ID(pkt)) {
1894 id.src_ip6 = pkt->src_ip6;
1898 id.dst_ip6 = pkt->dst_ip6;
1915 print_dyn_rule_flags(pkt, O_LIMIT,
1928 hashval = hash_packet(pkt);
1929 if (IS_IP4_FLOW_ID(pkt))
1930 ret = dyn_add_ipv4_state(rule, ruleid, rulenum, pkt,
1933 else if (IS_IP6_FLOW_ID(pkt))
1934 ret = dyn_add_ipv6_state(rule, ruleid, rulenum, pkt,