Changeset 6b98325 for lib/trace.c


Ignore:
Timestamp:
03/23/15 17:52:17 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
773d5e2
Parents:
963b13b
Message:

Removes pconfig_input() and replaces trace_config() with trace_set_<option>

  • Removes trace_pconfig completely - only trace_set_hasher is left now in trace_config
  • Rework user configuration so this is no longer modified directly. Now we just apply it directly to a trace.
  • Many minor documentation fixes and additions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r7718e54 r6b98325  
    556556                return -1;
    557557        }
    558        
     558
     559        if (option == TRACE_OPTION_HASHER)
     560                return trace_set_hasher(libtrace,
     561                                        (enum hasher_types) *((int *) value),
     562                                        NULL, NULL);
     563
    559564        /* If the capture format supports configuration, try using their
    560565         * native configuration first */
     
    608613                        }
    609614                        return -1;
     615                case TRACE_OPTION_HASHER:
     616                        /* Dealt with earlier */
     617                        return -1;
    610618                       
    611619        }
     
    615623        }
    616624        return -1;
     625}
     626
     627DLLEXPORT int trace_set_snaplen(libtrace_t *trace, int snaplen) {
     628        return trace_config(trace, TRACE_OPTION_SNAPLEN, &snaplen);
     629}
     630
     631DLLEXPORT int trace_set_promisc(libtrace_t *trace, bool promisc) {
     632        int tmp = promisc;
     633        return trace_config(trace, TRACE_OPTION_PROMISC, &tmp);
     634}
     635
     636DLLEXPORT int trace_set_filter(libtrace_t *trace, libtrace_filter_t *filter) {
     637        return trace_config(trace, TRACE_OPTION_FILTER, filter);
     638}
     639
     640DLLEXPORT int trace_set_meta_freq(libtrace_t *trace, int freq) {
     641        return trace_config(trace, TRACE_OPTION_META_FREQ, &freq);
     642}
     643
     644DLLEXPORT int trace_set_event_realtime(libtrace_t *trace, bool realtime) {
     645        int tmp = realtime;
     646        return trace_config(trace, TRACE_OPTION_EVENT_REALTIME, &tmp);
    617647}
    618648
Note: See TracChangeset for help on using the changeset viewer.