Changeset 2415


Ignore:
Timestamp:
03/12/10 21:43:50 (5 months ago)
Author:
aturner
Message:

port --preload-pcap option parsing to new API methodology. refs #410

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tcpreplay_api.c

    r2404 r2415  
    207207    } 
    208208 
     209    /* 
     210     * If we're preloading the pcap before the first run, then 
     211     * we're forcing the file cache to be true 
     212     */ 
     213 
     214    if (HAVE_OPT(PRELOAD_PCAP)) { 
     215        options->preload_pcap = true; 
     216        options->enable_file_cache = true; 
     217    } 
     218 
    209219    if (HAVE_OPT(TIMER)) { 
    210220        if (strcmp(OPT_ARG(TIMER), "select") == 0) { 
     
    533543    assert(ctx); 
    534544    ctx->options->enable_file_cache = value; 
     545    return 0; 
     546} 
     547 
     548 
     549/** 
     550 * \brief Enable or disable preloading the file cache  
     551 * 
     552 * Note: This is a global option and forces all pcaps 
     553 * to be preloaded for this context.  If you turn this 
     554 * on, then it forces set_file_cache(true) 
     555 */ 
     556int 
     557tcpreplay_set_preload_pcap(tcpreplay_t *ctx, bool value) 
     558{ 
     559    assert(ctx); 
     560    ctx->options->preload_pcap = value; 
     561    if (value) 
     562        tcpreplay_set_file_cache(ctx, true); 
    535563    return 0; 
    536564} 
  • trunk/src/tcpreplay_api.h

    r2413 r2415  
    146146    bool enable_file_cache; 
    147147    file_cache_t file_cache[MAX_FILES]; 
    148     int preload_pcap; 
     148    bool preload_pcap; 
    149149 
    150150    /* pcap files/sources to replay */ 
     
    231231int tcpreplay_set_tcpprep_cache(tcpreplay_t *, char *); 
    232232int tcpreplay_add_pcapfile(tcpreplay_t *, char *); 
     233int tcpreplay_set_preload_pcap(tcpreplay_t *, bool); 
    233234 
    234235/* information */ 
Note: See TracChangeset for help on using the changeset viewer.