aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2011-04-08 04:38:59 -0700
committerEric W. Biederman <ebiederm@xmission.com>2011-04-08 14:35:01 -0700
commit79519817d7949054e4934d166e21d275362eddd9 (patch)
tree89a4187ed533d9c28db1dcf45487212ed1d92a8c
parent0c26be28ddd5b63083ad0fbe98625458a61df340 (diff)
downloadsyslinux-79519817d7949054e4934d166e21d275362eddd9.tar.gz
syslinux-79519817d7949054e4934d166e21d275362eddd9.tar.xz
syslinux-79519817d7949054e4934d166e21d275362eddd9.zip
lwip: Minimal configuration to get lwip building in syslinux
- Disable all of lwip advanced features - Redeclare kaboom because including core.h causes the artificial namespace conflict on lfree. t lfree is a global sylinux function and lwip static variable. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
-rw-r--r--com32/include/errno.h21
-rw-r--r--core/Makefile3
-rw-r--r--core/lwip/src/include/arch/cc.h36
-rw-r--r--core/lwip/src/include/arch/perf.h7
-rw-r--r--core/lwip/src/include/arch/sys_arch.h7
-rw-r--r--core/lwip/src/include/lwipopts.h9
6 files changed, 82 insertions, 1 deletions
diff --git a/com32/include/errno.h b/com32/include/errno.h
index 36690bf6..40bf2ecc 100644
--- a/com32/include/errno.h
+++ b/com32/include/errno.h
@@ -131,4 +131,25 @@ extern int errno;
#define ENOMEDIUM 123 /* No medium found */
#define EMEDIUMTYPE 124 /* Wrong medium type */
+/* lwIP nameserver query return codes */
+#define ENSROK 0 /* DNS server returned answer with no data */
+#define ENSRNODATA 160 /* DNS server returned answer with no data */
+#define ENSRFORMERR 161 /* DNS server claims query was misformatted */
+#define ENSRSERVFAIL 162 /* DNS server returned general failure */
+#define ENSRNOTFOUND 163 /* Domain name not found */
+#define ENSRNOTIMP 164 /* DNS server does not implement requested operation */
+#define ENSRREFUSED 165 /* DNS server refused query */
+#define ENSRBADQUERY 166 /* Misformatted DNS query */
+#define ENSRBADNAME 167 /* Misformatted domain name */
+#define ENSRBADFAMILY 168 /* Unsupported address family */
+#define ENSRBADRESP 169 /* Misformatted DNS reply */
+#define ENSRCONNREFUSED 170 /* Could not contact DNS servers */
+#define ENSRTIMEOUT 171 /* Timeout while contacting DNS servers */
+#define ENSROF 172 /* End of file */
+#define ENSRFILE 173 /* Error reading file */
+#define ENSRNOMEM 174 /* Out of memory */
+#define ENSRDESTRUCTION 175 /* Application terminated lookup */
+#define ENSRQUERYDOMAINTOOLONG 176 /* Domain name is too long */
+#define ENSRCNAMELOOP 177 /* Domain name is too long */
+
#endif /* _ERRNO_H */
diff --git a/core/Makefile b/core/Makefile
index 44e14894..f1afd6e4 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -24,7 +24,8 @@ include $(topdir)/MCONFIG.embedded
-include $(topdir)/version.mk
OPTFLAGS =
-INCLUDES = -I./include -I$(com32)/include
+INCLUDES = -I./include -I$(com32)/include \
+ -I./lwip/src/include -I./lwip/src/include/ipv4
# This is very similar to cp437; technically it's for Norway and Denmark,
# but it's unlikely the characters that are different will be used in
diff --git a/core/lwip/src/include/arch/cc.h b/core/lwip/src/include/arch/cc.h
new file mode 100644
index 00000000..0df87f7d
--- /dev/null
+++ b/core/lwip/src/include/arch/cc.h
@@ -0,0 +1,36 @@
+#ifndef __LWIP_ARCH_CC_H__
+#define __LWIP_ARCH_CC_H__
+
+#include <klibc/compiler.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdlib.h>
+
+#define BYTE_ORDER LITTLE_ENDIAN
+
+typedef uint8_t u8_t;
+typedef int8_t s8_t;
+typedef uint16_t u16_t;
+typedef int16_t s16_t;
+typedef uint32_t u32_t;
+typedef int32_t s32_t;
+
+typedef uintptr_t mem_ptr_t;
+
+extern __noreturn _kaboom(void);
+#define kaboom() _kaboom()
+
+#define PACK_STRUCT_STRUCT __packed
+
+#define LWIP_PLATFORM_DIAG(x) ((void)0) /* For now... */
+#define LWIP_PLATFORM_ASSERT(x) kaboom()
+
+#define U16_F PRIu16
+#define S16_F PRId16
+#define X16_F PRIx16
+#define U32_F PRIu16
+#define S32_F PRId16
+#define X32_F PRIx16
+#define SZT_F "zu"
+
+#endif /* __LWIP_ARCH_CC_H__ */
diff --git a/core/lwip/src/include/arch/perf.h b/core/lwip/src/include/arch/perf.h
new file mode 100644
index 00000000..4ceb850c
--- /dev/null
+++ b/core/lwip/src/include/arch/perf.h
@@ -0,0 +1,7 @@
+#ifndef __LWIP_ARCH_PERF_H__
+#define __LWIP_ARCH_PERF_H__
+
+#define PERF_START
+#define PERF_STOP(x)
+
+#endif /* __LWIP_ARCH_PERF_H__ */
diff --git a/core/lwip/src/include/arch/sys_arch.h b/core/lwip/src/include/arch/sys_arch.h
new file mode 100644
index 00000000..f5ab07ee
--- /dev/null
+++ b/core/lwip/src/include/arch/sys_arch.h
@@ -0,0 +1,7 @@
+#ifndef __LWIP_ARCH_SYS_ARCH_H__
+#define __LWIP_ARCH_SYS_ARCH_H__
+
+#include <stddef.h>
+#include "arch/cc.h"
+
+#endif /* __LWIP_ARCH_SYS_ARCH_H__ */
diff --git a/core/lwip/src/include/lwipopts.h b/core/lwip/src/include/lwipopts.h
new file mode 100644
index 00000000..656c45fc
--- /dev/null
+++ b/core/lwip/src/include/lwipopts.h
@@ -0,0 +1,9 @@
+#ifndef __LWIPOPTS_H__
+#define __LWIPOPTS_H__
+
+/* Disable most things so I can get lwip to build */
+#define NO_SYS 1
+#define LWIP_NETCONN 0
+#define LWIP_SOCKET 0
+
+#endif /* __LWIPOPTS_H__ */