Lines Matching refs:handle

54 dbus_read(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user)
56 struct pcap_dbus *handlep = handle->priv;
69 // XXX handle->opt.timeout = timeout_ms;
71 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Connection closed");
75 if (handle->break_loop) {
76 handle->break_loop = 0;
84 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Disconnected");
90 /* pkth.caplen = min (payload_len, handle->snapshot); */
93 if (handle->fcode.bf_insns == NULL ||
94 bpf_filter(handle->fcode.bf_insns, (u_char *)raw_msg, pkth.len, pkth.caplen)) {
106 dbus_write(pcap_t *handle, const void *buf, size_t size)
109 struct pcap_dbus *handlep = handle->priv;
115 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "dbus_message_demarshal() failed: %s", error.message);
128 dbus_stats(pcap_t *handle, struct pcap_stat *stats)
130 struct pcap_dbus *handlep = handle->priv;
139 dbus_cleanup(pcap_t *handle)
141 struct pcap_dbus *handlep = handle->priv;
145 pcap_cleanup_live_common(handle);
149 dbus_activate(pcap_t *handle)
162 struct pcap_dbus *handlep = handle->priv;
163 const char *dev = handle->opt.source;
170 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to get system bus: %s", error.message);
177 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to get session bus: %s", error.message);
186 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to open connection to: %s: %s", addr, error.message);
192 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to register bus %s: %s\n", addr, error.message);
198 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't get bus address from %s", handle->opt.source);
203 handle->bufsize = 0;
204 handle->offset = 0;
205 handle->linktype = DLT_DBUS;
206 handle->read_op = dbus_read;
207 handle->inject_op = dbus_write;
208 handle->setfilter_op = install_bpf_program; /* XXX, later add support for dbus_bus_add_match() */
209 handle->setdirection_op = NULL;
210 handle->set_datalink_op = NULL; /* can't change data link type */
211 handle->getnonblock_op = pcap_getnonblock_fd;
212 handle->setnonblock_op = pcap_setnonblock_fd;
213 handle->stats_op = dbus_stats;
215 handle->selectable_fd = handle->fd = -1;
217 if (handle->opt.rfmon) {
221 dbus_cleanup(handle);
225 /* dbus_connection_set_max_message_size(handlep->conn, handle->snapshot); */
226 if (handle->opt.buffer_size != 0)
227 dbus_connection_set_max_received_size(handlep->conn, handle->opt.buffer_size);
237 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to add bus match: %s\n", error.message);
239 dbus_cleanup(handle);