Changeset 914


Ignore:
Timestamp:
08/18/06 17:51:32 (7 years ago)
Author:
perry
Message:

New automake infrastructure
Moved a lot of C++ libpacketdump parsers to C (they weren't using any C++ features and it makes automake happier)

Location:
trunk/libpacketdump
Files:
1 edited
7 moved

Legend:

Unmodified
Added
Removed
  • trunk/libpacketdump/Makefile.am

    r913 r914  
    2525 
    2626# Decoders for various ethertypes (in decimal) 
    27 BIN_PROTOCOLS+=eth_2048.la 
    28 BIN_PROTOCOLS+=eth_2054.la 
    29 TXT_PROTOCOLS+=eth_33024.protocol 
     27BIN_PROTOCOLS+=eth_2048.la              # IPv4 
     28BIN_PROTOCOLS+=eth_2054.la              # ARP 
     29TXT_PROTOCOLS+=eth_33024.protocol       # IPv6 
    3030 
    3131# IP Protocol decoders 
     
    5353link_11_la_LDFLAGS=-module 
    5454 
     55eth_2048_la_LDFLAGS=-module 
     56eth_2054_la_LDFLAGS=-module 
     57 
     58ip_1_la_LDFLAGS=-module 
     59ip_6_la_LDFLAGS=-module 
     60ip_17_la_LDFLAGS=-module 
     61ip_33_la_LDFLAGS=-module 
     62ip_132_la_LDFLAGS=-module 
     63 
    5564SUBDIRS = parser 
    5665 
     
    5867 
    5968plugin_LTLIBRARIES = $(BIN_PROTOCOLS) 
    60 plugin_DATA = $(TXT_PROTOCOLS)) 
     69plugin_DATA = $(TXT_PROTOCOLS) 
    6170 
    6271INCLUDES= @ADD_INCLS@ -I../lib -I../ 
  • trunk/libpacketdump/eth_2048.c

    r893 r914  
    2424#define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&ip->x)) 
    2525 
    26 extern "C" 
    2726void decode(int link_type,char *packet,int len) 
    2827{ 
  • trunk/libpacketdump/eth_2054.c

    r893 r914  
    2929        static char buffer[1024]; 
    3030        char ether_buf[18] = {0, }; 
     31        int i; 
     32 
    3133        if (hrd==NULL) 
    3234                return "Truncated (Truncated)"; 
     
    3739                        break; 
    3840                default: 
    39                         int i; 
    4041                        for (i=0;i<arp->ar_hln;i++) { 
    4142                                snprintf(buffer,sizeof(buffer),"%s %02x", 
     
    5354                        break; 
    5455                default: 
    55                         int i; 
    5656                        strncat(buffer," (",sizeof(buffer)); 
    5757                        for (i=0;i<arp->ar_pln;i++) { 
     
    6565} 
    6666 
    67 extern "C" 
    6867void decode(int link_type,char *packet,int len) 
    6968{ 
  • trunk/libpacketdump/ip_1.c

    r893 r914  
    3939}; 
    4040 
    41 extern "C" 
    4241void decode(int link_type,char *packet,int len) 
    4342{ 
  • trunk/libpacketdump/ip_132.c

    r893 r914  
    22#include <inttypes.h> 
    33#include <dlfcn.h> 
    4 #include <map> 
    54#include "libpacketdump.h" 
    65 
     
    152151} 
    153152 
    154 extern "C" 
    155153void decode(int link_type,char *packet,int len) 
    156154{ 
  • trunk/libpacketdump/ip_17.c

    r893 r914  
    22#include <inttypes.h> 
    33#include <dlfcn.h> 
    4 #include <map> 
    54#include "libpacketdump.h" 
    65#include "libtrace.h" 
     
    2625 
    2726 
    28 extern "C" 
    2927void decode(int link_type,char *packet,int len) 
    3028{ 
  • trunk/libpacketdump/ip_33.c

    r893 r914  
    33#include <inttypes.h> 
    44#include <dlfcn.h> 
    5 #include <map> 
    65#include "libpacketdump.h" 
    76#include <netinet/tcp.h> 
     
    7473} 
    7574 
    76 extern "C" 
    7775void decode(int link_type,char *packet,int len) 
    7876{ 
  • trunk/libpacketdump/ip_6.c

    r893 r914  
    4646} 
    4747 
    48 extern "C" 
    4948void decode(int link_type,char *packet,int len) 
    5049{ 
     
    9796        DISPLAYS(urg_ptr," Urgent %i"); 
    9897        unsigned char *pkt = (unsigned char*)packet+sizeof(*tcp); 
    99         int plen = (len-sizeof *tcp) <? (tcp->doff*4-sizeof *tcp); 
     98        int plen = (len-sizeof *tcp) < (tcp->doff*4-sizeof(*tcp))?(len-sizeof(*tcp)):(tcp->doff*4-sizeof *tcp); 
    10099        unsigned char type,optlen,*data; 
    101100        while(get_next_option(&pkt,&plen,&type,&optlen,&data)) { 
Note: See TracChangeset for help on using the changeset viewer.