Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/bash
0002 # SPDX-License-Identifier: GPL-2.0
0003 local_dir="$(pwd)"
0004 root_dir=$local_dir/../..
0005 mnt_dir=$(mktemp -d --tmp)
0006 
0007 on_exit() {
0008         iptables -D OUTPUT -m bpf --object-pinned ${mnt_dir}/bpf_prog -j ACCEPT
0009         umount ${mnt_dir}
0010         rm -r ${mnt_dir}
0011 }
0012 
0013 trap on_exit EXIT
0014 mount -t bpf bpf ${mnt_dir}
0015 ./per_socket_stats_example ${mnt_dir}/bpf_prog $1