Changeset 00365c6 for libpacketdump


Ignore:
Timestamp:
05/18/18 11:39:59 (3 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, etsilive, master, rc-4.0.4, ringdecrementfix, ringperformance
Children:
991ff43
Parents:
b663d33
git-author:
Shane Alcock <salcock@…> (12/19/17 17:09:29)
git-committer:
Shane Alcock <salcock@…> (05/18/18 11:39:59)
Message:

Update to use new libwandder_etsili API

The new API should be more thread-safe than the original, at the
cost of being a bit more awkward to use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/link_21.c

    rb663d33 r00365c6  
    66DLLEXPORT void decode(int link_type UNUSED, const char *packet, unsigned len) {
    77
    8         wandder_decoder_t dec;
    9         wandder_etsi_stack_t *stack = NULL;
    108        char linespace[4096];
    119        int i;
    1210        uint8_t *cchdr = NULL;
    1311        uint32_t rem = len;
     12        wandder_etsispec_t *dec;
     13        wandder_decoder_t *basedec = NULL;
    1414
    15         init_wandder_decoder(&dec, (uint8_t *)packet, len, false);
    16         while (wandder_etsili_get_next_fieldstr(&dec, linespace, 4096, &stack)) {
     15        dec = wandder_create_etsili_decoder();
     16        wandder_attach_etsili_buffer(dec, (uint8_t *)packet, len, false);
     17
     18        basedec = wandder_get_etsili_base_decoder(dec);
     19        while (wandder_etsili_get_next_fieldstr(dec, linespace, 4096)) {
    1720                printf(" ETSILI: ");
    18                 for (i = 0; i < wandder_get_level(&dec); i++) {
     21                for (i = 0; i < wandder_get_level(basedec); i++) {
    1922                        printf("  ");
    2023                }
     
    2225        }
    2326
    24         wandder_reset_decoder(&dec);
    25         cchdr = wandder_etsili_get_cc_contents(&dec, &rem);
     27        cchdr = wandder_etsili_get_cc_contents(dec, &rem);
    2628
    27         wandder_etsili_free_stack(stack);
    28         free_wandder_decoder(&dec);
     29        wandder_free_etsili_decoder(dec);
    2930
    3031        if (cchdr) {
Note: See TracChangeset for help on using the changeset viewer.