gtp: use endian-aware types

Good to spot endianness issues via sparse.
This commit is contained in:
Pablo Neira Ayuso 2014-02-13 16:37:37 +01:00
parent 19980460cc
commit bf2b3b38a7
1 changed files with 12 additions and 12 deletions

24
gtp.h
View File

@ -22,21 +22,21 @@
#define GTP_TPDU 255 #define GTP_TPDU 255
struct gtp0_header { /* According to GSM TS 09.60 */ struct gtp0_header { /* According to GSM TS 09.60 */
uint8_t flags; __u8 flags;
uint8_t type; __u8 type;
uint16_t length; __be16 length;
uint16_t seq; __be16 seq;
uint16_t flow; __be16 flow;
uint8_t number; __u8 number;
uint8_t spare[3]; __u8 spare[3];
uint64_t tid; __be64 tid;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct gtp1_header_short { /* According to 3GPP TS 29.060 */ struct gtp1_header_short { /* According to 3GPP TS 29.060 */
uint8_t flags; __u8 flags;
uint8_t type; __u8 type;
uint16_t length; __be16 length;
uint32_t tid; __be32 tid;
} __attribute__ ((packed)); } __attribute__ ((packed));
#define gtp1u_header gtp1_header_short /* XXX */ #define gtp1u_header gtp1_header_short /* XXX */