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

wes3 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 0c29e69  net/ip: Re-arrange lwip (#2323)
0c29e69 is described below

commit 0c29e69b4267f2a7e916d33d07d2cefcd59e82c7
Author: wes3 <william.sanfili...@juul.com>
AuthorDate: Thu Jun 25 08:29:00 2020 -0700

    net/ip: Re-arrange lwip (#2323)
    
    * net/ip: Re-arrange lwip
    
    This commit changes how the mynewt lwip code is arranged in
    the repository. Hopefully, this new arrangement makes it easier
    to include lwip_base so other lwip implementations can use it
    without having to bring the mynewt lwip code. Packages requiring
    the base lwip code (and not the mynewt lwip code) can depend
    on net/ip/lwip_base. Applications wanting to include the mynewt
    lwip code should depend on net/ip/lwip_mn. None of the previous
    functionality should change; the code was simply moved from
    net/ip/src to net/ip/lwip_mn/src and a new package created.
    
    * net/ip: Re-arrange lwip
    
    Place a dependency to lwip_mn in the lwip driver for stm32_eth.
    This is needed as the previous package in net/ip was modified
    and the mynewt lwip code was moved.
---
 hw/drivers/lwip/stm32_eth/pkg.yml              |  4 ++--
 net/ip/{ => lwip_mn}/include/lwipopts.h        |  0
 net/ip/{ => lwip_mn}/pkg.yml                   |  7 ++-----
 net/ip/{ => lwip_mn}/src/ip_init.c             |  0
 net/ip/{ => lwip_mn}/src/ip_priv.h             |  0
 net/ip/{ => lwip_mn}/src/lwip_cli.c            |  0
 net/ip/{ => lwip_mn}/src/lwip_if.c             |  0
 net/ip/{ => lwip_mn}/src/lwip_mynewt.c         |  0
 net/ip/{ => lwip_mn}/src/lwip_socket.c         |  0
 net/ip/{ => lwip_mn}/src/os_queue.c            |  0
 net/ip/{ => lwip_mn}/syscfg.yml                |  0
 net/ip/mn_socket/include/mn_socket/mn_socket.h |  6 ++++++
 net/ip/pkg.yml                                 | 11 -----------
 13 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/hw/drivers/lwip/stm32_eth/pkg.yml 
b/hw/drivers/lwip/stm32_eth/pkg.yml
index 6819c45..b5d92e6 100644
--- a/hw/drivers/lwip/stm32_eth/pkg.yml
+++ b/hw/drivers/lwip/stm32_eth/pkg.yml
@@ -27,7 +27,7 @@ pkg.keywords:
     - ethernet
 pkg.deps:
     - "@apache-mynewt-core/hw/hal"
-    - "@apache-mynewt-core/net/ip/lwip_base"
+    - "@apache-mynewt-core/net/ip/lwip_mn"
 
 pkg.deps.MCU_STM32F4:
     - "@apache-mynewt-core/hw/mcu/stm/stm32f4xx"
@@ -35,7 +35,7 @@ pkg.deps.MCU_STM32F4:
 pkg.deps.MCU_STM32F7:
     - "@apache-mynewt-core/hw/mcu/stm/stm32f7xx"
 
-pkg.req_apis: 
+pkg.req_apis:
 
 pkg.init:
     stm32_eth_open: 'MYNEWT_VAL(STM32_ETH_SYSINIT_STAGE)'
diff --git a/net/ip/include/lwipopts.h b/net/ip/lwip_mn/include/lwipopts.h
similarity index 100%
rename from net/ip/include/lwipopts.h
rename to net/ip/lwip_mn/include/lwipopts.h
diff --git a/net/ip/pkg.yml b/net/ip/lwip_mn/pkg.yml
similarity index 95%
copy from net/ip/pkg.yml
copy to net/ip/lwip_mn/pkg.yml
index 998e0dd..b41b8da 100644
--- a/net/ip/pkg.yml
+++ b/net/ip/lwip_mn/pkg.yml
@@ -17,15 +17,12 @@
 # under the License.
 #
 
-pkg.name: net/ip
+pkg.name: net/ip/lwip_mn
 pkg.description: LwIP adaptation to Mynewt
 pkg.author: "Apache Mynewt <d...@mynewt.apache.org>"
 pkg.homepage:
 pkg.keywords:
-    - ip
-    - ipv6
-    - tcp
-    - udp
+    - lwip
 
 pkg.deps:
     - "@apache-mynewt-core/kernel/os"
diff --git a/net/ip/src/ip_init.c b/net/ip/lwip_mn/src/ip_init.c
similarity index 100%
rename from net/ip/src/ip_init.c
rename to net/ip/lwip_mn/src/ip_init.c
diff --git a/net/ip/src/ip_priv.h b/net/ip/lwip_mn/src/ip_priv.h
similarity index 100%
rename from net/ip/src/ip_priv.h
rename to net/ip/lwip_mn/src/ip_priv.h
diff --git a/net/ip/src/lwip_cli.c b/net/ip/lwip_mn/src/lwip_cli.c
similarity index 100%
rename from net/ip/src/lwip_cli.c
rename to net/ip/lwip_mn/src/lwip_cli.c
diff --git a/net/ip/src/lwip_if.c b/net/ip/lwip_mn/src/lwip_if.c
similarity index 100%
rename from net/ip/src/lwip_if.c
rename to net/ip/lwip_mn/src/lwip_if.c
diff --git a/net/ip/src/lwip_mynewt.c b/net/ip/lwip_mn/src/lwip_mynewt.c
similarity index 100%
rename from net/ip/src/lwip_mynewt.c
rename to net/ip/lwip_mn/src/lwip_mynewt.c
diff --git a/net/ip/src/lwip_socket.c b/net/ip/lwip_mn/src/lwip_socket.c
similarity index 100%
rename from net/ip/src/lwip_socket.c
rename to net/ip/lwip_mn/src/lwip_socket.c
diff --git a/net/ip/src/os_queue.c b/net/ip/lwip_mn/src/os_queue.c
similarity index 100%
rename from net/ip/src/os_queue.c
rename to net/ip/lwip_mn/src/os_queue.c
diff --git a/net/ip/syscfg.yml b/net/ip/lwip_mn/syscfg.yml
similarity index 100%
rename from net/ip/syscfg.yml
rename to net/ip/lwip_mn/syscfg.yml
diff --git a/net/ip/mn_socket/include/mn_socket/mn_socket.h 
b/net/ip/mn_socket/include/mn_socket/mn_socket.h
index 42b0fef..b784621 100644
--- a/net/ip/mn_socket/include/mn_socket/mn_socket.h
+++ b/net/ip/mn_socket/include/mn_socket/mn_socket.h
@@ -40,6 +40,12 @@ extern "C" {
 #define MN_SOCK_DGRAM           2
 
 /*
+ * Protocol
+ */
+#define MN_PROTO_UDP            17
+#define MN_PROTO_TCP            6
+
+/*
  * Error codes from mn_socket interface.
  */
 #define MN_EAFNOSUPPORT         1
diff --git a/net/ip/pkg.yml b/net/ip/pkg.yml
index 998e0dd..ac6c8fe 100644
--- a/net/ip/pkg.yml
+++ b/net/ip/pkg.yml
@@ -26,14 +26,3 @@ pkg.keywords:
     - ipv6
     - tcp
     - udp
-
-pkg.deps:
-    - "@apache-mynewt-core/kernel/os"
-    - "@apache-mynewt-core/net/ip/lwip_base"
-    - "@apache-mynewt-core/net/ip/mn_socket"
-
-pkg.deps.LWIP_CLI:
-    - "@apache-mynewt-core/sys/shell"
-
-pkg.init:
-    ip_init: 'MYNEWT_VAL(IP_SYSINIT_STAGE)'

Reply via email to