Lines Matching refs:flow1
625 copy_flow_data(struct pflow_flow *flow1, struct pflow_flow *flow2, in copy_flow_data() argument
628 flow1->src_ip = flow2->dest_ip = sk->addr[src].v4.s_addr; in copy_flow_data()
629 flow1->src_port = flow2->dest_port = sk->port[src]; in copy_flow_data()
630 flow1->dest_ip = flow2->src_ip = sk->addr[dst].v4.s_addr; in copy_flow_data()
631 flow1->dest_port = flow2->src_port = sk->port[dst]; in copy_flow_data()
633 flow1->dest_as = flow2->src_as = in copy_flow_data()
634 flow1->src_as = flow2->dest_as = 0; in copy_flow_data()
635 flow1->if_index_in = htons(st->if_index_in); in copy_flow_data()
636 flow1->if_index_out = htons(st->if_index_out); in copy_flow_data()
639 flow1->dest_mask = flow2->src_mask = in copy_flow_data()
640 flow1->src_mask = flow2->dest_mask = 0; in copy_flow_data()
642 flow1->flow_packets = htonl(st->packets[0]); in copy_flow_data()
644 flow1->flow_octets = htonl(st->bytes[0]); in copy_flow_data()
652 flow1->flow_start = flow2->flow_start = st->creation < 0 || in copy_flow_data()
654 flow1->flow_finish = flow2->flow_finish = st->expire < 0 ? htonl(0) : in copy_flow_data()
656 flow1->tcp_flags = flow2->tcp_flags = 0; in copy_flow_data()
657 flow1->protocol = flow2->protocol = sk->proto; in copy_flow_data()
658 flow1->tos = flow2->tos = st->rule->tos; in copy_flow_data()
662 copy_flow_ipfix_4_data(struct pflow_ipfix_flow4 *flow1, in copy_flow_ipfix_4_data() argument
666 flow1->src_ip = flow2->dest_ip = sk->addr[src].v4.s_addr; in copy_flow_ipfix_4_data()
667 flow1->src_port = flow2->dest_port = sk->port[src]; in copy_flow_ipfix_4_data()
668 flow1->dest_ip = flow2->src_ip = sk->addr[dst].v4.s_addr; in copy_flow_ipfix_4_data()
669 flow1->dest_port = flow2->src_port = sk->port[dst]; in copy_flow_ipfix_4_data()
671 flow1->if_index_in = htonl(st->if_index_in); in copy_flow_ipfix_4_data()
672 flow1->if_index_out = htonl(st->if_index_out); in copy_flow_ipfix_4_data()
676 flow1->flow_packets = htobe64(st->packets[0]); in copy_flow_ipfix_4_data()
678 flow1->flow_octets = htobe64(st->bytes[0]); in copy_flow_ipfix_4_data()
686 flow1->flow_start = flow2->flow_start = htobe64((time_second - in copy_flow_ipfix_4_data()
689 flow1->flow_start = flow2->flow_start = htobe64((pf_get_time() - in copy_flow_ipfix_4_data()
691 flow1->flow_finish = flow2->flow_finish = htobe64((pf_get_time() - in copy_flow_ipfix_4_data()
694 flow1->protocol = flow2->protocol = sk->proto; in copy_flow_ipfix_4_data()
695 flow1->tos = flow2->tos = st->rule->tos; in copy_flow_ipfix_4_data()
699 copy_flow_ipfix_6_data(struct pflow_ipfix_flow6 *flow1, in copy_flow_ipfix_6_data() argument
703 bcopy(&sk->addr[src].v6, &flow1->src_ip, sizeof(flow1->src_ip)); in copy_flow_ipfix_6_data()
705 flow1->src_port = flow2->dest_port = sk->port[src]; in copy_flow_ipfix_6_data()
706 bcopy(&sk->addr[dst].v6, &flow1->dest_ip, sizeof(flow1->dest_ip)); in copy_flow_ipfix_6_data()
708 flow1->dest_port = flow2->src_port = sk->port[dst]; in copy_flow_ipfix_6_data()
710 flow1->if_index_in = htonl(st->if_index_in); in copy_flow_ipfix_6_data()
711 flow1->if_index_out = htonl(st->if_index_out); in copy_flow_ipfix_6_data()
715 flow1->flow_packets = htobe64(st->packets[0]); in copy_flow_ipfix_6_data()
717 flow1->flow_octets = htobe64(st->bytes[0]); in copy_flow_ipfix_6_data()
725 flow1->flow_start = flow2->flow_start = htobe64((time_second - in copy_flow_ipfix_6_data()
728 flow1->flow_start = flow2->flow_start = htobe64((pf_get_time() - in copy_flow_ipfix_6_data()
730 flow1->flow_finish = flow2->flow_finish = htobe64((pf_get_time() - in copy_flow_ipfix_6_data()
733 flow1->protocol = flow2->protocol = sk->proto; in copy_flow_ipfix_6_data()
734 flow1->tos = flow2->tos = st->rule->tos; in copy_flow_ipfix_6_data()
960 struct pflow_flow flow1; in pflow_pack_flow() local
964 bzero(&flow1, sizeof(flow1)); in pflow_pack_flow()
968 copy_flow_data(&flow1, &flow2, st, sk, 1, 0); in pflow_pack_flow()
970 copy_flow_data(&flow1, &flow2, st, sk, 0, 1); in pflow_pack_flow()
973 ret = copy_flow_to_m(&flow1, sc); in pflow_pack_flow()