diff options
| author | Bernard Xiong <[email protected]> | 2021-05-28 16:20:08 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-28 16:20:08 +0800 |
| commit | 92beddf3bccf6346e26aa097f82464456fb8e6bd (patch) | |
| tree | 197e4a108118dda016ea02274172f0c40e7ee8ed /components/net/sal_socket | |
| parent | b18a99b44240ec3152011e159cc24a5af8dff0ce (diff) | |
| parent | 03f4d40e30f3c94e1db0b3a65b3610dee695694a (diff) | |
Merge pull request #4737 from mysterywolf/3,1,xformatv3.1.5
[lts 3.1.x] format codes
Diffstat (limited to 'components/net/sal_socket')
19 files changed, 38 insertions, 38 deletions
diff --git a/components/net/sal_socket/dfs_net/dfs_net.c b/components/net/sal_socket/dfs_net/dfs_net.c index f1a3d777a1..67b652c320 100644 --- a/components/net/sal_socket/dfs_net/dfs_net.c +++ b/components/net/sal_socket/dfs_net/dfs_net.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -21,7 +21,7 @@ int dfs_net_getsocket(int fd) { int socket; - struct dfs_fd *_dfs_fd; + struct dfs_fd *_dfs_fd; _dfs_fd = fd_get(fd); if (_dfs_fd == NULL) return -1; @@ -68,7 +68,7 @@ static int dfs_net_poll(struct dfs_fd *file, struct rt_pollreq *req) return sal_poll(file, req); } -const struct dfs_file_ops _net_fops = +const struct dfs_file_ops _net_fops = { NULL, /* open */ dfs_net_close, diff --git a/components/net/sal_socket/impl/af_inet.h b/components/net/sal_socket/impl/af_inet.h index caffbe1400..421d15bfae 100644 --- a/components/net/sal_socket/impl/af_inet.h +++ b/components/net/sal_socket/impl/af_inet.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/impl/af_inet_at.c b/components/net/sal_socket/impl/af_inet_at.c index 135e4183c4..c85dfe9f06 100644 --- a/components/net/sal_socket/impl/af_inet_at.c +++ b/components/net/sal_socket/impl/af_inet_at.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -85,7 +85,7 @@ static const struct sal_socket_ops at_socket_ops = #endif /* SAL_USING_POSIX */ }; -static const struct sal_netdb_ops at_netdb_ops = +static const struct sal_netdb_ops at_netdb_ops = { at_gethostbyname, NULL, diff --git a/components/net/sal_socket/impl/af_inet_lwip.c b/components/net/sal_socket/impl/af_inet_lwip.c index 56df735ab9..2e19275b5d 100644 --- a/components/net/sal_socket/impl/af_inet_lwip.c +++ b/components/net/sal_socket/impl/af_inet_lwip.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -229,7 +229,7 @@ int inet_ioctlsocket(int socket, long cmd, void *arg) { case F_GETFL: case F_SETFL: - return lwip_fcntl(socket, cmd, (int) arg); + return lwip_fcntl(socket, cmd, (int) arg); default: return lwip_ioctl(socket, cmd, arg); @@ -320,7 +320,7 @@ static const struct sal_proto_family lwip_inet_family = AF_INET6, #else AF_INET, -#endif +#endif &lwip_socket_ops, &lwip_netdb_ops, }; @@ -329,7 +329,7 @@ static const struct sal_proto_family lwip_inet_family = int sal_lwip_netdev_set_pf_info(struct netdev *netdev) { RT_ASSERT(netdev); - + netdev->sal_user_data = (void *) &lwip_inet_family; return 0; } diff --git a/components/net/sal_socket/impl/proto_mbedtls.c b/components/net/sal_socket/impl/proto_mbedtls.c index 3472bbeaf5..79fbdcc5d4 100644 --- a/components/net/sal_socket/impl/proto_mbedtls.c +++ b/components/net/sal_socket/impl/proto_mbedtls.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -59,7 +59,7 @@ static void *mebdtls_socket(int socket) { tls_free(session); session = RT_NULL; - + return RT_NULL; } @@ -68,7 +68,7 @@ static void *mebdtls_socket(int socket) { mbedtls_client_close(session); return RT_NULL; - } + } session->server_fd.fd = socket; return (void *)session; @@ -89,7 +89,7 @@ int mbedtls_net_send_cb(void *ctx, const unsigned char *buf, size_t len) { return -1; } - + pf = (struct sal_proto_family *)sock->netdev->sal_user_data; /* Register scoket sendto option to TLS send data callback */ @@ -128,7 +128,7 @@ int mbedtls_net_recv_cb( void *ctx, unsigned char *buf, size_t len) } pf = (struct sal_proto_family *)sock->netdev->sal_user_data; - + /* Register scoket recvfrom option to TLS recv data callback */ ret = pf->skt_ops->recvfrom((int) sock->user_data, (void *)buf, len, 0, RT_NULL, RT_NULL); if (ret < 0) @@ -183,7 +183,7 @@ static int mbedtls_connect(void *sock) mbedtls_x509_crt_verify_info((char *)session->buffer, session->buffer_len, " ! ", ret); goto __exit; } - + return ret; __exit: @@ -199,27 +199,27 @@ static int mbedtls_closesocket(void *sock) { struct sal_socket *ssock; int socket; - + if (sock == RT_NULL) { return 0; } - + socket = ((MbedTLSSession *) sock)->server_fd.fd; ssock = sal_get_socket(socket); if (ssock == RT_NULL) { return -1; } - + /* Close TLS client session, and clean user-data in SAL socket */ mbedtls_client_close((MbedTLSSession *) sock); ssock->user_data_tls = RT_NULL; - + return 0; } -static const struct sal_proto_tls_ops mbedtls_proto_ops= +static const struct sal_proto_tls_ops mbedtls_proto_ops= { RT_NULL, mebdtls_socket, diff --git a/components/net/sal_socket/include/dfs_net/dfs_net.h b/components/net/sal_socket/include/dfs_net/dfs_net.h index ad28b8ec2a..82b7526603 100644 --- a/components/net/sal_socket/include/dfs_net/dfs_net.h +++ b/components/net/sal_socket/include/dfs_net/dfs_net.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h b/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h index 8899daee96..f174bc6504 100644 --- a/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h +++ b/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/sal.h b/components/net/sal_socket/include/sal.h index 6ffaa90356..dd250e37b6 100644 --- a/components/net/sal_socket/include/sal.h +++ b/components/net/sal_socket/include/sal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/sal_netdb.h b/components/net/sal_socket/include/sal_netdb.h index d5ce9b1d7e..50064ce343 100644 --- a/components/net/sal_socket/include/sal_netdb.h +++ b/components/net/sal_socket/include/sal_netdb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/sal_socket.h b/components/net/sal_socket/include/sal_socket.h index b620bbe23c..497be47e41 100644 --- a/components/net/sal_socket/include/sal_socket.h +++ b/components/net/sal_socket/include/sal_socket.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -171,7 +171,7 @@ struct sockaddr_in #endif /* NETDEV_IPV4 */ #if NETDEV_IPV6 -struct sockaddr_in6 +struct sockaddr_in6 { uint8_t sin6_len; /* length of this structure */ sa_family_t sin6_family; /* AF_INET6 */ diff --git a/components/net/sal_socket/include/sal_tls.h b/components/net/sal_socket/include/sal_tls.h index 7681b313bd..f211a3c1f8 100644 --- a/components/net/sal_socket/include/sal_tls.h +++ b/components/net/sal_socket/include/sal_tls.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/socket/netdb.h b/components/net/sal_socket/include/socket/netdb.h index 17f83efe00..4783405022 100644 --- a/components/net/sal_socket/include/socket/netdb.h +++ b/components/net/sal_socket/include/socket/netdb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/socket/netinet/in.h b/components/net/sal_socket/include/socket/netinet/in.h index 57c417d7b6..37240547b4 100644 --- a/components/net/sal_socket/include/socket/netinet/in.h +++ b/components/net/sal_socket/include/socket/netinet/in.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/socket/netinet/tcp.h b/components/net/sal_socket/include/socket/netinet/tcp.h index 2ac4d6f40d..a3b530186a 100644 --- a/components/net/sal_socket/include/socket/netinet/tcp.h +++ b/components/net/sal_socket/include/socket/netinet/tcp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/socket/netinet/udp.h b/components/net/sal_socket/include/socket/netinet/udp.h index 485d7d142c..21f50d55e5 100644 --- a/components/net/sal_socket/include/socket/netinet/udp.h +++ b/components/net/sal_socket/include/socket/netinet/udp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/socket/sys_socket/sys/socket.h b/components/net/sal_socket/include/socket/sys_socket/sys/socket.h index 04470aa84a..a86240e2ff 100644 --- a/components/net/sal_socket/include/socket/sys_socket/sys/socket.h +++ b/components/net/sal_socket/include/socket/sys_socket/sys/socket.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/socket/net_netdb.c b/components/net/sal_socket/socket/net_netdb.c index bc76a48965..03b995c68d 100644 --- a/components/net/sal_socket/socket/net_netdb.c +++ b/components/net/sal_socket/socket/net_netdb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/socket/net_sockets.c b/components/net/sal_socket/socket/net_sockets.c index a53b2f1f9c..3637635d50 100644 --- a/components/net/sal_socket/socket/net_sockets.c +++ b/components/net/sal_socket/socket/net_sockets.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -95,7 +95,7 @@ int shutdown(int s, int how) rt_set_errno(-EBADF); return -1; } - + if (sal_shutdown(socket, how) == 0) { error = 0; @@ -105,7 +105,7 @@ int shutdown(int s, int how) rt_set_errno(-ENOTSOCK); error = -1; } - + fd_put(d); return error; diff --git a/components/net/sal_socket/src/sal_socket.c b/components/net/sal_socket/src/sal_socket.c index edd5cd9a72..2781088711 100644 --- a/components/net/sal_socket/src/sal_socket.c +++ b/components/net/sal_socket/src/sal_socket.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * |
