Skip to content

Commit

Permalink
[component][net]add more socket flag
Browse files Browse the repository at this point in the history
  • Loading branch information
zmshahaha authored Sep 13, 2024
1 parent 49c39d4 commit fb02e79
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/lwp/lwp_sys_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
#define INTF_SO_SNDBUF 7
#define INTF_SO_SNDLOWAT 19
#define INTF_SO_RCVLOWAT 18
#define INTF_SO_BINDTODEVICE 25
#define INTF_SO_TIMESTAMPNS 35
#define INTF_SO_TIMESTAMPING 37
#define INTF_SO_SELECT_ERR_QUEUE 45

#define IMPL_SO_BROADCAST 0x0020
#define IMPL_SO_KEEPALIVE 0x0008
Expand All @@ -59,6 +63,10 @@
#define IMPL_SO_SNDBUF 0x1001
#define IMPL_SO_SNDLOWAT 0x1003
#define IMPL_SO_RCVLOWAT 0x1004
#define IMPL_SO_BINDTODEVICE 0x100b
#define IMPL_SO_TIMESTAMPNS INTF_SO_TIMESTAMPNS
#define IMPL_SO_TIMESTAMPING INTF_SO_TIMESTAMPING
#define IMPL_SO_SELECT_ERR_QUEUE INTF_SO_SELECT_ERR_QUEUE

/* IPPROTO_IP option names */
#define INTF_IP_TTL 2
Expand Down
17 changes: 17 additions & 0 deletions components/lwp/lwp_syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,18 @@ void lwp_cleanup(struct rt_thread *tid);
case INTF_SO_NO_CHECK:
*optname = IMPL_SO_NO_CHECK;
break;
case INTF_SO_BINDTODEVICE:
*optname = IMPL_SO_BINDTODEVICE;
break;
case INTF_SO_TIMESTAMPNS:
*optname = IMPL_SO_TIMESTAMPNS;
break;
case INTF_SO_TIMESTAMPING:
*optname = IMPL_SO_TIMESTAMPING;
break;
case INTF_SO_SELECT_ERR_QUEUE:
*optname = IMPL_SO_SELECT_ERR_QUEUE;
break;

/*
* SO_DONTLINGER (*level = ((int)(~SO_LINGER))),
Expand Down Expand Up @@ -3126,6 +3138,11 @@ static int netflags_muslc_2_lwip(int flags)
{
flgs |= MSG_MORE;
}
if (flags & MSG_ERRQUEUE)
{
flgs |= MSG_ERRQUEUE;
}

return flgs;
}

Expand Down

0 comments on commit fb02e79

Please sign in to comment.