ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

api_msg.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
00003  * All rights reserved. 
00004  * 
00005  * Redistribution and use in source and binary forms, with or without modification, 
00006  * are permitted provided that the following conditions are met:
00007  *
00008  * 1. Redistributions of source code must retain the above copyright notice,
00009  *    this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright notice,
00011  *    this list of conditions and the following disclaimer in the documentation
00012  *    and/or other materials provided with the distribution.
00013  * 3. The name of the author may not be used to endorse or promote products
00014  *    derived from this software without specific prior written permission. 
00015  *
00016  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
00017  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
00018  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
00019  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
00020  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
00021  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
00022  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
00023  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
00024  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
00025  * OF SUCH DAMAGE.
00026  *
00027  * This file is part of the lwIP TCP/IP stack.
00028  * 
00029  * Author: Adam Dunkels <adam@sics.se>
00030  *
00031  */
00032 #ifndef __LWIP_API_MSG_H__
00033 #define __LWIP_API_MSG_H__
00034 
00035 #include "lwip/opt.h"
00036 
00037 #if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
00038 
00039 #include <stddef.h> /* for size_t */
00040 
00041 #include "lwip/ip_addr.h"
00042 #include "lwip/err.h"
00043 #include "lwip/sys.h"
00044 #include "lwip/igmp.h"
00045 #include "lwip/api.h"
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050 
00051 /* For the netconn API, these values are use as a bitmask! */
00052 #define NETCONN_SHUT_RD   1
00053 #define NETCONN_SHUT_WR   2
00054 #define NETCONN_SHUT_RDWR (NETCONN_SHUT_RD | NETCONN_SHUT_WR)
00055 
00056 /* IP addresses and port numbers are expected to be in
00057  * the same byte order as in the corresponding pcb.
00058  */
00062 struct api_msg_msg {
00065   struct netconn *conn;
00067   err_t err;
00069   union {
00071     struct netbuf *b;
00073     struct {
00074       u8_t proto;
00075     } n;
00077     struct {
00078       ip_addr_t *ipaddr;
00079       u16_t port;
00080     } bc;
00082     struct {
00083       ip_addr_t *ipaddr;
00084       u16_t *port;
00085       u8_t local;
00086     } ad;
00088     struct {
00089       const void *dataptr;
00090       size_t len;
00091       u8_t apiflags;
00092     } w;
00094     struct {
00095       u32_t len;
00096     } r;
00098     struct {
00099       u8_t shut;
00100     } sd;
00101 #if LWIP_IGMP
00102 
00103     struct {
00104       ip_addr_t *multiaddr;
00105       ip_addr_t *netif_addr;
00106       enum netconn_igmp join_or_leave;
00107     } jl;
00108 #endif /* LWIP_IGMP */
00109 #if TCP_LISTEN_BACKLOG
00110     struct {
00111       u8_t backlog;
00112     } lb;
00113 #endif /* TCP_LISTEN_BACKLOG */
00114   } msg;
00115 };
00116 
00120 struct api_msg {
00122   void (* function)(struct api_msg_msg *msg);
00124   struct api_msg_msg msg;
00125 };
00126 
00127 #if LWIP_DNS
00128 
00132 struct dns_api_msg {
00134   const char *name;
00136   ip_addr_t *addr;
00139   sys_sem_t *sem;
00141   err_t *err;
00142 };
00143 #endif /* LWIP_DNS */
00144 
00145 void do_newconn         ( struct api_msg_msg *msg);
00146 void do_delconn         ( struct api_msg_msg *msg);
00147 void do_bind            ( struct api_msg_msg *msg);
00148 void do_connect         ( struct api_msg_msg *msg);
00149 void do_disconnect      ( struct api_msg_msg *msg);
00150 void do_listen          ( struct api_msg_msg *msg);
00151 void do_send            ( struct api_msg_msg *msg);
00152 void do_recv            ( struct api_msg_msg *msg);
00153 void do_write           ( struct api_msg_msg *msg);
00154 void do_getaddr         ( struct api_msg_msg *msg);
00155 void do_close           ( struct api_msg_msg *msg);
00156 void do_shutdown        ( struct api_msg_msg *msg);
00157 #if LWIP_IGMP
00158 void do_join_leave_group( struct api_msg_msg *msg);
00159 #endif /* LWIP_IGMP */
00160 
00161 #if LWIP_DNS
00162 void do_gethostbyname(void *arg);
00163 #endif /* LWIP_DNS */
00164 
00165 struct netconn* netconn_alloc(enum netconn_type t, netconn_callback callback);
00166 void netconn_free(struct netconn *conn);
00167 
00168 #ifdef __cplusplus
00169 }
00170 #endif
00171 
00172 #endif /* LWIP_NETCONN */
00173 
00174 #endif /* __LWIP_API_MSG_H__ */

Generated on Thu May 24 2012 04:36:34 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.