Dependents:   SNMPAgent HTTPServer think_speak_a cyassl-client ... more

Committer:
mamezu
Date:
Thu Dec 09 01:33:56 2010 +0000
Revision:
0:0f6c82fcde82

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mamezu 0:0f6c82fcde82 1 /*
mamezu 0:0f6c82fcde82 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
mamezu 0:0f6c82fcde82 3 * All rights reserved.
mamezu 0:0f6c82fcde82 4 *
mamezu 0:0f6c82fcde82 5 * Redistribution and use in source and binary forms, with or without modification,
mamezu 0:0f6c82fcde82 6 * are permitted provided that the following conditions are met:
mamezu 0:0f6c82fcde82 7 *
mamezu 0:0f6c82fcde82 8 * 1. Redistributions of source code must retain the above copyright notice,
mamezu 0:0f6c82fcde82 9 * this list of conditions and the following disclaimer.
mamezu 0:0f6c82fcde82 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
mamezu 0:0f6c82fcde82 11 * this list of conditions and the following disclaimer in the documentation
mamezu 0:0f6c82fcde82 12 * and/or other materials provided with the distribution.
mamezu 0:0f6c82fcde82 13 * 3. The name of the author may not be used to endorse or promote products
mamezu 0:0f6c82fcde82 14 * derived from this software without specific prior written permission.
mamezu 0:0f6c82fcde82 15 *
mamezu 0:0f6c82fcde82 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
mamezu 0:0f6c82fcde82 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
mamezu 0:0f6c82fcde82 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
mamezu 0:0f6c82fcde82 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
mamezu 0:0f6c82fcde82 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
mamezu 0:0f6c82fcde82 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
mamezu 0:0f6c82fcde82 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
mamezu 0:0f6c82fcde82 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
mamezu 0:0f6c82fcde82 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
mamezu 0:0f6c82fcde82 25 * OF SUCH DAMAGE.
mamezu 0:0f6c82fcde82 26 *
mamezu 0:0f6c82fcde82 27 * This file is part of the lwIP TCP/IP stack.
mamezu 0:0f6c82fcde82 28 *
mamezu 0:0f6c82fcde82 29 * Author: Adam Dunkels <adam@sics.se>
mamezu 0:0f6c82fcde82 30 *
mamezu 0:0f6c82fcde82 31 */
mamezu 0:0f6c82fcde82 32 #ifndef __LWIP_API_H__
mamezu 0:0f6c82fcde82 33 #define __LWIP_API_H__
mamezu 0:0f6c82fcde82 34
mamezu 0:0f6c82fcde82 35 #include "lwip/opt.h"
mamezu 0:0f6c82fcde82 36
mamezu 0:0f6c82fcde82 37 #if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
mamezu 0:0f6c82fcde82 38
mamezu 0:0f6c82fcde82 39 #include <stddef.h> /* for size_t */
mamezu 0:0f6c82fcde82 40
mamezu 0:0f6c82fcde82 41 #include "lwip/netbuf.h"
mamezu 0:0f6c82fcde82 42 #include "lwip/sys.h"
mamezu 0:0f6c82fcde82 43 #include "lwip/ip_addr.h"
mamezu 0:0f6c82fcde82 44 #include "lwip/err.h"
mamezu 0:0f6c82fcde82 45
mamezu 0:0f6c82fcde82 46 #ifdef __cplusplus
mamezu 0:0f6c82fcde82 47 extern "C" {
mamezu 0:0f6c82fcde82 48 #endif
mamezu 0:0f6c82fcde82 49
mamezu 0:0f6c82fcde82 50 /* Throughout this file, IP addresses and port numbers are expected to be in
mamezu 0:0f6c82fcde82 51 * the same byte order as in the corresponding pcb.
mamezu 0:0f6c82fcde82 52 */
mamezu 0:0f6c82fcde82 53
mamezu 0:0f6c82fcde82 54 /* Flags for netconn_write (u8_t) */
mamezu 0:0f6c82fcde82 55 #define NETCONN_NOFLAG 0x00
mamezu 0:0f6c82fcde82 56 #define NETCONN_NOCOPY 0x00 /* Only for source code compatibility */
mamezu 0:0f6c82fcde82 57 #define NETCONN_COPY 0x01
mamezu 0:0f6c82fcde82 58 #define NETCONN_MORE 0x02
mamezu 0:0f6c82fcde82 59 #define NETCONN_DONTBLOCK 0x04
mamezu 0:0f6c82fcde82 60
mamezu 0:0f6c82fcde82 61 /* Flags for struct netconn.flags (u8_t) */
mamezu 0:0f6c82fcde82 62 /** TCP: when data passed to netconn_write doesn't fit into the send buffer,
mamezu 0:0f6c82fcde82 63 this temporarily stores whether to wake up the original application task
mamezu 0:0f6c82fcde82 64 if data couldn't be sent in the first try. */
mamezu 0:0f6c82fcde82 65 #define NETCONN_FLAG_WRITE_DELAYED 0x01
mamezu 0:0f6c82fcde82 66 /** Should this netconn avoid blocking? */
mamezu 0:0f6c82fcde82 67 #define NETCONN_FLAG_NON_BLOCKING 0x02
mamezu 0:0f6c82fcde82 68 /** Was the last connect action a non-blocking one? */
mamezu 0:0f6c82fcde82 69 #define NETCONN_FLAG_IN_NONBLOCKING_CONNECT 0x04
mamezu 0:0f6c82fcde82 70 /** If this is set, a TCP netconn must call netconn_recved() to update
mamezu 0:0f6c82fcde82 71 the TCP receive window (done automatically if not set). */
mamezu 0:0f6c82fcde82 72 #define NETCONN_FLAG_NO_AUTO_RECVED 0x08
mamezu 0:0f6c82fcde82 73 /** If a nonblocking write has been rejected before, poll_tcp needs to
mamezu 0:0f6c82fcde82 74 check if the netconn is writable again */
mamezu 0:0f6c82fcde82 75 #define NETCONN_FLAG_CHECK_WRITESPACE 0x10
mamezu 0:0f6c82fcde82 76
mamezu 0:0f6c82fcde82 77
mamezu 0:0f6c82fcde82 78 /* Helpers to process several netconn_types by the same code */
mamezu 0:0f6c82fcde82 79 #define NETCONNTYPE_GROUP(t) (t&0xF0)
mamezu 0:0f6c82fcde82 80 #define NETCONNTYPE_DATAGRAM(t) (t&0xE0)
mamezu 0:0f6c82fcde82 81
mamezu 0:0f6c82fcde82 82 /** Protocol family and type of the netconn */
mamezu 0:0f6c82fcde82 83 enum netconn_type {
mamezu 0:0f6c82fcde82 84 NETCONN_INVALID = 0,
mamezu 0:0f6c82fcde82 85 /* NETCONN_TCP Group */
mamezu 0:0f6c82fcde82 86 NETCONN_TCP = 0x10,
mamezu 0:0f6c82fcde82 87 /* NETCONN_UDP Group */
mamezu 0:0f6c82fcde82 88 NETCONN_UDP = 0x20,
mamezu 0:0f6c82fcde82 89 NETCONN_UDPLITE = 0x21,
mamezu 0:0f6c82fcde82 90 NETCONN_UDPNOCHKSUM= 0x22,
mamezu 0:0f6c82fcde82 91 /* NETCONN_RAW Group */
mamezu 0:0f6c82fcde82 92 NETCONN_RAW = 0x40
mamezu 0:0f6c82fcde82 93 };
mamezu 0:0f6c82fcde82 94
mamezu 0:0f6c82fcde82 95 /** Current state of the netconn. Non-TCP netconns are always
mamezu 0:0f6c82fcde82 96 * in state NETCONN_NONE! */
mamezu 0:0f6c82fcde82 97 enum netconn_state {
mamezu 0:0f6c82fcde82 98 NETCONN_NONE,
mamezu 0:0f6c82fcde82 99 NETCONN_WRITE,
mamezu 0:0f6c82fcde82 100 NETCONN_LISTEN,
mamezu 0:0f6c82fcde82 101 NETCONN_CONNECT,
mamezu 0:0f6c82fcde82 102 NETCONN_CLOSE
mamezu 0:0f6c82fcde82 103 };
mamezu 0:0f6c82fcde82 104
mamezu 0:0f6c82fcde82 105 /** Use to inform the callback function about changes */
mamezu 0:0f6c82fcde82 106 enum netconn_evt {
mamezu 0:0f6c82fcde82 107 NETCONN_EVT_RCVPLUS,
mamezu 0:0f6c82fcde82 108 NETCONN_EVT_RCVMINUS,
mamezu 0:0f6c82fcde82 109 NETCONN_EVT_SENDPLUS,
mamezu 0:0f6c82fcde82 110 NETCONN_EVT_SENDMINUS,
mamezu 0:0f6c82fcde82 111 NETCONN_EVT_ERROR
mamezu 0:0f6c82fcde82 112 };
mamezu 0:0f6c82fcde82 113
mamezu 0:0f6c82fcde82 114 #if LWIP_IGMP
mamezu 0:0f6c82fcde82 115 /** Used for netconn_join_leave_group() */
mamezu 0:0f6c82fcde82 116 enum netconn_igmp {
mamezu 0:0f6c82fcde82 117 NETCONN_JOIN,
mamezu 0:0f6c82fcde82 118 NETCONN_LEAVE
mamezu 0:0f6c82fcde82 119 };
mamezu 0:0f6c82fcde82 120 #endif /* LWIP_IGMP */
mamezu 0:0f6c82fcde82 121
mamezu 0:0f6c82fcde82 122 /* forward-declare some structs to avoid to include their headers */
mamezu 0:0f6c82fcde82 123 struct ip_pcb;
mamezu 0:0f6c82fcde82 124 struct tcp_pcb;
mamezu 0:0f6c82fcde82 125 struct udp_pcb;
mamezu 0:0f6c82fcde82 126 struct raw_pcb;
mamezu 0:0f6c82fcde82 127 struct netconn;
mamezu 0:0f6c82fcde82 128 struct api_msg_msg;
mamezu 0:0f6c82fcde82 129
mamezu 0:0f6c82fcde82 130 /** A callback prototype to inform about events for a netconn */
mamezu 0:0f6c82fcde82 131 typedef void (* netconn_callback)(struct netconn *, enum netconn_evt, u16_t len);
mamezu 0:0f6c82fcde82 132
mamezu 0:0f6c82fcde82 133 /** A netconn descriptor */
mamezu 0:0f6c82fcde82 134 struct netconn {
mamezu 0:0f6c82fcde82 135 /** type of the netconn (TCP, UDP or RAW) */
mamezu 0:0f6c82fcde82 136 enum netconn_type type;
mamezu 0:0f6c82fcde82 137 /** current state of the netconn */
mamezu 0:0f6c82fcde82 138 enum netconn_state state;
mamezu 0:0f6c82fcde82 139 /** the lwIP internal protocol control block */
mamezu 0:0f6c82fcde82 140 union {
mamezu 0:0f6c82fcde82 141 struct ip_pcb *ip;
mamezu 0:0f6c82fcde82 142 struct tcp_pcb *tcp;
mamezu 0:0f6c82fcde82 143 struct udp_pcb *udp;
mamezu 0:0f6c82fcde82 144 struct raw_pcb *raw;
mamezu 0:0f6c82fcde82 145 } pcb;
mamezu 0:0f6c82fcde82 146 /** the last error this netconn had */
mamezu 0:0f6c82fcde82 147 err_t last_err;
mamezu 0:0f6c82fcde82 148 /** sem that is used to synchroneously execute functions in the core context */
mamezu 0:0f6c82fcde82 149 sys_sem_t op_completed;
mamezu 0:0f6c82fcde82 150 /** mbox where received packets are stored until they are fetched
mamezu 0:0f6c82fcde82 151 by the netconn application thread (can grow quite big) */
mamezu 0:0f6c82fcde82 152 sys_mbox_t recvmbox;
mamezu 0:0f6c82fcde82 153 #if LWIP_TCP
mamezu 0:0f6c82fcde82 154 /** mbox where new connections are stored until processed
mamezu 0:0f6c82fcde82 155 by the application thread */
mamezu 0:0f6c82fcde82 156 sys_mbox_t acceptmbox;
mamezu 0:0f6c82fcde82 157 #endif /* LWIP_TCP */
mamezu 0:0f6c82fcde82 158 /** only used for socket layer */
mamezu 0:0f6c82fcde82 159 #if LWIP_SOCKET
mamezu 0:0f6c82fcde82 160 int socket;
mamezu 0:0f6c82fcde82 161 #endif /* LWIP_SOCKET */
mamezu 0:0f6c82fcde82 162 #if LWIP_SO_RCVTIMEO
mamezu 0:0f6c82fcde82 163 /** timeout to wait for new data to be received
mamezu 0:0f6c82fcde82 164 (or connections to arrive for listening netconns) */
mamezu 0:0f6c82fcde82 165 int recv_timeout;
mamezu 0:0f6c82fcde82 166 #endif /* LWIP_SO_RCVTIMEO */
mamezu 0:0f6c82fcde82 167 #if LWIP_SO_RCVBUF
mamezu 0:0f6c82fcde82 168 /** maximum amount of bytes queued in recvmbox
mamezu 0:0f6c82fcde82 169 not used for TCP: adjust TCP_WND instead! */
mamezu 0:0f6c82fcde82 170 int recv_bufsize;
mamezu 0:0f6c82fcde82 171 #endif /* LWIP_SO_RCVBUF */
mamezu 0:0f6c82fcde82 172 /** number of bytes currently in recvmbox to be received,
mamezu 0:0f6c82fcde82 173 tested against recv_bufsize to limit bytes on recvmbox
mamezu 0:0f6c82fcde82 174 for UDP and RAW
mamezu 0:0f6c82fcde82 175 @todo: should only be necessary with LWIP_SO_RCVBUF==1 */
mamezu 0:0f6c82fcde82 176 s16_t recv_avail;
mamezu 0:0f6c82fcde82 177 /** flags holding more netconn-internal state, see NETCONN_FLAG_* defines */
mamezu 0:0f6c82fcde82 178 u8_t flags;
mamezu 0:0f6c82fcde82 179 #if LWIP_TCP
mamezu 0:0f6c82fcde82 180 /** TCP: when data passed to netconn_write doesn't fit into the send buffer,
mamezu 0:0f6c82fcde82 181 this temporarily stores how much is already sent. */
mamezu 0:0f6c82fcde82 182 size_t write_offset;
mamezu 0:0f6c82fcde82 183 /** TCP: when data passed to netconn_write doesn't fit into the send buffer,
mamezu 0:0f6c82fcde82 184 this temporarily stores the message.
mamezu 0:0f6c82fcde82 185 Also used during connect and close. */
mamezu 0:0f6c82fcde82 186 struct api_msg_msg *current_msg;
mamezu 0:0f6c82fcde82 187 #endif /* LWIP_TCP */
mamezu 0:0f6c82fcde82 188 /** A callback function that is informed about events for this netconn */
mamezu 0:0f6c82fcde82 189 netconn_callback callback;
mamezu 0:0f6c82fcde82 190 };
mamezu 0:0f6c82fcde82 191
mamezu 0:0f6c82fcde82 192 /** Register an Network connection event */
mamezu 0:0f6c82fcde82 193 #define API_EVENT(c,e,l) if (c->callback) { \
mamezu 0:0f6c82fcde82 194 (*c->callback)(c, e, l); \
mamezu 0:0f6c82fcde82 195 }
mamezu 0:0f6c82fcde82 196
mamezu 0:0f6c82fcde82 197 /** Set conn->last_err to err but don't overwrite fatal errors */
mamezu 0:0f6c82fcde82 198 #define NETCONN_SET_SAFE_ERR(conn, err) do { \
mamezu 0:0f6c82fcde82 199 SYS_ARCH_DECL_PROTECT(lev); \
mamezu 0:0f6c82fcde82 200 SYS_ARCH_PROTECT(lev); \
mamezu 0:0f6c82fcde82 201 if (!ERR_IS_FATAL((conn)->last_err)) { \
mamezu 0:0f6c82fcde82 202 (conn)->last_err = err; \
mamezu 0:0f6c82fcde82 203 } \
mamezu 0:0f6c82fcde82 204 SYS_ARCH_UNPROTECT(lev); \
mamezu 0:0f6c82fcde82 205 } while(0);
mamezu 0:0f6c82fcde82 206
mamezu 0:0f6c82fcde82 207 /* Network connection functions: */
mamezu 0:0f6c82fcde82 208 #define netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL)
mamezu 0:0f6c82fcde82 209 #define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback(t, 0, c)
mamezu 0:0f6c82fcde82 210 struct
mamezu 0:0f6c82fcde82 211 netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto,
mamezu 0:0f6c82fcde82 212 netconn_callback callback);
mamezu 0:0f6c82fcde82 213 err_t netconn_delete(struct netconn *conn);
mamezu 0:0f6c82fcde82 214 /** Get the type of a netconn (as enum netconn_type). */
mamezu 0:0f6c82fcde82 215 #define netconn_type(conn) (conn->type)
mamezu 0:0f6c82fcde82 216
mamezu 0:0f6c82fcde82 217 err_t netconn_getaddr(struct netconn *conn, ip_addr_t *addr,
mamezu 0:0f6c82fcde82 218 u16_t *port, u8_t local);
mamezu 0:0f6c82fcde82 219 #define netconn_peer(c,i,p) netconn_getaddr(c,i,p,0)
mamezu 0:0f6c82fcde82 220 #define netconn_addr(c,i,p) netconn_getaddr(c,i,p,1)
mamezu 0:0f6c82fcde82 221
mamezu 0:0f6c82fcde82 222 err_t netconn_bind(struct netconn *conn, ip_addr_t *addr, u16_t port);
mamezu 0:0f6c82fcde82 223 err_t netconn_connect(struct netconn *conn, ip_addr_t *addr, u16_t port);
mamezu 0:0f6c82fcde82 224 err_t netconn_disconnect (struct netconn *conn);
mamezu 0:0f6c82fcde82 225 err_t netconn_listen_with_backlog(struct netconn *conn, u8_t backlog);
mamezu 0:0f6c82fcde82 226 #define netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG)
mamezu 0:0f6c82fcde82 227 err_t netconn_accept(struct netconn *conn, struct netconn **new_conn);
mamezu 0:0f6c82fcde82 228 err_t netconn_recv(struct netconn *conn, struct netbuf **new_buf);
mamezu 0:0f6c82fcde82 229 err_t netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf);
mamezu 0:0f6c82fcde82 230 void netconn_recved(struct netconn *conn, u32_t length);
mamezu 0:0f6c82fcde82 231 err_t netconn_sendto(struct netconn *conn, struct netbuf *buf,
mamezu 0:0f6c82fcde82 232 ip_addr_t *addr, u16_t port);
mamezu 0:0f6c82fcde82 233 err_t netconn_send(struct netconn *conn, struct netbuf *buf);
mamezu 0:0f6c82fcde82 234 err_t netconn_write(struct netconn *conn, const void *dataptr, size_t size,
mamezu 0:0f6c82fcde82 235 u8_t apiflags);
mamezu 0:0f6c82fcde82 236 err_t netconn_close(struct netconn *conn);
mamezu 0:0f6c82fcde82 237 err_t netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx);
mamezu 0:0f6c82fcde82 238
mamezu 0:0f6c82fcde82 239 #if LWIP_IGMP
mamezu 0:0f6c82fcde82 240 err_t netconn_join_leave_group(struct netconn *conn, ip_addr_t *multiaddr,
mamezu 0:0f6c82fcde82 241 ip_addr_t *netif_addr, enum netconn_igmp join_or_leave);
mamezu 0:0f6c82fcde82 242 #endif /* LWIP_IGMP */
mamezu 0:0f6c82fcde82 243 #if LWIP_DNS
mamezu 0:0f6c82fcde82 244 err_t netconn_gethostbyname(const char *name, ip_addr_t *addr);
mamezu 0:0f6c82fcde82 245 #endif /* LWIP_DNS */
mamezu 0:0f6c82fcde82 246
mamezu 0:0f6c82fcde82 247 #define netconn_err(conn) ((conn)->last_err)
mamezu 0:0f6c82fcde82 248 #define netconn_recv_bufsize(conn) ((conn)->recv_bufsize)
mamezu 0:0f6c82fcde82 249
mamezu 0:0f6c82fcde82 250 /** Set the blocking status of netconn calls (@todo: write/send is missing) */
mamezu 0:0f6c82fcde82 251 #define netconn_set_nonblocking(conn, val) do { if(val) { \
mamezu 0:0f6c82fcde82 252 (conn)->flags |= NETCONN_FLAG_NON_BLOCKING; \
mamezu 0:0f6c82fcde82 253 } else { \
mamezu 0:0f6c82fcde82 254 (conn)->flags &= ~ NETCONN_FLAG_NON_BLOCKING; }} while(0)
mamezu 0:0f6c82fcde82 255 /** Get the blocking status of netconn calls (@todo: write/send is missing) */
mamezu 0:0f6c82fcde82 256 #define netconn_is_nonblocking(conn) (((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0)
mamezu 0:0f6c82fcde82 257
mamezu 0:0f6c82fcde82 258 /** TCP: Set the no-auto-recved status of netconn calls (see NETCONN_FLAG_NO_AUTO_RECVED) */
mamezu 0:0f6c82fcde82 259 #define netconn_set_noautorecved(conn, val) do { if(val) { \
mamezu 0:0f6c82fcde82 260 (conn)->flags |= NETCONN_FLAG_NO_AUTO_RECVED; \
mamezu 0:0f6c82fcde82 261 } else { \
mamezu 0:0f6c82fcde82 262 (conn)->flags &= ~ NETCONN_FLAG_NO_AUTO_RECVED; }} while(0)
mamezu 0:0f6c82fcde82 263 /** TCP: Get the no-auto-recved status of netconn calls (see NETCONN_FLAG_NO_AUTO_RECVED) */
mamezu 0:0f6c82fcde82 264 #define netconn_get_noautorecved(conn) (((conn)->flags & NETCONN_FLAG_NO_AUTO_RECVED) != 0)
mamezu 0:0f6c82fcde82 265
mamezu 0:0f6c82fcde82 266 #if LWIP_SO_RCVTIMEO
mamezu 0:0f6c82fcde82 267 /** Set the receive timeout in milliseconds */
mamezu 0:0f6c82fcde82 268 #define netconn_set_recvtimeout(conn, timeout) ((conn)->recv_timeout = (timeout))
mamezu 0:0f6c82fcde82 269 /** Get the receive timeout in milliseconds */
mamezu 0:0f6c82fcde82 270 #define netconn_get_recvtimeout(conn) ((conn)->recv_timeout)
mamezu 0:0f6c82fcde82 271 #endif /* LWIP_SO_RCVTIMEO */
mamezu 0:0f6c82fcde82 272 #if LWIP_SO_RCVBUF
mamezu 0:0f6c82fcde82 273 /** Set the receive buffer in bytes */
mamezu 0:0f6c82fcde82 274 #define netconn_set_recvbufsize(conn, recvbufsize) ((conn)->recv_bufsize = (recvbufsize))
mamezu 0:0f6c82fcde82 275 /** Get the receive buffer in bytes */
mamezu 0:0f6c82fcde82 276 #define netconn_get_recvbufsize(conn) ((conn)->recv_bufsize)
mamezu 0:0f6c82fcde82 277 #endif /* LWIP_SO_RCVBUF*/
mamezu 0:0f6c82fcde82 278
mamezu 0:0f6c82fcde82 279 #ifdef __cplusplus
mamezu 0:0f6c82fcde82 280 }
mamezu 0:0f6c82fcde82 281 #endif
mamezu 0:0f6c82fcde82 282
mamezu 0:0f6c82fcde82 283 #endif /* LWIP_NETCONN */
mamezu 0:0f6c82fcde82 284
mamezu 0:0f6c82fcde82 285 #endif /* __LWIP_API_H__ */