Changeset 5ba34eb


Ignore:
Timestamp:
06/23/14 23:35:44 (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:
5876154
Parents:
ed81f74
Message:

Remove inlines for BSD support

Location:
lib
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • lib/data-struct/message_queue.c

    rfac8c46 r5ba34eb  
    1616 *                see: man 7 pipe notes on atomic operations
    1717 */
    18 inline void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len)
     18void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len)
    1919{
    2020        assert(message_len);
     
    4141 *         of messages.
    4242 */
    43 inline int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message)
     43int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message)
    4444{
    4545        int ret;
     
    6666 *         of messages.
    6767 */
    68 inline int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message)
     68int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message)
    6969{
    7070        int ret;
     
    9090 *         of messages.
    9191 */
    92 inline int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message)
     92int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message)
    9393{
    9494        int ret;
     
    113113 * May be negative if threads blocking and waiting for a message.
    114114 */
    115 inline int libtrace_message_queue_count(const libtrace_message_queue_t *mq)
     115int libtrace_message_queue_count(const libtrace_message_queue_t *mq)
    116116{
    117117        // This is only ok because we know int is atomic
     
    119119}
    120120
    121 inline void libtrace_message_queue_destroy(libtrace_message_queue_t *mq)
     121void libtrace_message_queue_destroy(libtrace_message_queue_t *mq)
    122122{
    123123        mq->message_count = 0;
     
    131131 * @return a file descriptor for the queue, can be used with select() poll() etc.
    132132 */
    133 inline int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq)
     133int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq)
    134134{
    135135        return mq->pipefd[0];
  • lib/data-struct/message_queue.h

    r8c42377 r5ba34eb  
    1313} libtrace_message_queue_t;
    1414
    15 inline void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len);
    16 inline int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message);
    17 inline int libtrace_message_queue_count(const libtrace_message_queue_t *mq);
    18 inline int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message);
    19 inline int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message);
    20 inline void libtrace_message_queue_destroy(libtrace_message_queue_t *mq);
    21 inline int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq);
     15void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len);
     16int libtrace_message_queue_put(libtrace_message_queue_t *mq, const void *message);
     17int libtrace_message_queue_count(const libtrace_message_queue_t *mq);
     18int libtrace_message_queue_get(libtrace_message_queue_t *mq, void *message);
     19int libtrace_message_queue_try_get(libtrace_message_queue_t *mq, void *message);
     20void libtrace_message_queue_destroy(libtrace_message_queue_t *mq);
     21int libtrace_message_queue_get_fd(libtrace_message_queue_t *mq);
    2222
    2323#endif
  • lib/data-struct/sliding_window.c

    read9478 r5ba34eb  
    1414 *                              NOTE: this mainly applies to the blocking functions
    1515 */
    16 inline void libtrace_slidingwindow_init(libtrace_slidingwindow_t *sw, size_t size, uint64_t start_number) {
     16void libtrace_slidingwindow_init(libtrace_slidingwindow_t *sw, size_t size, uint64_t start_number) {
    1717        sw->size = size; // All of this size can be used
    1818        sw->start = 0;
     
    2727 * @param rb The ringbuffer to destroy
    2828 */
    29 inline void libtrace_slidingwindow_destroy(libtrace_slidingwindow_t *sw) {
     29void libtrace_slidingwindow_destroy(libtrace_slidingwindow_t *sw) {
    3030        sw->size = 0;
    3131        sw->start = 0;
     
    4646 * @return 1 if a object was written otherwise 0.
    4747 */
    48 inline int libtrace_slidingwindow_try_write(libtrace_slidingwindow_t *sw, uint64_t number, void* value) {
     48int libtrace_slidingwindow_try_write(libtrace_slidingwindow_t *sw, uint64_t number, void* value) {
    4949        uint64_t adjusted_number = number - sw->start_number;
    5050        if (adjusted_number < sw->size) {
     
    6262}
    6363
    64 inline uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw) {
     64uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw) {
    6565        return sw->elements[sw->start] != NULL;
    6666}
     
    7474 * @return 1 if a object was received otherwise 0, in this case out remains unchanged
    7575 */
    76 inline int libtrace_slidingwindow_try_read(libtrace_slidingwindow_t *sw, void ** value, uint64_t *number) {
     76int libtrace_slidingwindow_try_read(libtrace_slidingwindow_t *sw, void ** value, uint64_t *number) {
    7777        if (sw->elements[sw->start]) {
    7878                *value = sw->elements[sw->start];
     
    8888}
    8989
    90 inline void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw)
     90void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw)
    9191{
    9292        sw->start = 0;
  • lib/data-struct/sliding_window.h

    read9478 r5ba34eb  
    1818
    1919void libtrace_slidingwindow_init(libtrace_slidingwindow_t * sw, size_t size, uint64_t start_number);
    20 inline void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw);
     20void libtrace_zero_slidingwindow(libtrace_slidingwindow_t * sw);
    2121void libtrace_slidingwindow_destroy(libtrace_slidingwindow_t * sw);
    2222
     
    3232int libtrace_slidingwindow_try_read(libtrace_slidingwindow_t *sw, void ** value, uint64_t *number);
    3333
    34 inline uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw);
     34uint64_t libtrace_slidingwindow_read_ready(libtrace_slidingwindow_t *sw);
    3535/*
    3636void libtrace_slidingwindow_swrite(libtrace_slidingwindow_t * sw, void* value);
  • lib/hash_toeplitz.c

    r8c42377 r5ba34eb  
    7070}
    7171
    72 inline void toeplitz_init_config(toeplitz_conf_t *conf, bool bidirectional)
     72void toeplitz_init_config(toeplitz_conf_t *conf, bool bidirectional)
    7373{
    7474        if (bidirectional) {
     
    8383 * n is bits
    8484 */
    85 inline uint32_t toeplitz_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t offset, size_t n, uint32_t result)
     85uint32_t toeplitz_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t offset, size_t n, uint32_t result)
    8686{
    8787        size_t byte;
     
    9797}
    9898
    99 inline uint32_t toeplitz_first_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t n)
     99uint32_t toeplitz_first_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t n)
    100100{
    101101        return toeplitz_hash(tc, data, 0, n, 0);
    102102}
    103103
    104 inline uint64_t toeplitz_hash_packet(const libtrace_packet_t * pkt, const toeplitz_conf_t *cnf) {
     104uint64_t toeplitz_hash_packet(const libtrace_packet_t * pkt, const toeplitz_conf_t *cnf) {
    105105        uint8_t proto;
    106106        uint16_t eth_type;
  • lib/hash_toeplitz.h

    r29bbef0 r5ba34eb  
    2828
    2929void toeplitz_hash_expand_key(toeplitz_conf_t *conf);
    30 inline uint32_t toeplitz_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t offset, size_t n, uint32_t result);
    31 inline uint32_t toeplitz_first_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t n);
    32 inline void toeplitz_init_config(toeplitz_conf_t *conf, bool bidirectional);
    33 inline uint64_t toeplitz_hash_packet(const libtrace_packet_t * pkt, const toeplitz_conf_t *cnf);
     30uint32_t toeplitz_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t offset, size_t n, uint32_t result);
     31uint32_t toeplitz_first_hash(const toeplitz_conf_t *tc, const uint8_t *data, size_t n);
     32void toeplitz_init_config(toeplitz_conf_t *conf, bool bidirectional);
     33uint64_t toeplitz_hash_packet(const libtrace_packet_t * pkt, const toeplitz_conf_t *cnf);
    3434void toeplitz_create_bikey(uint8_t *key);
    3535void toeplitz_create_unikey(uint8_t *key);
     
    4747#pragma pack(pop)   /* restore original alignment from stack */
    4848
    49 
    50 inline toeplitz_ipv4_only_t make_toeplitz_ipv4(uint8_t *src_ip4, uint8_t *dest_ip4);
    51 
    5249#endif
  • lib/libtrace_int.h

    r8c42377 r5ba34eb  
    351351
    352352void trace_fin_packet(libtrace_packet_t *packet);
    353 inline void libtrace_zero_thread(libtrace_thread_t * t);
    354 inline void store_first_packet(libtrace_t *libtrace, libtrace_packet_t *packet, libtrace_thread_t *t);
     353void libtrace_zero_thread(libtrace_thread_t * t);
     354void store_first_packet(libtrace_t *libtrace, libtrace_packet_t *packet, libtrace_thread_t *t);
    355355libtrace_thread_t * get_thread_table(libtrace_t *libtrace);
    356356int get_thread_table_num(libtrace_t *libtrace);
  • lib/trace_parallel.c

    r85e87b5 r5ba34eb  
    140140}
    141141
    142 inline void libtrace_zero_thread(libtrace_thread_t * t) {
     142void libtrace_zero_thread(libtrace_thread_t * t) {
    143143        t->trace = NULL;
    144144        t->ret = NULL;
     
    828828 * results out every XXX seconds.
    829829 */
    830 inline void store_first_packet(libtrace_t *libtrace, libtrace_packet_t *packet, libtrace_thread_t *t)
     830void store_first_packet(libtrace_t *libtrace, libtrace_packet_t *packet, libtrace_thread_t *t)
    831831{
    832832        if (!t->recorded_first) {
Note: See TracChangeset for help on using the changeset viewer.