Changeset 2faa57e


Ignore:
Timestamp:
03/14/08 16:50:58 (13 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, 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:
e632f2f
Parents:
a9a91d1
Message:
  • Added a separate .h file for the various ERF types as newer ERF types aren't specified in the DAG 2.4 drivers
  • ERF traces should now return a Option Unavailable error for any unsupported cconfig options, rather than Unknown Option
  • Added a bit of extra documentation to the new thread/mutex related code added to format_dag25.c
Location:
lib
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • lib/Makefile.am

    r1c68a81 r2faa57e  
    11lib_LTLIBRARIES = libtrace.la
    2 include_HEADERS = libtrace.h dagformat.h lt_inttypes.h daglegacy.h rt_protocol.h libtraceio.h
     2include_HEADERS = libtrace.h dagformat.h lt_inttypes.h daglegacy.h rt_protocol.h libtraceio.h erftypes.h
    33
    44extra_DIST = format_template.c
  • lib/dagformat.h

    r121b7e2 r2faa57e  
    33
    44#include "libtrace.h"
    5 
    6 /* GPP record type defines */
    7 #define TYPE_LEGACY             0
    8 #define TYPE_HDLC_POS           1
    9 #define TYPE_ETH                2
    10 #define TYPE_ATM                3
    11 #define TYPE_AAL5               4
    12 #define TYPE_MC_HDLC            5
    13 #define TYPE_MC_RAW             6
    14 #define TYPE_MC_ATM             7
    15 #define TYPE_MC_RAW_CHANNEL     8
    16 #define TYPE_MC_AAL5            9
    17 #define TYPE_COLOR_HDLC_POS     10
    18 #define TYPE_COLOR_ETH          11
    19 #define TYPE_MC_AAL2            12
    20 #define TYPE_IP_COUNTER         13
    21 #define TYPE_TCP_FLOW_COUNTER   14
    22 #define TYPE_DSM_COLOR_HDLC_POS 15
    23 #define TYPE_DSM_COLOR_ETH      16
    24 #define TYPE_COLOR_MC_HDLC_POS  17
    25 #define TYPE_AAL2               18
     5#include "erftypes.h"
    266
    277
  • lib/format_dag25.c

    ra9a91d1 r2faa57e  
    4646
    4747#include <sys/mman.h>
     48/* XXX: Windows doesn't have pthreads, but this code doesn't compile under
     49 * Windows anyway so we'll worry about this more later :] */
     50#include <pthread.h>
    4851
    4952
     
    5962#  endif
    6063#  include <sys/ioctl.h>
    61 #  include <pthread.h>
    6264#endif
    6365
     
    9799struct dag_dev_t *open_dags = NULL;
    98100
     101/* NOTE: This function assumes the open_dag_mutex is held by the caller */
    99102static struct dag_dev_t *dag_find_open_device(char *dev_name) {
    100103        struct dag_dev_t *dag_dev;
     
    117120}
    118121
     122/* NOTE: This function assumes the open_dag_mutex is held by the caller */
    119123static void dag_close_device(struct dag_dev_t *dev) {
    120124        /* Need to remove from the device list */
     
    138142}
    139143
     144/* NOTE: This function assumes the open_dag_mutex is held by the caller */
    140145static struct dag_dev_t *dag_open_device(libtrace_t *libtrace, char *dev_name) {
    141146        struct stat buf;
  • lib/format_erf.c

    r121b7e2 r2faa57e  
    163163                        IN_OPTIONS.real_time = *(int *)value;
    164164                        return 0;
     165                case TRACE_OPTION_SNAPLEN:
     166                case TRACE_OPTION_PROMISC:
     167                case TRACE_OPTION_FILTER:
     168                case TRACE_OPTION_META_FREQ:
     169                        trace_set_err(libtrace, TRACE_ERR_OPTION_UNAVAIL,
     170                                        "Unsupported option");
     171                        return -1;
    165172                default:
    166173                        /* Unknown option */
  • lib/libtrace_int.h

    rf3f3558 r2faa57e  
    110110#       if DAG_VERSION == 25
    111111#               include <daginf.h>
     112#       else
     113#               include <erftypes.h>
    112114#       endif
    113115#else
Note: See TracChangeset for help on using the changeset viewer.