Changeset 9b25f5f


Ignore:
Timestamp:
11/25/08 14:39:11 (12 years ago)
Author:
Shane Alcock <salcock@…>
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:
530bcf0
Parents:
871281c
Message:
  • Exported trace_get_payload_from_pppoe as part of the external API
Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h.in

    redb844c r9b25f5f  
    12731273                void *mpls, uint16_t *type, uint32_t *remaining);
    12741274
     1275/** Skips over a PPPoE header and the following PPP header
     1276 * @param pppoe      A pointer to the PPPoE header
     1277 * @param[out] type  The ethernet type, replaced by the ether type of the
     1278 * next header - 0x0000 if an Ethernet header is deemed to be next
     1279 * @param[in,out] remaining     Updated with the number of bytes remaining
     1280 *
     1281 * @return a pointer to the header beyond the PPPoE header. NOTE that this
     1282 * function will also skip over the PPP header that will immediately follow
     1283 * the PPPoE header. This function will return NULL if there are not enough
     1284 * bytes remaining to skip past both the PPPoE and PPP headers.
     1285 *
     1286 * Remaining will be decremented by the size of the PPPoE and PPP headers.  If
     1287 * the headers are complete but there are zero bytes of payload after the PPP
     1288 * header, a pointer to where the payload would be is returned and remaining
     1289 * will be set to 0.  If the PPP or PPPoE header is incomplete, NULL will be
     1290 * returned and remaining will be set to 0.
     1291 *
     1292 * Type must point to the value of the ethernet type. Libtrace will assert
     1293 * fail if type is NULL.
     1294 *
     1295 */
     1296DLLEXPORT void *trace_get_payload_from_pppoe(
     1297                void *pppoe, uint16_t *type, uint32_t *remaining);
     1298
    12751299/** Gets a pointer to the payload given a pointer to a tcp header
    12761300 * @param tcp           The tcp Header
  • lib/protocols_l2.c

    r871281c r9b25f5f  
    190190void *trace_get_payload_from_pppoe(void *link, uint16_t *type,
    191191                uint32_t *remaining) {
     192        assert(type);
     193       
    192194        if (remaining) {
    193195                if (*remaining < sizeof(libtrace_pppoe_t)) {
Note: See TracChangeset for help on using the changeset viewer.