Updated issues related to uds capacity and eventfd macro redefinition (#8329)

This commit is contained in:
zmq810150896
2023-12-06 13:51:13 +08:00
committed by GitHub
parent 1b0dae2bb0
commit 2790ce5357
6 changed files with 107 additions and 30 deletions
+74
View File
@@ -0,0 +1,74 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2023-12-06 zmq810150896 The first version.
*/
#ifndef __SAL_MSG_H__
#define __SAL_MSG_H__
#include <rtthread.h>
/* message frame */
struct msg_buf
{
void *parm; /* Parameters for message detection */
void *buf; /* Data to be sent */
rt_size_t length; /* Data length */
void *control_data; /* Additional data to send the message */
rt_size_t data_len; /* Additional data length */
int msg_type; /* message type */
int data_type; /* Addittional data length */
int msg_level;
int *fd; /* Pass the array used by fd */
rt_slist_t msg_next; /* Next message */
rt_slist_t msg_node; /* sendmsg is used to send multiple messages at the same time */
};
/* Remaining message */
struct last_buf
{
void *buf; /* Data to be sent */
rt_size_t length; /* Data length */
rt_size_t offset; /* Data Offset */
struct msg_buf *msg;
};
/* sock */
struct unix_sock
{
rt_uint8_t len;
int flags;
uint8_t family; /* protocol */
char path[108]; /* file name */
struct unix_conn *conn; /* connecting processing */
rt_wqueue_t wq_head; /* Waiting queue head */
rt_atomic_t listen_num; /* Maximum listening quantity */
rt_atomic_t conn_counter; /* connected num */
struct rt_mutex sock_lock;
rt_slist_t wait_conn_head;
struct last_buf pbuf;
};
struct unix_conn
{
int state; /* connect state */
int type;
int proto;
rt_uint32_t send_timeout;
rt_uint32_t recv_timeout;
rt_wqueue_t wq_read_head;
rt_wqueue_t wq_confirm;
struct rt_mutex conn_lock;
rt_slist_t msg_head; /* message head */
rt_slist_t conn_node;
struct unix_sock *sock;
struct unix_sock *ser_sock;
struct unix_conn *correl_conn; /* Information about the other party */
int (* conn_callback)(struct unix_conn *conn); /* The callback function that establishes the connection */
};
#endif
+20 -10
View File
@@ -48,17 +48,17 @@ typedef uint16_t in_port_t;
#define SO_KEEPALIVE 0x0008 /* keep connections alive */
#define SO_BROADCAST 0x0020 /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */
#define SO_PASSCRED 16
#define SO_PEERCRED 17
#define SO_PASSCRED 16
#define SO_PEERCRED 17
#define SO_BINDTODEVICE 25
#define SO_ATTACH_FILTER 26
#define SO_DETACH_FILTER 27
#define SO_SNDBUFFORCE 32
#define SO_RCVBUFFORCE 33
#define SO_PROTOCOL 38
#define SO_DOMAIN 39
#define SO_SNDBUFFORCE 32
#define SO_RCVBUFFORCE 33
#define SO_PROTOCOL 38
#define SO_DOMAIN 39
/* Additional options, not kept in so_options */
#define SO_DEBUG 0x0001 /* Unimplemented: turn on debugging info recording */
@@ -81,7 +81,7 @@ typedef uint16_t in_port_t;
#define SO_NO_CHECK 0x100a /* don't create UDP checksum */
/* Level number for (get/set)sockopt() to apply to socket itself */
#define SOL_SOCKET 0xfff /* options for socket level */
#define SOL_SOCKET 0xfff /* options for socket level */
#define SOL_NETLINK 270
#define AF_UNSPEC 0
@@ -118,7 +118,7 @@ typedef uint16_t in_port_t;
#define MSG_OOB 0x04 /* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */
#define MSG_DONTWAIT 0x08 /* Nonblocking i/o for this operation only */
#define MSG_MORE 0x10 /* Sender will send more */
/* LWIPPTP_SWREQ_0036 */
#define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */
#define MSG_CONFIRM 0x0800 /* Confirm path validity */
@@ -169,8 +169,8 @@ typedef struct ip_mreq
#define IPTOS_PREC_ROUTINE 0x00
#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */
#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
#define SCM_SECURITY 0x03 /* rw: security label */
#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
#define SCM_SECURITY 0x03 /* rw: security label */
/* Options for shatdown type */
#ifndef SHUT_RD
@@ -229,6 +229,16 @@ struct sockaddr_storage
#endif /* NETDEV_IPV6 */
};
#ifdef RT_USING_MUSLLIBC
#ifndef __DEFINED_struct_iovec
struct iovec
{
void *iov_base;
size_t iov_len;
};
#endif
#endif
struct msghdr
{
void *msg_name;