mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-09 07:54:38 +08:00
Reformat sockets.c using astylerc
This commit is contained in:
parent
fa33db1448
commit
438cfd3f14
@ -2548,8 +2548,7 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt
|
|||||||
break;
|
break;
|
||||||
#endif /* LWIP_SO_RCVBUF */
|
#endif /* LWIP_SO_RCVBUF */
|
||||||
#if LWIP_SO_LINGER
|
#if LWIP_SO_LINGER
|
||||||
case SO_LINGER:
|
case SO_LINGER: {
|
||||||
{
|
|
||||||
s16_t conn_linger;
|
s16_t conn_linger;
|
||||||
struct linger *linger = (struct linger *)optval;
|
struct linger *linger = (struct linger *)optval;
|
||||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, *optlen, struct linger);
|
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, *optlen, struct linger);
|
||||||
@ -2908,8 +2907,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
|||||||
/* SO_ERROR is get-only */
|
/* SO_ERROR is get-only */
|
||||||
|
|
||||||
#if LWIP_SO_SNDTIMEO
|
#if LWIP_SO_SNDTIMEO
|
||||||
case SO_SNDTIMEO:
|
case SO_SNDTIMEO: {
|
||||||
{
|
|
||||||
long ms_long;
|
long ms_long;
|
||||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, LWIP_SO_SNDRCVTIMEO_OPTTYPE);
|
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, LWIP_SO_SNDRCVTIMEO_OPTTYPE);
|
||||||
ms_long = LWIP_SO_SNDRCVTIMEO_GET_MS(optval);
|
ms_long = LWIP_SO_SNDRCVTIMEO_GET_MS(optval);
|
||||||
@ -2922,8 +2920,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
|||||||
}
|
}
|
||||||
#endif /* LWIP_SO_SNDTIMEO */
|
#endif /* LWIP_SO_SNDTIMEO */
|
||||||
#if LWIP_SO_RCVTIMEO
|
#if LWIP_SO_RCVTIMEO
|
||||||
case SO_RCVTIMEO:
|
case SO_RCVTIMEO: {
|
||||||
{
|
|
||||||
long ms_long;
|
long ms_long;
|
||||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, LWIP_SO_SNDRCVTIMEO_OPTTYPE);
|
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, LWIP_SO_SNDRCVTIMEO_OPTTYPE);
|
||||||
ms_long = LWIP_SO_SNDRCVTIMEO_GET_MS(optval);
|
ms_long = LWIP_SO_SNDRCVTIMEO_GET_MS(optval);
|
||||||
@ -2942,8 +2939,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
|||||||
break;
|
break;
|
||||||
#endif /* LWIP_SO_RCVBUF */
|
#endif /* LWIP_SO_RCVBUF */
|
||||||
#if LWIP_SO_LINGER
|
#if LWIP_SO_LINGER
|
||||||
case SO_LINGER:
|
case SO_LINGER: {
|
||||||
{
|
|
||||||
const struct linger *linger = (const struct linger *)optval;
|
const struct linger *linger = (const struct linger *)optval;
|
||||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, struct linger);
|
LWIP_SOCKOPT_CHECK_OPTLEN_CONN(sock, optlen, struct linger);
|
||||||
if (linger->l_onoff) {
|
if (linger->l_onoff) {
|
||||||
@ -2979,8 +2975,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* LWIP_UDP */
|
#endif /* LWIP_UDP */
|
||||||
case SO_BINDTODEVICE:
|
case SO_BINDTODEVICE: {
|
||||||
{
|
|
||||||
const struct ifreq *iface;
|
const struct ifreq *iface;
|
||||||
struct netif *n = NULL;
|
struct netif *n = NULL;
|
||||||
|
|
||||||
@ -2995,8 +2990,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (NETCONNTYPE_GROUP(netconn_type(sock->conn)))
|
switch (NETCONNTYPE_GROUP(netconn_type(sock->conn))) {
|
||||||
{
|
|
||||||
#if LWIP_TCP
|
#if LWIP_TCP
|
||||||
case NETCONN_TCP:
|
case NETCONN_TCP:
|
||||||
tcp_bind_netif(sock->conn->pcb.tcp, n);
|
tcp_bind_netif(sock->conn->pcb.tcp, n);
|
||||||
@ -3056,8 +3050,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
|||||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, u8_t, NETCONN_UDP);
|
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, u8_t, NETCONN_UDP);
|
||||||
udp_set_multicast_ttl(sock->conn->pcb.udp, (u8_t)(*(const u8_t *)optval));
|
udp_set_multicast_ttl(sock->conn->pcb.udp, (u8_t)(*(const u8_t *)optval));
|
||||||
break;
|
break;
|
||||||
case IP_MULTICAST_IF:
|
case IP_MULTICAST_IF: {
|
||||||
{
|
|
||||||
ip4_addr_t if_addr;
|
ip4_addr_t if_addr;
|
||||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, struct in_addr, NETCONN_UDP);
|
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, struct in_addr, NETCONN_UDP);
|
||||||
inet_addr_to_ip4addr(&if_addr, (const struct in_addr *)optval);
|
inet_addr_to_ip4addr(&if_addr, (const struct in_addr *)optval);
|
||||||
@ -3075,8 +3068,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
|||||||
#endif /* LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS && LWIP_UDP */
|
#endif /* LWIP_IPV4 && LWIP_MULTICAST_TX_OPTIONS && LWIP_UDP */
|
||||||
#if LWIP_IGMP
|
#if LWIP_IGMP
|
||||||
case IP_ADD_MEMBERSHIP:
|
case IP_ADD_MEMBERSHIP:
|
||||||
case IP_DROP_MEMBERSHIP:
|
case IP_DROP_MEMBERSHIP: {
|
||||||
{
|
|
||||||
/* If this is a TCP or a RAW socket, ignore these options. */
|
/* If this is a TCP or a RAW socket, ignore these options. */
|
||||||
err_t igmp_err;
|
err_t igmp_err;
|
||||||
const struct ip_mreq *imr = (const struct ip_mreq *)optval;
|
const struct ip_mreq *imr = (const struct ip_mreq *)optval;
|
||||||
@ -3178,8 +3170,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
|||||||
break;
|
break;
|
||||||
#if LWIP_IPV6_MLD
|
#if LWIP_IPV6_MLD
|
||||||
case IPV6_JOIN_GROUP:
|
case IPV6_JOIN_GROUP:
|
||||||
case IPV6_LEAVE_GROUP:
|
case IPV6_LEAVE_GROUP: {
|
||||||
{
|
|
||||||
/* If this is a TCP or a RAW socket, ignore these options. */
|
/* If this is a TCP or a RAW socket, ignore these options. */
|
||||||
err_t mld6_err;
|
err_t mld6_err;
|
||||||
struct netif *netif;
|
struct netif *netif;
|
||||||
@ -3525,8 +3516,7 @@ lwip_inet_pton(int af, const char *src, void *dst)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if LWIP_IPV6
|
#if LWIP_IPV6
|
||||||
case AF_INET6:
|
case AF_INET6: {
|
||||||
{
|
|
||||||
/* convert into temporary variable since ip6_addr_t might be larger
|
/* convert into temporary variable since ip6_addr_t might be larger
|
||||||
than in6_addr when scopes are enabled */
|
than in6_addr when scopes are enabled */
|
||||||
ip6_addr_t addr;
|
ip6_addr_t addr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user