Skip to content

Commit a4f1071

Browse files
committed
Add standardized stack options
1 parent abd25f9 commit a4f1071

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

NetworkStack.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@ enum nsapi_protocol_t {
5353
NSAPI_UDP, /*!< Socket is of UDP type */
5454
};
5555

56+
/* Enum of standardized stack option levels
57+
*
58+
* @enum nsapi_level_t
59+
*/
60+
enum nsapi_level_t {
61+
NSAPI_STACK, /*!< Stack option level */
62+
NSAPI_SOCKET, /*!< Socket option level */
63+
};
64+
65+
/* Enum of standardized stack options
66+
*
67+
* These options may not be supported on all stacks, in which
68+
* case NSAPI_ERROR_UNSUPPORTED may be returned from setsockopt.
69+
*
70+
* @enum nsapi_option_t
71+
*/
72+
enum nsapi_option_t {
73+
NSAPI_REUSEADDR, /*!< Allow bind to reuse local addresses */
74+
NSAPI_KEEPALIVE, /*!< Enables sending of keepalive messages */
75+
NSAPI_LINGER, /*!< Keeps close from returning until queues empty */
76+
NSAPI_SNDBUF, /*!< Sets send buffer size */
77+
NSAPI_RCVBUF, /*!< Sets recv buffer size */
78+
};
79+
5680
/** Maximum size of MAC address representation
5781
*/
5882
#define NSAPI_MAC_SIZE 18

0 commit comments

Comments
 (0)