Ignore:
Timestamp:
08/20/04 11:45:32 (17 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:
d2e3359
Parents:
d907ff5
Message:

Added asn1 parsing
Started fixing bug with tcp option parsing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/tracedump/ip_6.cc

    rd907ff5 r5d6ebe1  
    66#include <netinet/tcp.h>
    77#include <netinet/in.h>
     8#include <assert.h>
    89
    910#define SAFE(x) \
     
    3132        switch(*type) {
    3233                case 0:
     34                        printf(" DEBUG: End of options\n");
    3335                        return 0;
    3436                case 1:
     37                        printf(" DEBUG: NOP\n");
    3538                        (*ptr)++;
    3639                        (*len)--;
    3740                        return 1;
    3841                default:
     42                        printf(" DEBUG: Type %i len %i\n",
     43                                        *type,*(*ptr+1));
    3944                        *optlen = *(*ptr+1);
     45                        assert(*optlen>0);
    4046                        (*len)-=*optlen;
    4147                        (*data)=(*ptr+2);
     
    7682        DISPLAYS(urg_ptr," Urgent %i");
    7783        unsigned char *pkt = (unsigned char*)packet+sizeof(*tcp);
    78         int plen = len-sizeof *tcp;
     84        int plen = (len-sizeof *tcp) <? (tcp->doff*4);
    7985        unsigned char type,optlen,*data;
    8086        while(get_next_option(&pkt,&plen,&type,&optlen,&data)) {
Note: See TracChangeset for help on using the changeset viewer.