Changeset 853603a


Ignore:
Timestamp:
05/29/06 14:08:00 (15 years ago)
Author:
Perry Lorier <perry@…>
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:
0eef5d4
Parents:
f208f92
Message:

Migrate tools to the new API

Location:
tools
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • tools/traceanon/rijndael.h

    r41b53c2 r853603a  
    22#define _RIJNDAEL_H_
    33
    4 // $Id$
     4/* $Id$
    55//
    66// File : rijndael.h
     
    1212// This code is public domain.
    1313// Based on the Vincent Rijmen and K.U.Leuven implementation 2.4.
    14 //
     14*/
    1515
    16 //
     16/*
    1717// Original Copyright notice:
    1818//
     
    3030//
    3131//    This code is placed in the public domain.
    32 //
     32*/
    3333
    34 //
     34/*
    3535// This implementation works on 128 , 192 , 256 bit keys
    3636// and on 128 bit blocks
    37 //
     37*/
    3838
    39 //
     39/*
    4040// Example of usage:
    4141//
     
    6262//  if(len >= 0)useYourDecryptedText();
    6363//  else decryptError(len);
    64 //
     64*/
    6565
    6666#define _MAX_KEY_COLUMNS (256/32)
     
    6868#define MAX_IV_SIZE      16
    6969
    70 // We assume that unsigned int is 32 bits long....
     70/* We assume that unsigned int is 32 bits long....  */
    7171typedef unsigned char  UINT8;
    7272typedef unsigned int   UINT32;
    7373typedef unsigned short UINT16;
    7474
    75 // Error codes
     75/* Error codes */
    7676#define RIJNDAEL_SUCCESS 0
    7777#define RIJNDAEL_UNSUPPORTED_MODE -1
     
    8383#define RIJNDAEL_CORRUPTED_DATA -7
    8484
    85 //class Rijndael
     85/*class Rijndael
    8686//{     
    8787//public:
     88*/
    8889
    8990enum Direction_e { Encrypt , Decrypt };
     
    9798typedef enum State_e State;
    9899
    99 //
     100/*
    100101// Creates a Rijndael cipher object
    101102// You have to call init() before you can encrypt or decrypt stuff
     
    158159void r_decrypt(const UINT8 a[16], UINT8 b[16]);
    159160//};
     161*/
    160162       
    161 #endif // _RIJNDAEL_H_
     163#endif /* _RIJNDAEL_H_ */
  • tools/traceanon/traceanon.c

    r3d4fb8f r853603a  
    207207                }
    208208        }
    209         trace_destroy_packet(&packet);
     209        trace_destroy_packet(packet);
    210210        trace_destroy(trace);
    211211        trace_destroy_output(writer);
  • tools/tracedump/tracedump.cc

    r72cc9cc r853603a  
    4747                                        usage(argv[0]);
    4848                                }
    49                                 filter=trace_bpf_setfilter(optarg);
     49                                filter=trace_create_filter(optarg);
    5050                                break;
    5151                        case 'c': count=atol(optarg); break;
     
    7575                }
    7676                while(trace_read_packet(trace,packet)> 0 ){
    77                         if (filter && !trace_bpf_filter(filter,packet))
     77                        if (filter && !trace_apply_filter(filter,packet))
    7878                                continue;
    7979
  • tools/tracereport/error_report.c

    re3b0188 r853603a  
    3333        printf("RX Errors: %" PRIu64 "\n",rx_errors);
    3434        printf("IP Checksum errors: %" PRIu64 "\n",ip_errors);
    35         //printf("TCP Checksum errors: %" PRIu64 "\n",tcp_errors);
     35        /*printf("TCP Checksum errors: %" PRIu64 "\n",tcp_errors); */
    3636}
  • tools/tracertstats/tracertstats.c

    r4e65f42 r853603a  
    146146                ts = trace_get_seconds(packet);
    147147                for(i=0;i<filter_count;++i) {
    148                         if(trace_bpf_filter(filters[i].filter,packet)) {
     148                        if(trace_apply_filter(filters[i].filter,packet)) {
    149149                                ++filters[i].count;
    150150                                filters[i].bytes+=trace_get_wire_length(packet);
     
    175175        trace_destroy(trace);
    176176        output_destroy(output);
     177        trace_destroy_packet(packet);
    177178}
    178179
     
    207208                                filters=realloc(filters,filter_count*sizeof(struct filter_t));
    208209                                filters[filter_count-1].expr=strdup(optarg);
    209                                 filters[filter_count-1].filter=trace_bpf_setfilter(optarg);
     210                                filters[filter_count-1].filter=trace_create_filter(optarg);
    210211                                filters[filter_count-1].count=0;
    211212                                filters[filter_count-1].bytes=0;
  • tools/tracesplit/tracesplit.c

    rcd7eec7 r853603a  
    8080
    8181                switch (c) {
    82                         case 'f': filter=trace_bpf_setfilter(optarg);
     82                        case 'f': filter=trace_create_filter(optarg);
    8383                                break;
    8484                        case 'c': count=atoi(optarg);
     
    114114
    115115
    116                 if (filter && !trace_bpf_filter(filter,packet)) {
     116                if (filter && !trace_apply_filter(filter,packet)) {
    117117                        continue;
    118118                }
     
    179179                trace_destroy_output(output);
    180180
     181        trace_destroy_packet(packet);
     182
    181183        return 0;
    182184}
  • tools/tracesplit/tracesplit_dir.c

    r5ad7ad0 r853603a  
    7878                trace_destroy_output(in_write);
    7979        trace_destroy(input);
    80         trace_destroy_packet(&packet);
     80        trace_destroy_packet(packet);
    8181       
    8282        return 0;
  • tools/tracestats/tracestats.c

    r4e65f42 r853603a  
    2929 */
    3030
    31 //
    32 // This program takes a series of traces and bpf filters and outputs how many
    33 // bytes/packets
     31/*
     32 * This program takes a series of traces and bpf filters and outputs how many
     33 * bytes/packets
     34 */
    3435
    3536#include <stdio.h>
     
    8889
    8990                for(i=0;i<filter_count;++i) {
    90                         if(trace_bpf_filter(filters[i].filter,packet)) {
     91                        if(trace_apply_filter(filters[i].filter,packet)) {
    9192                                ++filters[i].count;
    9293                                filters[i].bytes+=trace_get_wire_length(packet);
     
    137138                                filters=realloc(filters,filter_count*sizeof(struct filter_t));
    138139                                filters[filter_count-1].expr=strdup(optarg);
    139                                 filters[filter_count-1].filter=trace_bpf_setfilter(optarg);
     140                                filters[filter_count-1].filter=trace_create_filter(optarg);
    140141                                filters[filter_count-1].count=0;
    141142                                filters[filter_count-1].bytes=0;
Note: See TracChangeset for help on using the changeset viewer.