This commit is contained in:
SPRESENSE 2026-07-25 17:30:38 -07:00 committed by GitHub
commit 643835aa87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 0 deletions

View file

@ -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 *************************************************************/

View file

@ -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
****************************************************************************/

View file

@ -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