Lines Matching refs:md

130 		if(dag_stop_stream(p->fd, p->md.dag_stream) < 0)
133 if(dag_detach_stream(p->fd, p->md.dag_stream) < 0)
226 int flags = p->md.dag_offset_flags;
231 while (p->md.dag_mem_top - p->md.dag_mem_bottom < dag_record_size) {
258 if ( NULL == (p->md.dag_mem_top = dag_advance_stream(p->fd, p->md.dag_stream, &(p->md.dag_mem_bottom))) ) {
263 p->md.dag_mem_top = dag_offset(p->fd, &(p->md.dag_mem_bottom), flags);
266 if (nonblocking && (p->md.dag_mem_top - p->md.dag_mem_bottom < dag_record_size))
273 p->md.dag_timeout &&
274 (p->md.dag_mem_top - p->md.dag_mem_bottom < dag_record_size))
283 while (p->md.dag_mem_top - p->md.dag_mem_bottom >= dag_record_size) {
290 dag_record_t *header = (dag_record_t *)(p->md.dag_mem_bottom);
292 dag_record_t *header = (dag_record_t *)(p->md.dag_mem_base + p->md.dag_mem_bottom);
317 p->md.dag_mem_bottom += rlen;
333 if (p->md.stat.ps_drop > (UINT_MAX - ntohs(header->lctr))) {
334 p->md.stat.ps_drop = UINT_MAX;
336 p->md.stat.ps_drop += ntohs(header->lctr);
444 packet_len -= (p->md.dag_fcs_bits >> 3);
457 packet_len -= (p->md.dag_fcs_bits >> 3);
467 packet_len -= (p->md.dag_fcs_bits >> 3);
548 p->md.stat.ps_recv++;
616 if (dag_parse_name(device, newDev, strlen(device) + 16, &handle->md.dag_stream) < 0) {
622 if (handle->md.dag_stream%2) {
647 if (dag_attach_stream(handle->fd, handle->md.dag_stream, 0, 0) < 0) {
655 if (dag_get_stream_poll(handle->fd, handle->md.dag_stream,
667 /* Obey md.timeout (was to_ms) if supplied. This is a good idea!
670 maxwait.tv_sec = handle->md.timeout/1000;
671 maxwait.tv_usec = (handle->md.timeout%1000) * 1000;
673 if (dag_set_stream_poll(handle->fd, handle->md.dag_stream,
680 if((handle->md.dag_mem_base = dag_mmap(handle->fd)) == MAP_FAILED) {
710 if(dag_start_stream(handle->fd, handle->md.dag_stream) < 0) {
726 handle->md.dag_mem_bottom = 0;
727 handle->md.dag_mem_top = 0;
736 handle->md.dag_fcs_bits = 0;
744 handle->md.dag_fcs_bits = 32;
749 handle->md.dag_fcs_bits = n;
763 handle->linktype_ext = LT_FCS_DATALINK_EXT(handle->md.dag_fcs_bits/16);
766 handle->md.dag_fcs_bits = 0;
770 handle->md.dag_timeout = handle->md.timeout;
801 handle->md.stat.ps_drop = 0;
802 handle->md.stat.ps_recv = 0;
803 handle->md.stat.ps_ifdrop = 0;
808 if (dag_stop_stream(handle->fd, handle->md.dag_stream) < 0) {
813 if (dag_detach_stream(handle->fd, handle->md.dag_stream) < 0)
882 /*p->md.stat.ps_recv = 0;*/
883 /*p->md.stat.ps_drop = 0;*/
885 *ps = p->md.stat;
975 p->md.use_bpf = 0;
995 * "p->md.dag_offset_flags".
1005 if (dag_get_stream_poll(p->fd, p->md.dag_stream,
1020 if (dag_set_stream_poll(p->fd, p->md.dag_stream,
1028 p->md.dag_offset_flags |= DAGF_NONBLOCK;
1030 p->md.dag_offset_flags &= ~DAGF_NONBLOCK;
1052 if (dag_get_stream_erf_types(p->fd, p->md.dag_stream, types, 255) < 0) {