Add packet capture function