gtp: add GTP_F_* flags for GTPv1

This commit is contained in:
Pablo Neira Ayuso 2014-02-13 16:54:09 +01:00
parent ddb03d0551
commit bea2ae5e46
2 changed files with 7 additions and 3 deletions

6
gtp.c
View File

@ -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. */

4
gtp.h
View File

@ -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