ensure that Q.921/Q.931 structures are always aligned on 8-bit boundaries, even on platforms with non-default structure alignment (bug #4052)

git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@211 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Kevin P. Fleming 2005-04-20 15:23:35 +00:00
parent c03b48392a
commit 0a3a816622
2 changed files with 6 additions and 6 deletions

View File

@ -78,7 +78,7 @@ typedef struct q921_header {
u_int8_t tei:7; /* Terminal Endpoint Identifier (0) */ u_int8_t tei:7; /* Terminal Endpoint Identifier (0) */
#endif #endif
u_int8_t data[0]; /* Further data */ u_int8_t data[0]; /* Further data */
} q921_header; } __attribute__ ((packed)) q921_header;
/* A Supervisory Format frame */ /* A Supervisory Format frame */
typedef struct q921_s { typedef struct q921_s {
@ -98,7 +98,7 @@ typedef struct q921_s {
#endif #endif
u_int8_t data[0]; /* Any further data */ u_int8_t data[0]; /* Any further data */
u_int8_t fcs[2]; /* At least an FCS */ u_int8_t fcs[2]; /* At least an FCS */
} q921_s; } __attribute__ ((packed)) q921_s;
/* An Unnumbered Format frame */ /* An Unnumbered Format frame */
typedef struct q921_u { typedef struct q921_u {
@ -116,7 +116,7 @@ typedef struct q921_u {
#endif #endif
u_int8_t data[0]; /* Any further data */ u_int8_t data[0]; /* Any further data */
u_int8_t fcs[2]; /* At least an FCS */ u_int8_t fcs[2]; /* At least an FCS */
} q921_u; } __attribute__ ((packed)) q921_u;
/* An Information frame */ /* An Information frame */
typedef struct q921_i { typedef struct q921_i {

View File

@ -81,7 +81,7 @@ typedef struct q931_h {
#endif #endif
u_int8_t contents[0]; u_int8_t contents[0];
u_int8_t crv[3]; u_int8_t crv[3];
} q931_h; } __attribute__ ((packed)) q931_h;
/* Message type header */ /* Message type header */
@ -94,14 +94,14 @@ typedef struct q931_mh {
u_int8_t f:1; u_int8_t f:1;
#endif #endif
u_int8_t data[0]; u_int8_t data[0];
} q931_mh; } __attribute__ ((packed)) q931_mh;
/* Information element format */ /* Information element format */
typedef struct q931_ie { typedef struct q931_ie {
u_int8_t ie; u_int8_t ie;
u_int8_t len; u_int8_t len;
u_int8_t data[0]; u_int8_t data[0];
} q931_ie; } __attribute__ ((packed)) q931_ie;
#define Q931_RES_HAVEEVENT (1 << 0) #define Q931_RES_HAVEEVENT (1 << 0)
#define Q931_RES_INERRROR (1 << 1) #define Q931_RES_INERRROR (1 << 1)