code cleanup

+add ctx init/cleanup
+pcap open/close
+add pp_ prefix to public functions