Changeset 317e903


Ignore:
Timestamp:
02/28/17 16:08:39 (4 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
d759ee1
Parents:
6450950
Message:

Add support for PPTP GRE

Credit to EaseTheWorld? for producing the original patch for this.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h.in

    rb148e3b r317e903  
    869869#define LIBTRACE_GRE_FLAG_VERMASK  0x0007
    870870
     871
     872/* PPTP GRE (RFC2637) */
     873#define LIBTRACE_GRE_FLAG_ACK      0x0080
     874#define LIBTRACE_GRE_PPTP_VERSION  0x0001
     875
    871876/** Libtrace local definition of VXLAN Header
    872877 * (draft-mahalingam-dutt-dcops-vxlan)
  • lib/protocols_transport.c

    ree6e802 r317e903  
    549549        uint32_t *remaining)
    550550{
     551    uint8_t flags = ntohs(gre->flags);
    551552    uint32_t size = 4; /* GRE is 4 bytes long by default */
    552553    if (remaining && *remaining < size) {
     
    555556    }
    556557
    557     if ((ntohs(gre->flags) & LIBTRACE_GRE_FLAG_CHECKSUM) != 0) {
    558         size += 4;  /* An extra 4 bytes. */
    559     }
    560 
    561     if ((ntohs(gre->flags) & LIBTRACE_GRE_FLAG_KEY) != 0) {
    562         size += 4;  /* An extra 4 bytes. */
    563     }
    564 
    565     if ((ntohs(gre->flags) & LIBTRACE_GRE_FLAG_SEQ) != 0) {
    566         size += 4;  /* An extra 4 bytes. */
     558    if((flags & LIBTRACE_GRE_FLAG_VERMASK) == LIBTRACE_GRE_PPTP_VERSION) {
     559        size += 4;
     560
     561        if ((flags & LIBTRACE_GRE_FLAG_SEQ) != 0) {
     562            size += 4;
     563        }
     564        if ((flags & LIBTRACE_GRE_FLAG_ACK) != 0) {
     565            size += 4;
     566        }
     567    } else {
     568
     569        if ((ntohs(gre->flags) & LIBTRACE_GRE_FLAG_CHECKSUM) != 0) {
     570            size += 4;  /* An extra 4 bytes. */
     571        }
     572
     573        if ((ntohs(gre->flags) & LIBTRACE_GRE_FLAG_KEY) != 0) {
     574           size += 4;  /* An extra 4 bytes. */
     575        }
     576
     577        if ((ntohs(gre->flags) & LIBTRACE_GRE_FLAG_SEQ) != 0) {
     578            size += 4;  /* An extra 4 bytes. */
     579        }
    567580    }
    568581
Note: See TracChangeset for help on using the changeset viewer.