Changeset 7c72e4d for lib/linktypes.c


Ignore:
Timestamp:
06/20/07 13:10:40 (14 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:
8ee3dbd
Parents:
f93f0b3
Message:

Add caching of trace_get_capture_length() (since this is used a lot in protocol
decodes to figure out if we captured the full header we're about to decode).

Add caching of the l3 header (avoiding parsing the linktype/l2/l2.5 protocol
headers).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/linktypes.c

    rf93f0b3 r7c72e4d  
    161161                case ARPHRD_PPP: return TRACE_TYPE_NONE;
    162162        }
     163        printf("Unknown ARPHRD %08x\n",arphrd);
    163164        return ~0U;
    164165}
     
    300301                        packet->trace=trace;
    301302
     303                        /* Invalidate caches */
     304                        packet->l3_header = NULL;
     305                        packet->capture_length = -1;
     306
    302307                        return true;
    303308
     
    321326                                trace_get_capture_length(packet)
    322327                                        -sizeof(libtrace_sll_header_t));
     328
     329                        /* Invalidate caches */
     330                        packet->l3_header = NULL;
     331                        packet->capture_length = -1;
    323332                        break;
    324333                default:
    325334                        return false;
    326335        }
     336
     337        /* Invalidate caches */
     338        packet->l3_header = NULL;
     339        packet->capture_length = -1;
    327340        return true;
    328341}
Note: See TracChangeset for help on using the changeset viewer.