qos length bugfix and apple support plus header cleanup
diff --git a/gtp/gtp.c b/gtp/gtp.c
index d7880a1..9d4ea7b 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -1,17 +1,12 @@
 /* 
  *  OpenGGSN - Gateway GPRS Support Node
- *  Copyright (C) 2002 Mondru AB.
+ *  Copyright (C) 2002, 2003, 2004 Mondru AB.
  * 
  *  The contents of this file may be used under the terms of the GNU
  *  General Public License Version 2, provided that the above copyright
  *  notice and this permission notice is included in all copies or
  *  substantial portions of the software.
  * 
- *  The initial developer of the original code is
- *  Jens Jakobsen <jj@openggsn.org>
- * 
- *  Contributor(s):
- * 
  */
 
 /*
@@ -27,6 +22,10 @@
 #define _GNU_SOURCE 1
 #endif
 
+#include "../config.h"
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
 
 #include <syslog.h>
 #include <stdio.h>
@@ -48,7 +47,6 @@
 
 /* #include <stdint.h>  ISO C99 types */
 
-#include "../config.h"
 #include "pdp.h"
 #include "gtp.h"
 #include "gtpie.h"
@@ -407,7 +405,7 @@
   memset(&addr, 0, sizeof(addr));
   addr.sin_family = AF_INET;
   addr.sin_addr = *inetaddr;
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__APPLE__)
   addr.sin_len = sizeof(addr);
 #endif
 
@@ -766,7 +764,7 @@
   addr.sin_family = AF_INET;
   addr.sin_addr = *listen;  /* Same IP for user traffic and signalling*/
   addr.sin_port = htons(GTP0_PORT);
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__APPLE__)
   addr.sin_len = sizeof(addr);
 #endif
   
@@ -787,7 +785,7 @@
   addr.sin_family = AF_INET;
   addr.sin_addr = *listen;  /* Same IP for user traffic and signalling*/
   addr.sin_port = htons(GTP1C_PORT);
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__APPLE__)
   addr.sin_len = sizeof(addr);
 #endif
   
@@ -808,7 +806,7 @@
   addr.sin_family = AF_INET;
   addr.sin_addr = *listen;  /* Same IP for user traffic and signalling*/
   addr.sin_port = htons(GTP1U_PORT);
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__APPLE__)
   addr.sin_len = sizeof(addr);
 #endif
   
@@ -2944,7 +2942,7 @@
 
   memset(&addr, 0, sizeof(addr));
   addr.sin_family = AF_INET;
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__APPLE__)
   addr.sin_len = sizeof(addr);
 #endif
 
diff --git a/gtp/gtp.h b/gtp/gtp.h
index 7e09f6d..7b5083b 100644
--- a/gtp/gtp.h
+++ b/gtp/gtp.h
@@ -1,17 +1,12 @@
 /* 
  *  OpenGGSN - Gateway GPRS Support Node
- *  Copyright (C) 2002 Mondru AB.
+ *  Copyright (C) 2002, 2003, 2004 Mondru AB.
  * 
  *  The contents of this file may be used under the terms of the GNU
  *  General Public License Version 2, provided that the above copyright
  *  notice and this permission notice is included in all copies or
  *  substantial portions of the software.
  * 
- *  The initial developer of the original code is
- *  Jens Jakobsen <jj@openggsn.org>
- * 
- *  Contributor(s):
- * 
  */
 
 #ifndef _GTP_H
@@ -217,7 +212,7 @@
   struct gtp0_packet        gtp0;
   struct gtp1_packet_short  gtp1s;
   struct gtp1_packet_long   gtp1l;
-} __attribute__((packed)) h;
+} __attribute__((packed));
 
 
 
diff --git a/gtp/gtpie.c b/gtp/gtpie.c
index ac98294..55d3f32 100644
--- a/gtp/gtpie.c
+++ b/gtp/gtpie.c
@@ -7,11 +7,6 @@
  *  notice and this permission notice is included in all copies or
  *  substantial portions of the software.
  * 
- *  The initial developer of the original code is
- *  Jens Jakobsen <jj@openggsn.org>
- * 
- *  Contributor(s):
- * 
  */
 
 /*
@@ -31,6 +26,12 @@
  *
  */
 
+#include <../config.h>
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <netinet/in.h>
diff --git a/gtp/gtpie.h b/gtp/gtpie.h
index c376124..9c0e3ca 100644
--- a/gtp/gtpie.h
+++ b/gtp/gtpie.h
@@ -1,17 +1,12 @@
 /* 
  *  OpenGGSN - Gateway GPRS Support Node
- *  Copyright (C) 2002 Mondru AB.
+ *  Copyright (C) 2002, 2003, 2004 Mondru AB.
  * 
  *  The contents of this file may be used under the terms of the GNU
  *  General Public License Version 2, provided that the above copyright
  *  notice and this permission notice is included in all copies or
  *  substantial portions of the software.
  * 
- *  The initial developer of the original code is
- *  Jens Jakobsen <jj@openggsn.org>
- * 
- *  Contributor(s):
- * 
  */
 
 #ifndef _GTPIE_H
diff --git a/gtp/pdp.c b/gtp/pdp.c
index 3a652b8..648d70d 100644
--- a/gtp/pdp.c
+++ b/gtp/pdp.c
@@ -1,17 +1,12 @@
 /* 
  *  OpenGGSN - Gateway GPRS Support Node
- *  Copyright (C) 2002, 2003 Mondru AB.
+ *  Copyright (C) 2002, 2003, 2004 Mondru AB.
  * 
  *  The contents of this file may be used under the terms of the GNU
  *  General Public License Version 2, provided that the above copyright
  *  notice and this permission notice is included in all copies or
  *  substantial portions of the software.
  * 
- *  The initial developer of the original code is
- *  Jens Jakobsen <jj@openggsn.org>
- * 
- *  Contributor(s):
- * 
  */
 
 /*
@@ -19,6 +14,12 @@
  *
  */
 
+#include <../config.h>
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <netinet/in.h>
diff --git a/gtp/pdp.h b/gtp/pdp.h
index a6780cd..59541c6 100644
--- a/gtp/pdp.h
+++ b/gtp/pdp.h
@@ -7,11 +7,6 @@
  *  notice and this permission notice is included in all copies or
  *  substantial portions of the software.
  * 
- *  The initial developer of the original code is
- *  Jens Jakobsen <jj@openggsn.org>
- * 
- *  Contributor(s):
- * 
  */
 
 #ifndef _PDP_H
diff --git a/gtp/queue.c b/gtp/queue.c
index 845b4ba..7fdf9df 100644
--- a/gtp/queue.c
+++ b/gtp/queue.c
@@ -1,17 +1,12 @@
 /* 
  *  OpenGGSN - Gateway GPRS Support Node
- *  Copyright (C) 2002 Mondru AB.
+ *  Copyright (C) 2002, 2003, 2004 Mondru AB.
  * 
  *  The contents of this file may be used under the terms of the GNU
  *  General Public License Version 2, provided that the above copyright
  *  notice and this permission notice is included in all copies or
  *  substantial portions of the software.
  * 
- *  The initial developer of the original code is
- *  Jens Jakobsen <jj@openggsn.org>
- * 
- *  Contributor(s):
- * 
  */
 
 /*
@@ -19,6 +14,11 @@
  * Reliable delivery of signalling messages
  */
 
+#include <../config.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/types.h>
diff --git a/gtp/queue.h b/gtp/queue.h
index 1e95676..46fa22d 100644
--- a/gtp/queue.h
+++ b/gtp/queue.h
@@ -7,11 +7,6 @@
  *  notice and this permission notice is included in all copies or
  *  substantial portions of the software.
  * 
- *  The initial developer of the original code is
- *  Jens Jakobsen <jj@openggsn.org>
- * 
- *  Contributor(s):
- * 
  */
 
 /*
@@ -22,15 +17,15 @@
 #ifndef _QUEUE_H
 #define _QUEUE_H
 
-#define QUEUE_DEBUG 0    /* Print debug information */
+#define QUEUE_DEBUG 0     /* Print debug information */
 
-#define QUEUE_SIZE 1024  /* Size of retransmission queue */
+#define QUEUE_SIZE 1024   /* Size of retransmission queue */
 #define QUEUE_HASH_SIZE 65536 /* Size of hash table (2^16) */
 
 struct qmsg_t {           /* Holder for queued packets */
   int state;              /* 0=empty, 1=full */
   uint16_t seq;           /* The sequence number */
-  uint8_t type;          /* The type of packet */
+  uint8_t type;           /* The type of packet */
   void *cbp;              /* Application specific pointer */
   union gtp_packet p;     /* The packet stored */
   int l;                  /* Length of the packet */