Lines Matching refs:handle

54 dbus_read(pcap_t *handle, int max_packets _U_, pcap_handler callback, u_char *user)
56 struct pcap_dbus *handlep = handle->priv;
69 /* XXX handle->opt.timeout = timeout_ms; */
71 pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Connection closed");
75 if (handle->break_loop) {
76 handle->break_loop = 0;
84 pcap_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 pcap_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);
171 dbus_activate(pcap_t *handle)
184 struct pcap_dbus *handlep = handle->priv;
185 const char *dev = handle->opt.device;
192 pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to get system bus: %s", error.message);
199 pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to get session bus: %s", error.message);
208 pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to open connection to: %s: %s", addr, error.message);
214 pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to register bus %s: %s\n", addr, error.message);
220 pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't get bus address from %s", handle->opt.device);
225 handle->bufsize = 0;
226 handle->offset = 0;
227 handle->linktype = DLT_DBUS;
228 handle->read_op = dbus_read;
229 handle->inject_op = dbus_write;
230 handle->setfilter_op = install_bpf_program; /* XXX, later add support for dbus_bus_add_match() */
231 handle->setdirection_op = NULL;
232 handle->set_datalink_op = NULL; /* can't change data link type */
233 handle->getnonblock_op = dbus_getnonblock;
234 handle->setnonblock_op = dbus_setnonblock;
235 handle->stats_op = dbus_stats;
236 handle->cleanup_op = dbus_cleanup;
261 handle->selectable_fd = handle->fd = -1;
264 if (handle->opt.rfmon) {
268 dbus_cleanup(handle);
277 if (handle->snapshot <= 0 || handle->snapshot > 134217728)
278 handle->snapshot = 134217728;
280 /* dbus_connection_set_max_message_size(handlep->conn, handle->snapshot); */
281 if (handle->opt.buffer_size != 0)
282 dbus_connection_set_max_received_size(handlep->conn, handle->opt.buffer_size);
292 pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to add bus match: %s\n", error.message);
294 dbus_cleanup(handle);