mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
Merge 5038472d99 into 216edd74db
This commit is contained in:
commit
643835aa87
3 changed files with 26 additions and 0 deletions
|
|
@ -131,6 +131,8 @@
|
|||
/* Network socket control ***************************************************/
|
||||
|
||||
#define SIOCDENYINETSOCK _SIOC(0x003C) /* Deny network socket. */
|
||||
#define SIOCGETCONTEXT _SIOC(0x003F) /* Get socket context */
|
||||
#define SIOCSETCONTEXT _SIOC(0x0040) /* Set socket context */
|
||||
|
||||
/* Bridge calls *************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -262,6 +262,26 @@ struct socket
|
|||
FAR const struct sock_intf_s *s_sockif;
|
||||
};
|
||||
|
||||
struct socket_ctx_data_s
|
||||
{
|
||||
uint8_t s_domain; /* IP domain */
|
||||
uint8_t s_type; /* Protocol type */
|
||||
uint8_t s_proto; /* Socket Protocol */
|
||||
uint8_t s_priv[0]; /* Private socket context */
|
||||
};
|
||||
|
||||
/* NETDEV ioctl command:
|
||||
*
|
||||
* Command: SIOCGETCONTEXT or SIOCSETCONTEXT
|
||||
* Description: Get or Set socket context.
|
||||
*/
|
||||
|
||||
struct socket_context_s
|
||||
{
|
||||
size_t ctx_size; /* Size of socket context */
|
||||
struct socket_ctx_data_s *ctx; /* Buffer where socket context is stored */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -1808,6 +1808,10 @@ ssize_t net_ioctl_arglen(uint8_t domain, int cmd)
|
|||
case SIOCDENYINETSOCK:
|
||||
return sizeof(uint8_t);
|
||||
|
||||
case SIOCGETCONTEXT:
|
||||
case SIOCSETCONTEXT:
|
||||
return sizeof(struct socket_context_s);
|
||||
|
||||
default:
|
||||
#ifdef CONFIG_NETDEV_IOCTL
|
||||
# ifdef CONFIG_NETDEV_WIRELESS_IOCTL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue