#1# SPDX-License-Identifier: BSD-2-Clause2#3# Copyright (c) 2023 Kajetan Staszkiewicz <[email protected]>4#5# Redistribution and use in source and binary forms, with or without6# modification, are permitted provided that the following conditions7# are met:8# 1. Redistributions of source code must retain the above copyright9# notice, this list of conditions and the following disclaimer.10# 2. Redistributions in binary form must reproduce the above copyright11# notice, this list of conditions and the following disclaimer in the12# documentation and/or other materials provided with the distribution.13#14# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND15# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE16# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE17# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF24# SUCH DAMAGE.2526. $(atf_get_srcdir)/utils.subr2728atf_test_case "modulate_v4" "cleanup"29modulate_v4_head()30{31atf_set descr 'IPv4 TCP sequence number modulation'32atf_set require.user root33atf_set require.progs python3 scapy34}3536modulate_v4_body()37{38setup_router_dummy_ipv43940pft_set_rules router \41"pass in on ${epair_tester}b modulate state"42ping_dummy_check_request exit:0 --ping-type=tcpsyn --send-seq 42 # Sanity check43ping_dummy_check_request exit:1 --ping-type=tcpsyn --send-seq 42 --expect-seq 4244}4546modulate_v4_cleanup()47{48pft_cleanup49}5051atf_test_case "modulate_v6" "cleanup"52modulate_v6_head()53{54atf_set descr 'IPv6 TCP sequence number modulation'55atf_set require.user root56atf_set require.progs python3 scapy57}5859modulate_v6_body()60{61setup_router_dummy_ipv66263pft_set_rules router \64"pass in on ${epair_tester}b modulate state"65ping_dummy_check_request exit:0 --ping-type=tcpsyn --send-seq 42 # Sanity check66ping_dummy_check_request exit:1 --ping-type=tcpsyn --send-seq 42 --expect-seq 4267}6869modulate_v6_cleanup()70{71pft_cleanup72}7374atf_init_test_cases()75{76atf_add_test_case "modulate_v4"77atf_add_test_case "modulate_v6"78}798081