Lines Matching defs:handle
52 dbus_read(pcap_t *handle, int max_packets _U_, pcap_handler callback, u_char *user)
54 struct pcap_dbus *handlep = handle->priv;
67 /* XXX handle->opt.timeout = timeout_ms; */
69 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Connection closed");
73 if (handle->break_loop) {
74 handle->break_loop = 0;
82 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Disconnected");
88 /* pkth.caplen = min (payload_len, handle->snapshot); */
91 if (handle->fcode.bf_insns == NULL ||
92 pcapint_filter(handle->fcode.bf_insns, (u_char *)raw_msg, pkth.len, pkth.caplen)) {
104 dbus_write(pcap_t *handle, const void *buf, int size)
107 struct pcap_dbus *handlep = handle->priv;
113 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "dbus_message_demarshal() failed: %s", error.message);
126 dbus_stats(pcap_t *handle, struct pcap_stat *stats)
128 struct pcap_dbus *handlep = handle->priv;
137 dbus_cleanup(pcap_t *handle)
139 struct pcap_dbus *handlep = handle->priv;
143 pcapint_cleanup_live_common(handle);
169 dbus_activate(pcap_t *handle)
182 struct pcap_dbus *handlep = handle->priv;
183 const char *dev = handle->opt.device;
190 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to get system bus: %s", error.message);
197 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to get session bus: %s", error.message);
206 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to open connection to: %s: %s", addr, error.message);
212 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to register bus %s: %s\n", addr, error.message);
218 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't get bus address from %s", handle->opt.device);
223 handle->bufsize = 0;
224 handle->offset = 0;
225 handle->linktype = DLT_DBUS;
226 handle->read_op = dbus_read;
227 handle->inject_op = dbus_write;
228 handle->setfilter_op = pcapint_install_bpf_program; /* XXX, later add support for dbus_bus_add_match() */
229 handle->setdirection_op = NULL;
230 handle->set_datalink_op = NULL; /* can't change data link type */
231 handle->getnonblock_op = dbus_getnonblock;
232 handle->setnonblock_op = dbus_setnonblock;
233 handle->stats_op = dbus_stats;
234 handle->cleanup_op = dbus_cleanup;
259 handle->selectable_fd = handle->fd = -1;
262 if (handle->opt.rfmon) {
266 dbus_cleanup(handle);
275 if (handle->snapshot <= 0 || handle->snapshot > 134217728)
276 handle->snapshot = 134217728;
278 /* dbus_connection_set_max_message_size(handlep->conn, handle->snapshot); */
279 if (handle->opt.buffer_size != 0)
280 dbus_connection_set_max_received_size(handlep->conn, handle->opt.buffer_size);
290 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Failed to add bus match: %s\n", error.message);
292 dbus_cleanup(handle);