Structures that are used to cast packet data into fields need to be packed
so that the compiler doesn't add any padding to these fields. This also helps
Tile-Gx to avoid unaligned loads because the compiler will insert code to
handle the possible unaligned load.
uint16_t answer_rr;
uint16_t authority_rr;
uint16_t additional_rr;
-} DNSHeader;
+} __attribute__((__packed__)) DNSHeader;
typedef struct DNSQueryTrailer_ {
uint16_t type;
uint16_t class;
-} DNSQueryTrailer;
+} __attribute__((__packed__)) DNSQueryTrailer;
/** \brief DNS answer header
* packed as we don't want alignment to mess up sizeof() */
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2013 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
uint16_t th_win; /**< pkt window */
uint16_t th_sum; /**< checksum */
uint16_t th_urp; /**< urgent pointer */
-} TCPHdr;
+} __attribute__((__packed__)) TCPHdr;
typedef struct TCPVars_
{
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2013 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
uint16_t uh_dport; /* destination port */
uint16_t uh_len; /* length */
uint16_t uh_sum; /* checksum */
-} UDPHdr;
+} __attribute__((__packed__)) UDPHdr;
typedef struct UDPVars_
{