Lines Matching defs:handle

59 dbus_read(pcap_t *handle, int max_packets _U_, pcap_handler callback, u_char *user)
61 struct pcap_dbus *handlep = handle->priv;
74 /* XXX handle->opt.timeout = timeout_ms; */
76 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Connection closed");
80 if (handle->break_loop) {
81 handle->break_loop = 0;
89 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Disconnected");
95 /* pkth.caplen = min (payload_len, handle->snapshot); */
98 if (handle->fcode.bf_insns == NULL ||
99 pcap_filter(handle->fcode.bf_insns, (u_char *)raw_msg, pkth.len, pkth.caplen)) {
111 dbus_write(pcap_t *handle, const void *buf, int size)
114 struct pcap_dbus *handlep = handle->priv;
120 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "dbus_message_demarshal() failed: %s", error.message);
133 dbus_stats(pcap_t *handle, struct pcap_stat *stats)
135 struct pcap_dbus *handlep = handle->priv;
144 dbus_cleanup(pcap_t *handle)
146 struct pcap_dbus *handlep = handle->priv;
150 pcap_cleanup_live_common(handle);
176 dbus_activate(pcap_t *handle)
189 struct pcap_dbus *handlep = handle->priv;
190 const char *dev = handle->opt.device;
197 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to get system bus: %s", error.message);
204 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to get session bus: %s", error.message);
213 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to open connection to: %s: %s", addr, error.message);
219 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to register bus %s: %s\n", addr, error.message);
225 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't get bus address from %s", handle->opt.device);
230 handle->bufsize = 0;
231 handle->offset = 0;
232 handle->linktype = DLT_DBUS;
233 handle->read_op = dbus_read;
234 handle->inject_op = dbus_write;
235 handle->setfilter_op = install_bpf_program; /* XXX, later add support for dbus_bus_add_match() */
236 handle->setdirection_op = NULL;
237 handle->set_datalink_op = NULL; /* can't change data link type */
238 handle->getnonblock_op = dbus_getnonblock;
239 handle->setnonblock_op = dbus_setnonblock;
240 handle->stats_op = dbus_stats;
241 handle->cleanup_op = dbus_cleanup;
266 handle->selectable_fd = handle->fd = -1;
269 if (handle->opt.rfmon) {
273 dbus_cleanup(handle);
282 if (handle->snapshot <= 0 || handle->snapshot > 134217728)
283 handle->snapshot = 134217728;
285 /* dbus_connection_set_max_message_size(handlep->conn, handle->snapshot); */
286 if (handle->opt.buffer_size != 0)
287 dbus_connection_set_max_received_size(handlep->conn, handle->opt.buffer_size);
297 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to add bus match: %s\n", error.message);
299 dbus_cleanup(handle);