18c2ecf20Sopenharmony_ci#!/bin/bash 28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 38c2ecf20Sopenharmony_cilocal_dir="$(pwd)" 48c2ecf20Sopenharmony_ciroot_dir=$local_dir/../.. 58c2ecf20Sopenharmony_cimnt_dir=$(mktemp -d --tmp) 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_cion_exit() { 88c2ecf20Sopenharmony_ci iptables -D OUTPUT -m bpf --object-pinned ${mnt_dir}/bpf_prog -j ACCEPT 98c2ecf20Sopenharmony_ci umount ${mnt_dir} 108c2ecf20Sopenharmony_ci rm -r ${mnt_dir} 118c2ecf20Sopenharmony_ci} 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_citrap on_exit EXIT 148c2ecf20Sopenharmony_cimount -t bpf bpf ${mnt_dir} 158c2ecf20Sopenharmony_ci./per_socket_stats_example ${mnt_dir}/bpf_prog $1 16