Replace self defined macros with NET_SOCK_[FAMILY|TYPE|PROTOCOL]

NET_SOCK_* is defined by nuttx/net/netconfig.h and then can be shared

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-12-19 21:03:15 +08:00
committed by Gustavo Henrique Nihei
parent fcd69d1cdf
commit 66dbaa4539
35 changed files with 50 additions and 201 deletions

View File

@@ -63,8 +63,7 @@ int netlib_ifup(const char *ifname)
{
/* Get a socket (only so that we get access to the INET subsystem) */
int sockfd = socket(NETLIB_SOCK_FAMILY,
NETLIB_SOCK_TYPE, NETLIB_SOCK_PROTOCOL);
int sockfd = socket(NET_SOCK_FAMILY, NET_SOCK_TYPE, NET_SOCK_PROTOCOL);
if (sockfd >= 0)
{
struct ifreq req;
@@ -107,8 +106,7 @@ int netlib_ifdown(const char *ifname)
{
/* Get a socket (only so that we get access to the INET subsystem) */
int sockfd = socket(NETLIB_SOCK_FAMILY,
NETLIB_SOCK_TYPE, NETLIB_SOCK_PROTOCOL);
int sockfd = socket(NET_SOCK_FAMILY, NET_SOCK_TYPE, NET_SOCK_PROTOCOL);
if (sockfd >= 0)
{
struct ifreq req;