Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_int.h

    r3296252 r50ce607  
    208208        enum thread_states state;
    209209        void* user_data; // TLS for the user to use
     210        void* format_data; // TLS for the format to use
    210211        pthread_t tid;
    211212        int perpkt_num; // A number from 0-X that represents this perpkt threads number
     
    912913         * @return same as read_packet, with the addition of return -2 to represent
    913914         * interrupted due to message waiting. */
    914         int (*pread_packet)(libtrace_t *trace, libtrace_packet_t *packet);
     915        int (*pread_packet)(libtrace_t *trace, libtrace_thread_t *t, libtrace_packet_t *packet);
    915916       
    916917        /** Pause a parallel trace
     
    936937         */
    937938        int (*pconfig_input)(libtrace_t *libtrace,trace_parallel_option_t option,void *value);
    938                
     939
     940        /**
     941         * Register a thread for use with the format or using the packets produced
     942         * by it. This is NOT only used for threads reading packets infact all
     943         * threads use this.
     944         *
     945         * Some use cases include setting up any thread local storage required for
     946         * to read packets and free packets. For DPDK we require any thread that
     947         * may release or read a packet to have have an internal number associated
     948         * with it.
     949         *
     950         * The thread type can be used to see if this thread is going to be used
     951         * to read packets or otherwise.
     952         *
     953         * @return 0 if successful, -1 if the option is unsupported or an error
     954         * occurs (such as a maximum of threads being reached)
     955         */
     956        int (*pregister_thread)(libtrace_t *libtrace, libtrace_thread_t *t, bool reader);
     957
     958        /**
     959         * If needed any memory allocated with pregister_thread can be released
     960         * in this function. The thread will be destroyed directly after this
     961         * function is called.
     962         */
     963        void (*punregister_thread)(libtrace_t *libtrace, libtrace_thread_t *t);
    939964};
    940965
     
    946971NULL,                   /* ppause_input */ \
    947972NULL,                   /* pfin_input */ \
    948 NULL,                   /* pconfig_input */
     973NULL,                   /* pconfig_input */ \
     974NULL,                   /* pregister_thread */ \
     975NULL                    /* punregister_thread */
    949976
    950977/** The list of registered capture formats */
Note: See TracChangeset for help on using the changeset viewer.