@@ -158,7 +158,7 @@ typedef void *nsapi_socket_t;
158
158
/** Enum of socket protocols
159
159
*
160
160
* The socket protocol specifies a particular protocol to
161
- * be used with a newly created socket.
161
+ * be used with a newly created socket.
162
162
*
163
163
* @enum nsapi_protocol
164
164
*/
@@ -207,13 +207,15 @@ typedef enum nsapi_socket_level {
207
207
* @enum nsapi_socket_option
208
208
*/
209
209
typedef enum nsapi_socket_option {
210
- NSAPI_REUSEADDR , /*!< Allow bind to reuse local addresses */
211
- NSAPI_KEEPALIVE , /*!< Enables sending of keepalive messages */
212
- NSAPI_KEEPIDLE , /*!< Sets timeout value to initiate keepalive */
213
- NSAPI_KEEPINTVL , /*!< Sets timeout value for keepalive */
214
- NSAPI_LINGER , /*!< Keeps close from returning until queues empty */
215
- NSAPI_SNDBUF , /*!< Sets send buffer size */
216
- NSAPI_RCVBUF , /*!< Sets recv buffer size */
210
+ NSAPI_REUSEADDR , /*!< Allow bind to reuse local addresses */
211
+ NSAPI_KEEPALIVE , /*!< Enables sending of keepalive messages */
212
+ NSAPI_KEEPIDLE , /*!< Sets timeout value to initiate keepalive */
213
+ NSAPI_KEEPINTVL , /*!< Sets timeout value for keepalive */
214
+ NSAPI_LINGER , /*!< Keeps close from returning until queues empty */
215
+ NSAPI_SNDBUF , /*!< Sets send buffer size */
216
+ NSAPI_RCVBUF , /*!< Sets recv buffer size */
217
+ NSAPI_ADD_MEMBERSHIP , /*!< Add membership to multicast address */
218
+ NSAPI_DROP_MEMBERSHIP , /*!< Drop membership to multicast address */
217
219
} nsapi_socket_option_t ;
218
220
219
221
/* Backwards compatibility - previously didn't distinguish stack and socket options */
@@ -254,6 +256,13 @@ typedef struct nsapi_stack {
254
256
unsigned _stack_buffer [16 ];
255
257
} nsapi_stack_t ;
256
258
259
+ /** nsapi_ip_mreq structure
260
+ */
261
+ typedef struct nsapi_ip_mreq {
262
+ nsapi_addr_t imr_multiaddr ; /* IP multicast address of group */
263
+ nsapi_addr_t imr_interface ; /* local IP address of interface */
264
+ } nsapi_ip_mreq_t ;
265
+
257
266
/** nsapi_stack_api structure
258
267
*
259
268
* Common api structure for network stack operations. A network stack
@@ -275,9 +284,9 @@ typedef struct nsapi_stack_api
275
284
*
276
285
* The hostname may be either a domain name or an IP address. If the
277
286
* hostname is an IP address, no network transactions will be performed.
278
- *
287
+ *
279
288
* If no stack-specific DNS resolution is provided, the hostname
280
- * will be resolve using a UDP socket on the stack.
289
+ * will be resolve using a UDP socket on the stack.
281
290
*
282
291
* @param stack Stack handle
283
292
* @param addr Destination for the host IP address
@@ -322,7 +331,7 @@ typedef struct nsapi_stack_api
322
331
* @param optval Destination for option value
323
332
* @param optlen Length of the option value
324
333
* @return 0 on success, negative error code on failure
325
- */
334
+ */
326
335
nsapi_error_t (* getstackopt )(nsapi_stack_t * stack , int level ,
327
336
int optname , void * optval , unsigned * optlen );
328
337
@@ -523,7 +532,7 @@ typedef struct nsapi_stack_api
523
532
* @param optval Option value
524
533
* @param optlen Length of the option value
525
534
* @return 0 on success, negative error code on failure
526
- */
535
+ */
527
536
nsapi_error_t (* setsockopt )(nsapi_stack_t * stack , nsapi_socket_t socket , int level ,
528
537
int optname , const void * optval , unsigned optlen );
529
538
@@ -540,7 +549,7 @@ typedef struct nsapi_stack_api
540
549
* @param optval Destination for option value
541
550
* @param optlen Length of the option value
542
551
* @return 0 on success, negative error code on failure
543
- */
552
+ */
544
553
nsapi_error_t (* getsockopt )(nsapi_stack_t * stack , nsapi_socket_t socket , int level ,
545
554
int optname , void * optval , unsigned * optlen );
546
555
} nsapi_stack_api_t ;
0 commit comments