Changeset 6b6ede6
- Timestamp:
- 04/03/07 14:20:06 (15 years ago)
- 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:
- f83e07e
- Parents:
- 33dff53
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpacketdump/ip_6.c
rc14602f r6b6ede6 19 19 #define DISPLAYL(x,fmt) DISPLAY_EXP(x,fmt,htonl(tcp->x)) 20 20 #define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&tcp->x)) 21 22 int get_next_option(unsigned char **ptr,int *len,23 unsigned char *type,24 unsigned char *optlen,25 unsigned char **data)26 {27 if (*len<=0)28 return 0;29 *type=**ptr;30 switch(*type) {31 case 0:32 return 0;33 case 1:34 (*ptr)++;35 (*len)--;36 return 1;37 default:38 *optlen = *(*ptr+1);39 (*len)-=*optlen;40 (*data)=(*ptr+2);41 (*ptr)+=*optlen; /* Not optlen + 2! */42 if (*len<0)43 return 0;44 return 1;45 }46 }47 21 48 22 void decode(int link_type,char *packet,int len) … … 98 72 int plen = (len-sizeof *tcp) < (tcp->doff*4-sizeof(*tcp))?(len-sizeof(*tcp)):(tcp->doff*4-sizeof *tcp); 99 73 unsigned char type,optlen,*data; 100 while( get_next_option(&pkt,&plen,&type,&optlen,&data)) {74 while(trace_get_next_option(&pkt,&plen,&type,&optlen,&data)) { 101 75 printf("\n TCP: "); 102 76 switch(type) {
Note: See TracChangeset
for help on using the changeset viewer.