You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/03/30 07:12:12 UTC

[incubator-nuttx-apps] branch master updated (e8b0c90 -> 326c80d)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git.


    from e8b0c90  examples/udpblaster: Fix some nxstyle errors
     new 5f91364  tcpblaster: Avoid conflicting with host OS definitions
     new 7e6e19d  tcpblaster: Fix build on macOS
     new 326c80d  tcpblaster: Appease nxstyle complaints

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 examples/tcpblaster/tcpblaster.h        | 46 +++++++++++++++------------------
 examples/tcpblaster/tcpblaster_client.c |  3 +--
 examples/tcpblaster/tcpblaster_server.c | 20 ++++++++------
 3 files changed, 34 insertions(+), 35 deletions(-)


[incubator-nuttx-apps] 01/03: tcpblaster: Avoid conflicting with host OS definitions

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 5f91364d446875dc18f1bade2f1dd5d2fcb570bb
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Mon Mar 30 15:22:39 2020 +0900

    tcpblaster: Avoid conflicting with host OS definitions
---
 examples/tcpblaster/tcpblaster.h | 44 ++++++++++++++++++----------------------
 1 file changed, 20 insertions(+), 24 deletions(-)

diff --git a/examples/tcpblaster/tcpblaster.h b/examples/tcpblaster/tcpblaster.h
index 7925d6a..c1295b5 100644
--- a/examples/tcpblaster/tcpblaster.h
+++ b/examples/tcpblaster/tcpblaster.h
@@ -51,39 +51,35 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifndef HTONS
-#  ifdef CONFIG_ENDIAN_BIG
-#    define HTONS(ns) (ns)
-#  else
-#   define HTONS(ns) \
+#ifdef TCPBLASTER_HOST
+#undef HTONS
+#ifdef CONFIG_ENDIAN_BIG
+#  define HTONS(ns) (ns)
+#else
+#  define HTONS(ns) \
      (unsigned short) \
        (((((unsigned short)(ns)) & 0x00ff) << 8) | \
         ((((unsigned short)(ns)) >> 8) & 0x00ff))
-#  endif
 #endif
 
-#ifndef HTONL
-#  ifdef CONFIG_ENDIAN_BIG
-#    define HTONL(nl) (nl)
-#  else
-#    define HTONL(nl) \
-       (unsigned long) \
-         (((((unsigned long)(nl)) & 0x000000ffUL) << 24) | \
-          ((((unsigned long)(nl)) & 0x0000ff00UL) <<  8) | \
-          ((((unsigned long)(nl)) & 0x00ff0000UL) >>  8) | \
-          ((((unsigned long)(nl)) & 0xff000000UL) >> 24))
-#  endif
+#undef HTONL
+#ifdef CONFIG_ENDIAN_BIG
+#  define HTONL(nl) (nl)
+#else
+#  define HTONL(nl) \
+     (unsigned long) \
+       (((((unsigned long)(nl)) & 0x000000ffUL) << 24) | \
+        ((((unsigned long)(nl)) & 0x0000ff00UL) <<  8) | \
+        ((((unsigned long)(nl)) & 0x00ff0000UL) >>  8) | \
+        ((((unsigned long)(nl)) & 0xff000000UL) >> 24))
 #endif
 
-#ifndef NTOHS
-#  define NTOHS(hs) HTONS(hs)
-#endif
+#undef NTOHS
+#define NTOHS(hs) HTONS(hs)
 
-#ifndef NTOHL
-#  define NTOHL(hl) HTONL(hl)
-#endif
+#undef NTOHL
+#define NTOHL(hl) HTONL(hl)
 
-#ifdef TCPBLASTER_HOST
    /* Have SO_LINGER */
 
 #  define FAR


[incubator-nuttx-apps] 02/03: tcpblaster: Fix build on macOS

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 7e6e19d80ca148e975a5b550a5ab756081dd0299
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Mon Mar 30 14:56:01 2020 +0900

    tcpblaster: Fix build on macOS
    
    s6_addr is in standard. s6_addr16 is not.
    See RFC 2553.
---
 examples/tcpblaster/tcpblaster_client.c |  3 +--
 examples/tcpblaster/tcpblaster_server.c | 20 ++++++++++++--------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/examples/tcpblaster/tcpblaster_client.c b/examples/tcpblaster/tcpblaster_client.c
index 85d6dd9..8092124 100644
--- a/examples/tcpblaster/tcpblaster_client.c
+++ b/examples/tcpblaster/tcpblaster_client.c
@@ -104,8 +104,7 @@ void tcpblaster_client(void)
 #ifdef CONFIG_EXAMPLES_TCPBLASTER_IPv6
   server.sin6_family     = AF_INET6;
   server.sin6_port       = HTONS(CONFIG_EXAMPLES_TCPBLASTER_SERVER_PORTNO);
-  memcpy(server.sin6_addr.s6_addr16,
-         g_tcpblasterserver_ipv6, 8 * sizeof(uint16_t));
+  memcpy(server.sin6_addr.s6_addr, g_tcpblasterserver_ipv6, 16);
   addrlen                = sizeof(struct sockaddr_in6);
 
   printf("Connecting to IPv6 Address: "
diff --git a/examples/tcpblaster/tcpblaster_server.c b/examples/tcpblaster/tcpblaster_server.c
index 8f5e20e..1233ea1 100644
--- a/examples/tcpblaster/tcpblaster_server.c
+++ b/examples/tcpblaster/tcpblaster_server.c
@@ -118,19 +118,23 @@ void tcpblaster_server(void)
   myaddr.sin6_family = AF_INET6;
   myaddr.sin6_port   = HTONS(CONFIG_EXAMPLES_TCPBLASTER_SERVER_PORTNO);
 #if defined(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK) && !defined(CONFIG_NET_LOOPBACK)
-  memcpy(myaddr.sin6_addr.s6_addr16,
-         g_tcpblasterserver_ipv6, 8 * sizeof(uint16_t));
+  memcpy(myaddr.sin6_addr.s6_addr, g_tcpblasterserver_ipv6, 16);
 #else
-  memset(myaddr.sin6_addr.s6_addr16, 0, 8 * sizeof(uint16_t));
+  memset(myaddr.sin6_addr.s6_addr, 0, 16);
 #endif
   addrlen = sizeof(struct sockaddr_in6);
 
   printf("Binding to IPv6 Address: "
-         "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
-         myaddr.sin6_addr.s6_addr16[0], myaddr.sin6_addr.s6_addr16[1],
-         myaddr.sin6_addr.s6_addr16[2], myaddr.sin6_addr.s6_addr16[3],
-         myaddr.sin6_addr.s6_addr16[4], myaddr.sin6_addr.s6_addr16[5],
-         myaddr.sin6_addr.s6_addr16[6], myaddr.sin6_addr.s6_addr16[7]);
+         "%02x%02x:%02x%02x:%02x%02x:%02x%02x:"
+         "%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
+         myaddr.sin6_addr.s6_addr[0], myaddr.sin6_addr.s6_addr[1],
+         myaddr.sin6_addr.s6_addr[2], myaddr.sin6_addr.s6_addr[3],
+         myaddr.sin6_addr.s6_addr[4], myaddr.sin6_addr.s6_addr[5],
+         myaddr.sin6_addr.s6_addr[6], myaddr.sin6_addr.s6_addr[7],
+         myaddr.sin6_addr.s6_addr[8], myaddr.sin6_addr.s6_addr[9],
+         myaddr.sin6_addr.s6_addr[10], myaddr.sin6_addr.s6_addr[11],
+         myaddr.sin6_addr.s6_addr[12], myaddr.sin6_addr.s6_addr[13],
+         myaddr.sin6_addr.s6_addr[14], myaddr.sin6_addr.s6_addr[15]);
 #else
   myaddr.sin_family  = AF_INET;
   myaddr.sin_port    = HTONS(CONFIG_EXAMPLES_TCPBLASTER_SERVER_PORTNO);


[incubator-nuttx-apps] 03/03: tcpblaster: Appease nxstyle complaints

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 326c80db728daefc6a481241363222b2d8ac5049
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Mon Mar 30 14:58:58 2020 +0900

    tcpblaster: Appease nxstyle complaints
---
 examples/tcpblaster/tcpblaster.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/tcpblaster/tcpblaster.h b/examples/tcpblaster/tcpblaster.h
index c1295b5..849bb9f 100644
--- a/examples/tcpblaster/tcpblaster.h
+++ b/examples/tcpblaster/tcpblaster.h
@@ -80,7 +80,7 @@
 #undef NTOHL
 #define NTOHL(hl) HTONL(hl)
 
-   /* Have SO_LINGER */
+/* Have SO_LINGER */
 
 #  define FAR
 #  define TCPBLASTER_HAVE_SOLINGER 1