]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/lwIP_MCF5235_GCC/lwip/src/include/ipv4/lwip/inet.h
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / lwIP_MCF5235_GCC / lwip / src / include / ipv4 / lwip / inet.h
diff --git a/FreeRTOS/Demo/lwIP_MCF5235_GCC/lwip/src/include/ipv4/lwip/inet.h b/FreeRTOS/Demo/lwIP_MCF5235_GCC/lwip/src/include/ipv4/lwip/inet.h
new file mode 100644 (file)
index 0000000..5428d54
--- /dev/null
@@ -0,0 +1,87 @@
+/*\r
+ * Copyright (c) 2001-2004 Swedish Institute of Computer Science.\r
+ * All rights reserved. \r
+ * \r
+ * Redistribution and use in source and binary forms, with or without modification, \r
+ * are permitted provided that the following conditions are met:\r
+ *\r
+ * 1. Redistributions of source code must retain the above copyright notice,\r
+ *    this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright notice,\r
+ *    this list of conditions and the following disclaimer in the documentation\r
+ *    and/or other materials provided with the distribution.\r
+ * 3. The name of the author may not be used to endorse or promote products\r
+ *    derived from this software without specific prior written permission. \r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED \r
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF \r
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT \r
+ * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, \r
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \r
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING \r
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY \r
+ * OF SUCH DAMAGE.\r
+ *\r
+ * This file is part of the lwIP TCP/IP stack.\r
+ * \r
+ * Author: Adam Dunkels <adam@sics.se>\r
+ *\r
+ */\r
+#ifndef __LWIP_INET_H__\r
+#define __LWIP_INET_H__\r
+\r
+#include "lwip/arch.h"\r
+\r
+#include "lwip/opt.h"\r
+#include "lwip/pbuf.h"\r
+#include "lwip/ip_addr.h"\r
+\r
+u16_t inet_chksum(void *dataptr, u16_t len);\r
+#if 0 /* optimized routine */\r
+u16_t inet_chksum4(u8_t *dataptr, u16_t len);\r
+#endif\r
+u16_t inet_chksum_pbuf(struct pbuf *p);\r
+u16_t inet_chksum_pseudo(struct pbuf *p,\r
+       struct ip_addr *src, struct ip_addr *dest,\r
+       u8_t proto, u16_t proto_len);\r
+\r
+u32_t inet_addr(const char *cp);\r
+s8_t inet_aton(const char *cp, struct in_addr *addr);\r
+char *inet_ntoa(struct in_addr addr); /* returns ptr to static buffer; not reentrant! */\r
+\r
+#ifdef htons\r
+#undef htons\r
+#endif /* htons */\r
+#ifdef htonl\r
+#undef htonl\r
+#endif /* htonl */\r
+#ifdef ntohs\r
+#undef ntohs\r
+#endif /* ntohs */\r
+#ifdef ntohl\r
+#undef ntohl\r
+#endif /* ntohl */\r
+\r
+#if BYTE_ORDER == BIG_ENDIAN\r
+#define htons(x) (x)\r
+#define ntohs(x) (x)\r
+#define htonl(x) (x)\r
+#define ntohl(x) (x)\r
+#else\r
+#ifdef LWIP_PREFIX_BYTEORDER_FUNCS\r
+/* workaround for naming collisions on some platforms */\r
+#define htons lwip_htons\r
+#define ntohs lwip_ntohs\r
+#define htonl lwip_htonl\r
+#define ntohl lwip_ntohl\r
+#endif\r
+u16_t htons(u16_t x);\r
+u16_t ntohs(u16_t x);\r
+u32_t htonl(u32_t x);\r
+u32_t ntohl(u32_t x);\r
+#endif\r
+\r
+#endif /* __LWIP_INET_H__ */\r
+\r