Lines Matching refs:handle
54 dbus_read(pcap_t *handle, int max_packets _U_, pcap_handler callback, u_char *user) in dbus_read() argument
56 struct pcap_dbus *handlep = handle->priv; in dbus_read()
71 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Connection closed"); in dbus_read()
75 if (handle->break_loop) { in dbus_read()
76 handle->break_loop = 0; in dbus_read()
84 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Disconnected"); in dbus_read()
93 if (handle->fcode.bf_insns == NULL || in dbus_read()
94 pcap_filter(handle->fcode.bf_insns, (u_char *)raw_msg, pkth.len, pkth.caplen)) { in dbus_read()
106 dbus_write(pcap_t *handle, const void *buf, int size) in dbus_write() argument
109 struct pcap_dbus *handlep = handle->priv; in dbus_write()
115 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "dbus_message_demarshal() failed: %s", error.message); in dbus_write()
128 dbus_stats(pcap_t *handle, struct pcap_stat *stats) in dbus_stats() argument
130 struct pcap_dbus *handlep = handle->priv; in dbus_stats()
139 dbus_cleanup(pcap_t *handle) in dbus_cleanup() argument
141 struct pcap_dbus *handlep = handle->priv; in dbus_cleanup()
145 pcap_cleanup_live_common(handle); in dbus_cleanup()
171 dbus_activate(pcap_t *handle) in dbus_activate() argument
184 struct pcap_dbus *handlep = handle->priv; in dbus_activate()
185 const char *dev = handle->opt.device; in dbus_activate()
192 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to get system bus: %s", error.message); in dbus_activate()
199 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to get session bus: %s", error.message); in dbus_activate()
208 …snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to open connection to: %s: %s", addr, error.mes… in dbus_activate()
214 …snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to register bus %s: %s\n", addr, error.message); in dbus_activate()
220 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't get bus address from %s", handle->opt.device); in dbus_activate()
225 handle->bufsize = 0; in dbus_activate()
226 handle->offset = 0; in dbus_activate()
227 handle->linktype = DLT_DBUS; in dbus_activate()
228 handle->read_op = dbus_read; in dbus_activate()
229 handle->inject_op = dbus_write; in dbus_activate()
230 handle->setfilter_op = install_bpf_program; /* XXX, later add support for dbus_bus_add_match() */ in dbus_activate()
231 handle->setdirection_op = NULL; in dbus_activate()
232 handle->set_datalink_op = NULL; /* can't change data link type */ in dbus_activate()
233 handle->getnonblock_op = dbus_getnonblock; in dbus_activate()
234 handle->setnonblock_op = dbus_setnonblock; in dbus_activate()
235 handle->stats_op = dbus_stats; in dbus_activate()
236 handle->cleanup_op = dbus_cleanup; in dbus_activate()
261 handle->selectable_fd = handle->fd = -1; in dbus_activate()
264 if (handle->opt.rfmon) { in dbus_activate()
268 dbus_cleanup(handle); in dbus_activate()
277 if (handle->snapshot <= 0 || handle->snapshot > 134217728) in dbus_activate()
278 handle->snapshot = 134217728; in dbus_activate()
281 if (handle->opt.buffer_size != 0) in dbus_activate()
282 dbus_connection_set_max_received_size(handlep->conn, handle->opt.buffer_size); in dbus_activate()
292 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to add bus match: %s\n", error.message); in dbus_activate()
294 dbus_cleanup(handle); in dbus_activate()