From bea2ae5e4686e962256cec5e8e00f253042abed7 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 13 Feb 2014 16:54:09 +0100 Subject: [PATCH] gtp: add GTP_F_* flags for GTPv1 --- gtp.c | 6 +++--- gtp.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gtp.c b/gtp.c index 57d9974..61b5f09 100644 --- a/gtp.c +++ b/gtp.c @@ -284,15 +284,15 @@ static int gtp1u_udp_encap_recv(struct gtp_instance *gti, struct sk_buff *skb) * length iteratively */ /* sequence number present */ - if (gtp1->flags & 0x02) + if (gtp1->flags & GTP1_F_SEQ) min_len += 2; /* N-PDU number present */ - if (gtp1->flags & 0x01) + if (gtp1->flags & GTP1_F_NPDU) min_len++; /* next extension header type present */ - if (gtp1->flags & 0x04) + if (gtp1->flags & GTP1_F_EXTHDR) min_len += 1; /* check if it is T-PDU. */ diff --git a/gtp.h b/gtp.h index 48a2b27..f5ab04a 100644 --- a/gtp.h +++ b/gtp.h @@ -39,4 +39,8 @@ struct gtp1_header { /* According to 3GPP TS 29.060 */ __be32 tid; } __attribute__ ((packed)); +#define GTP1_F_NPDU 0x01 +#define GTP1_F_SEQ 0x02 +#define GTP1_F_EXTHDR 0x04 + #endif