Added header files not in Android NDK but required.
authorMitar <mitar@tnode.com>
Sun, 27 Jun 2010 19:34:08 +0000 (21:34 +0200)
committerMitar <mitar@tnode.com>
Sun, 27 Jun 2010 19:34:08 +0000 (21:34 +0200)
Linux kernel header files taken from 2.6.34 version.

android/README [new file with mode: 0644]
android/linux/if_tunnel.h [new file with mode: 0644]
android/linux/ip6_tunnel.h [new file with mode: 0644]
make/Makefile.android

diff --git a/android/README b/android/README
new file mode 100644 (file)
index 0000000..8c1da51
--- /dev/null
@@ -0,0 +1 @@
+This directory contains some Android specific code. (Mostly dealing with providing missing filesfrom Android NDK.)
diff --git a/android/linux/if_tunnel.h b/android/linux/if_tunnel.h
new file mode 100644 (file)
index 0000000..16b92d0
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef _IF_TUNNEL_H_
+#define _IF_TUNNEL_H_
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+#ifdef __KERNEL__
+#include <linux/ip.h>
+#include <linux/in6.h>
+#endif
+
+#define SIOCGETTUNNEL   (SIOCDEVPRIVATE + 0)
+#define SIOCADDTUNNEL   (SIOCDEVPRIVATE + 1)
+#define SIOCDELTUNNEL   (SIOCDEVPRIVATE + 2)
+#define SIOCCHGTUNNEL   (SIOCDEVPRIVATE + 3)
+#define SIOCGETPRL      (SIOCDEVPRIVATE + 4)
+#define SIOCADDPRL      (SIOCDEVPRIVATE + 5)
+#define SIOCDELPRL      (SIOCDEVPRIVATE + 6)
+#define SIOCCHGPRL      (SIOCDEVPRIVATE + 7)
+#define SIOCGET6RD      (SIOCDEVPRIVATE + 8)
+#define SIOCADD6RD      (SIOCDEVPRIVATE + 9)
+#define SIOCDEL6RD      (SIOCDEVPRIVATE + 10)
+#define SIOCCHG6RD      (SIOCDEVPRIVATE + 11)
+
+#define GRE_CSUM       __cpu_to_be16(0x8000)
+#define GRE_ROUTING    __cpu_to_be16(0x4000)
+#define GRE_KEY                __cpu_to_be16(0x2000)
+#define GRE_SEQ                __cpu_to_be16(0x1000)
+#define GRE_STRICT     __cpu_to_be16(0x0800)
+#define GRE_REC                __cpu_to_be16(0x0700)
+#define GRE_FLAGS      __cpu_to_be16(0x00F8)
+#define GRE_VERSION    __cpu_to_be16(0x0007)
+
+struct ip_tunnel_parm {
+       char                    name[IFNAMSIZ];
+       int                     link;
+       __be16                  i_flags;
+       __be16                  o_flags;
+       __be32                  i_key;
+       __be32                  o_key;
+       struct iphdr            iph;
+};
+
+/* SIT-mode i_flags */
+#define        SIT_ISATAP      0x0001
+
+struct ip_tunnel_prl {
+       __be32                  addr;
+       __u16                   flags;
+       __u16                   __reserved;
+       __u32                   datalen;
+       __u32                   __reserved2;
+       /* data follows */
+};
+
+/* PRL flags */
+#define        PRL_DEFAULT             0x0001
+
+struct ip_tunnel_6rd {
+       struct in6_addr         prefix;
+       __be32                  relay_prefix;
+       __u16                   prefixlen;
+       __u16                   relay_prefixlen;
+};
+
+enum {
+       IFLA_GRE_UNSPEC,
+       IFLA_GRE_LINK,
+       IFLA_GRE_IFLAGS,
+       IFLA_GRE_OFLAGS,
+       IFLA_GRE_IKEY,
+       IFLA_GRE_OKEY,
+       IFLA_GRE_LOCAL,
+       IFLA_GRE_REMOTE,
+       IFLA_GRE_TTL,
+       IFLA_GRE_TOS,
+       IFLA_GRE_PMTUDISC,
+       __IFLA_GRE_MAX,
+};
+
+#define IFLA_GRE_MAX   (__IFLA_GRE_MAX - 1)
+
+#endif /* _IF_TUNNEL_H_ */
diff --git a/android/linux/ip6_tunnel.h b/android/linux/ip6_tunnel.h
new file mode 100644 (file)
index 0000000..acb9ad6
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef _IP6_TUNNEL_H
+#define _IP6_TUNNEL_H
+
+#include <linux/types.h>
+
+#define IPV6_TLV_TNL_ENCAP_LIMIT 4
+#define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
+
+/* don't add encapsulation limit if one isn't present in inner packet */
+#define IP6_TNL_F_IGN_ENCAP_LIMIT 0x1
+/* copy the traffic class field from the inner packet */
+#define IP6_TNL_F_USE_ORIG_TCLASS 0x2
+/* copy the flowlabel from the inner packet */
+#define IP6_TNL_F_USE_ORIG_FLOWLABEL 0x4
+/* being used for Mobile IPv6 */
+#define IP6_TNL_F_MIP6_DEV 0x8
+/* copy DSCP from the outer packet */
+#define IP6_TNL_F_RCV_DSCP_COPY 0x10
+
+struct ip6_tnl_parm {
+       char name[IFNAMSIZ];    /* name of tunnel device */
+       int link;               /* ifindex of underlying L2 interface */
+       __u8 proto;             /* tunnel protocol */
+       __u8 encap_limit;       /* encapsulation limit for tunnel */
+       __u8 hop_limit;         /* hop limit for tunnel */
+       __be32 flowinfo;        /* traffic class and flowlabel for tunnel */
+       __u32 flags;            /* tunnel flags */
+       struct in6_addr laddr;  /* local tunnel end-point address */
+       struct in6_addr raddr;  /* remote tunnel end-point address */
+};
+
+#endif
index 29a9885..db3a598 100644 (file)
@@ -46,6 +46,7 @@ CC = $(CROSS_COMPILE)gcc
 endif
 
 CFLAGS += -I$(NDK_ARCH)/usr/include
+CFLAGS += -Iandroid
 
 LDFLAGS += -nostartfiles -nodefaultlibs -nostdlib
 LDFLAGS += -Wl,--dynamic-linker -Wl,/system/bin/linker