--- /dev/null
+/*\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_API_MSG_H__\r
+#define __LWIP_API_MSG_H__\r
+\r
+#include "lwip/opt.h"\r
+#include "lwip/pbuf.h"\r
+#include "lwip/sys.h"\r
+\r
+#include "lwip/ip.h"\r
+\r
+#include "lwip/udp.h"\r
+#include "lwip/tcp.h"\r
+\r
+#include "lwip/api.h"\r
+\r
+enum api_msg_type {\r
+ API_MSG_NEWCONN,\r
+ API_MSG_DELCONN,\r
+ \r
+ API_MSG_BIND,\r
+ API_MSG_CONNECT,\r
+ API_MSG_DISCONNECT,\r
+\r
+ API_MSG_LISTEN,\r
+ API_MSG_ACCEPT,\r
+\r
+ API_MSG_SEND,\r
+ API_MSG_RECV,\r
+ API_MSG_WRITE,\r
+\r
+ API_MSG_CLOSE,\r
+ \r
+ API_MSG_MAX\r
+};\r
+\r
+struct api_msg_msg {\r
+ struct netconn *conn;\r
+ enum netconn_type conntype;\r
+ union {\r
+ struct pbuf *p; \r
+ struct {\r
+ struct ip_addr *ipaddr;\r
+ u16_t port;\r
+ } bc;\r
+ struct {\r
+ void *dataptr;\r
+ u16_t len;\r
+ u8_t copy;\r
+ } w; \r
+ sys_mbox_t mbox;\r
+ u16_t len;\r
+ } msg;\r
+};\r
+\r
+struct api_msg {\r
+ enum api_msg_type type;\r
+ struct api_msg_msg msg;\r
+};\r
+\r
+void api_msg_input(struct api_msg *msg);\r
+void api_msg_post(struct api_msg *msg);\r
+\r
+#endif /* __LWIP_API_MSG_H__ */\r
+\r