Lines Matching refs:pri
18 struct pcap_data *pri = data; in pcap_user_init() local
22 p = pcap_open_live(pri->host_if, ETH_MAX_PACKET + ETH_HEADER_OTHER, in pcap_user_init()
23 pri->promisc, 0, errors); in pcap_user_init()
30 pri->dev = dev; in pcap_user_init()
31 pri->pcap = p; in pcap_user_init()
37 struct pcap_data *pri = data; in pcap_user_open() local
41 if (pri->pcap == NULL) in pcap_user_open()
44 if (pri->filter != NULL) { in pcap_user_open()
45 err = dev_netmask(pri->dev, &netmask); in pcap_user_open()
51 pri->compiled = uml_kmalloc(sizeof(struct bpf_program), in pcap_user_open()
53 if (pri->compiled == NULL) { in pcap_user_open()
58 err = pcap_compile(pri->pcap, in pcap_user_open()
59 (struct bpf_program *) pri->compiled, in pcap_user_open()
60 pri->filter, pri->optimize, netmask); in pcap_user_open()
63 "'%s'\n", pcap_geterr(pri->pcap)); in pcap_user_open()
67 err = pcap_setfilter(pri->pcap, pri->compiled); in pcap_user_open()
70 "failed - '%s'\n", pcap_geterr(pri->pcap)); in pcap_user_open()
75 return PCAP_FD(pri->pcap); in pcap_user_open()
78 kfree(pri->compiled); in pcap_user_open()
84 struct pcap_data *pri = data; in pcap_remove() local
86 if (pri->compiled != NULL) in pcap_remove()
87 pcap_freecode(pri->compiled); in pcap_remove()
89 if (pri->pcap != NULL) in pcap_remove()
90 pcap_close(pri->pcap); in pcap_remove()
110 int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri) in pcap_user_read() argument
117 n = pcap_dispatch(pri->pcap, 1, handler, (u_char *) &hdata); in pcap_user_read()
120 pcap_geterr(pri->pcap)); in pcap_user_read()