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:
00365c6
Parents:
df87f00
git-author:
Shane Alcock <salcock@…> (12/18/17 18:10:37)
git-committer:
Shane Alcock <salcock@…> (05/18/18 11:39:59)
Message:

etsilive format is now functional (for single-threaded only).

Packets are decoded using libwandder. The ETSI headers are treated
as a meta-data layer.

Libpacketdump support has also been added for all fields and
structures that libwandder understands.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_pktmeta.c

    ra857389 rb663d33  
    2828#include "protocols.h"
    2929#include <assert.h>
     30
     31#ifdef HAVE_WANDDER
     32#include <libwandder_etsili.h>
     33#endif
    3034
    3135/* This file contains all the protocol decoding functions for the meta-data
     
    121125}
    122126
     127static void *trace_get_payload_from_etsili(const void *link,
     128                libtrace_linktype_t *type, uint32_t *remaining) {
     129
     130#ifdef HAVE_WANDDER
     131        wandder_decoder_t dec;
     132        uint8_t *ccptr;
     133
     134        init_wandder_decoder(&dec, (uint8_t *)link, *remaining, false);
     135        ccptr = wandder_etsili_get_cc_contents(&dec, remaining);
     136        /* Assuming all CCs are IP for now */
     137        *type = TRACE_TYPE_NONE;
     138        return ccptr;
     139
     140#else
     141        *remaining = NULL;
     142        return NULL;
     143#endif
     144
     145}
     146
    123147DLLEXPORT void *trace_get_packet_meta(const libtrace_packet_t *packet,
    124148                libtrace_linktype_t *linktype,
     
    139163                case TRACE_TYPE_80211_PRISM:
    140164                case TRACE_TYPE_ERF_META:
     165                case TRACE_TYPE_ETSILI:
    141166                        return pktbuf;
    142167                /* Non metadata packets */
     
    199224                                        linktype, remaining);
    200225                        return nexthdr;
     226                case TRACE_TYPE_ETSILI:
     227                        nexthdr = trace_get_payload_from_etsili(meta,
     228                                        linktype, remaining);
     229                        return nexthdr;
     230
    201231                case TRACE_TYPE_HDLC_POS:
    202232                case TRACE_TYPE_ETH:
Note: See TracChangeset for help on using the changeset viewer.