1 pcap = pcap_open_dead(link, snaplen); 2 /* todo: hook together argv to a single string */ 3 prog = argv[0]; 4 if (pcap_compile(pcap, &p, prog, optimize, 0) < 0) { 5 fprintf(stderr, pcap_geterr(pcap)); 6 exit(1); 7 } 8 bpf_dump(&p, option); 9 pcap_freecode(&p); 10 pcap_close(pcap); 11 12