Browse Source

net: tag net socket objects

Used for permission validation when accessing the associated file
descriptors from user mode.

There often get defined in implementation code, expand the search
to look in drivers/ and subsys/net/.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
pull/25951/head
Andrew Boie 5 years ago committed by Carles Cufí
parent
commit
fed960b94a
  1. 2
      CMakeLists.txt
  2. 2
      drivers/modem/modem_socket.h
  3. 2
      include/net/net_context.h
  4. 2
      subsys/net/lib/sockets/socketpair.c
  5. 2
      subsys/net/lib/sockets/sockets_net_mgmt.c
  6. 4
      subsys/net/lib/websocket/websocket_internal.h

2
CMakeLists.txt

@ -594,6 +594,8 @@ add_custom_command( @@ -594,6 +594,8 @@ add_custom_command(
${PYTHON_EXECUTABLE}
${ZEPHYR_BASE}/scripts/parse_syscalls.py
--include ${ZEPHYR_BASE}/include # Read files from this dir
--include ${ZEPHYR_BASE}/drivers # For net sockets
--include ${ZEPHYR_BASE}/subsys/net # More net sockets
${parse_syscalls_include_args} # Read files from these dirs also
--json-file ${syscalls_json} # Write this file
--tag-struct-file ${struct_tags_json} # Write subsystem list to this file

2
drivers/modem/modem_socket.h

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
extern "C" {
#endif
struct modem_socket {
__net_socket struct modem_socket {
sa_family_t family;
enum net_sock_type type;
enum net_ip_protocol ip_proto;

2
include/net/net_context.h

@ -196,7 +196,7 @@ struct tls_context; @@ -196,7 +196,7 @@ struct tls_context;
* If there is no such source address there, the packet cannot be sent
* anyway. This saves 12 bytes / context in IPv6.
*/
struct net_context {
__net_socket struct net_context {
/** User data.
*
* First member of the structure to let users either have user data

2
subsys/net/lib/sockets/socketpair.c

@ -48,7 +48,7 @@ enum { @@ -48,7 +48,7 @@ enum {
* - write operations may block if the remote @a recv_q is full
* - each endpoint may be blocking or non-blocking
*/
struct spair {
__net_socket struct spair {
int remote; /**< the remote endpoint file descriptor */
u32_t flags; /**< status and option bits */
struct k_sem sem; /**< semaphore for exclusive structure access */

2
subsys/net/lib/sockets/sockets_net_mgmt.c

@ -23,7 +23,7 @@ LOG_MODULE_REGISTER(net_sock_mgmt, CONFIG_NET_SOCKETS_LOG_LEVEL); @@ -23,7 +23,7 @@ LOG_MODULE_REGISTER(net_sock_mgmt, CONFIG_NET_SOCKETS_LOG_LEVEL);
#define MSG_ALLOC_TIMEOUT K_MSEC(100)
struct net_mgmt_socket {
__net_socket struct net_mgmt_socket {
/* Network interface related to this socket */
struct net_if *iface;

4
subsys/net/lib/websocket/websocket_internal.h

@ -10,6 +10,8 @@ @@ -10,6 +10,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <toolchain/common.h>
#define WS_SHA1_OUTPUT_LEN 20
/* Min Websocket header length */
@ -24,7 +26,7 @@ @@ -24,7 +26,7 @@
/**
* Websocket connection information
*/
struct websocket_context {
__net_socket struct websocket_context {
union {
/** User data.
*/

Loading…
Cancel
Save