Changeset 5a20073


Ignore:
Timestamp:
11/21/06 11:25:29 (14 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
b852fd2
Parents:
4e8378f
Message:

An error is no longer set if dag_config doesn't support a particular config option - it'll only be set if trace_config also doesn't support it.
trace_event_dag no longer calls trace_read_packet as filtering the input can cause it to block for long periods of time. Instead all the filtering is handled inside the event function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r35e0869 r5a20073  
    201201                case TRACE_OPTION_SNAPLEN:
    202202                        /* Surely we can set this?? Fall through for now*/
    203                
     203                        return -1;
    204204                case TRACE_OPTION_PROMISC:
    205205                        /* DAG already operates in a promisc fashion */
    206 
     206                        return -1;
    207207                case TRACE_OPTION_FILTER:
    208 
     208                        return -1;
    209209                default:
    210210                        trace_set_err(libtrace, TRACE_ERR_UNKNOWN_OPTION,
     
    899899
    900900        if (data > 0) {
    901                 event.size = trace_read_packet(trace,packet);
    902                 event.type = TRACE_EVENT_PACKET;
    903                 return event;
     901                event.size = dag_read_packet(trace,packet);
     902                if (trace->filter) {
     903                        if (trace_apply_filter(trace->filter, packet)) {
     904                                event.type = TRACE_EVENT_PACKET;
     905                        } else {
     906                                event.type = TRACE_EVENT_SLEEP;
     907                                event.seconds = 0.000001;
     908                                return event;
     909                        }
     910                }       
     911                if (trace->snaplen > 0) {
     912                        trace_set_capture_length(packet, trace->snaplen);
     913                }
     914
     915                return event;
    904916        }
    905917        event.type = TRACE_EVENT_SLEEP;
Note: See TracChangeset for help on using the changeset viewer.