blob: f898cfa2b1aa52f71a65db469450d4d001b08b2c [file] [log] [blame]
Chenbo Feng51570a52017-03-22 17:27:36 -07001#!/bin/bash
2local_dir="$(pwd)"
3root_dir=$local_dir/../..
4mnt_dir=$(mktemp -d --tmp)
5
6on_exit() {
Chenbo Feng00f660e2017-04-05 19:00:56 -07007 iptables -D OUTPUT -m bpf --object-pinned ${mnt_dir}/bpf_prog -j ACCEPT
Chenbo Feng51570a52017-03-22 17:27:36 -07008 umount ${mnt_dir}
9 rm -r ${mnt_dir}
10}
11
12trap on_exit EXIT
13mount -t bpf bpf ${mnt_dir}
Chenbo Feng00f660e2017-04-05 19:00:56 -070014./per_socket_stats_example ${mnt_dir}/bpf_prog $1