New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lwIP: Initial import #3551
Merged
Merged
lwIP: Initial import #3551
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
29515a7
pkg: initial import of lwIP package
miri64 932bec5
lwip: add port for RIOT
miri64 b034752
lwip: map lwIP modules to RIOT modules
miri64 7f47557
lwip_netdev2: initial import of a lwIP netdev2 wrapper
miri64 410f44f
lwip: initial import of conn_ip wrapper
miri64 5431df6
lwip: initial import of conn_udp wrapper
miri64 9b8417f
tests: intial import of lwIP test application
miri64 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,18 @@ PSEUDOMODULES += gnrc_sixlowpan_iphc_nhc | |
PSEUDOMODULES += gnrc_pktbuf | ||
PSEUDOMODULES += log | ||
PSEUDOMODULES += log_printfnoformat | ||
PSEUDOMODULES += lwip_arp | ||
PSEUDOMODULES += lwip_autoip | ||
PSEUDOMODULES += lwip_dhcp | ||
PSEUDOMODULES += lwip_ethernet | ||
PSEUDOMODULES += lwip_igmp | ||
PSEUDOMODULES += lwip_ipv6_autoconfig | ||
PSEUDOMODULES += lwip_raw | ||
PSEUDOMODULES += lwip_sixlowpan | ||
PSEUDOMODULES += lwip_stats | ||
PSEUDOMODULES += lwip_tcp | ||
PSEUDOMODULES += lwip_udp | ||
PSEUDOMODULES += lwip_udplite | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here for pseudo-submodules. |
||
PSEUDOMODULES += netdev_default | ||
PSEUDOMODULES += newlib | ||
PSEUDOMODULES += newlib_nano | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
PKG_NAME=lwip | ||
PKG_URL=git://git.savannah.nongnu.org/lwip.git | ||
PKG_VERSION=fd4a109ffa6513b28a0c780a952cef1110423717 | ||
PKG_BUILDDIR ?= $(BINDIRBASE)/pkg/$(BOARD)/$(PKG_NAME) | ||
|
||
.PHONY: all | ||
|
||
all: git-download | ||
$(MAKE) -C $(PKG_BUILDDIR) | ||
|
||
include $(RIOTBASE)/pkg/pkg.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
INCLUDES += -I$(RIOTBASE)/pkg/lwip/include \ | ||
-I$(BINDIRBASE)/pkg/$(BOARD)/lwip/src/include | ||
|
||
ifneq (,$(filter lwip_conn,$(USEMODULE))) | ||
DIRS += $(RIOTBASE)/pkg/lwip/contrib/conn | ||
endif | ||
ifneq (,$(filter lwip_conn_ip,$(USEMODULE))) | ||
DIRS += $(RIOTBASE)/pkg/lwip/contrib/conn/ip | ||
endif | ||
ifneq (,$(filter lwip_conn_udp,$(USEMODULE))) | ||
DIRS += $(RIOTBASE)/pkg/lwip/contrib/conn/udp | ||
endif | ||
ifneq (,$(filter lwip_contrib,$(USEMODULE))) | ||
DIRS += $(RIOTBASE)/pkg/lwip/contrib | ||
endif | ||
ifneq (,$(filter lwip_netdev2,$(USEMODULE))) | ||
DIRS += $(RIOTBASE)/pkg/lwip/contrib/netdev2 | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MODULE := lwip_contrib | ||
|
||
include $(RIOTBASE)/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MODULE := lwip_conn | ||
|
||
include $(RIOTBASE)/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MODULE := lwip_conn_ip | ||
|
||
include $(RIOTBASE)/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright (C) 2015 Freie Universität Berlin | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @{ | ||
* | ||
* @file | ||
* @author Martine Lenders <mlenders@inf.fu-berlin.de> | ||
*/ | ||
|
||
#include <assert.h> | ||
#include <errno.h> | ||
|
||
#include "net/ipv4/addr.h" | ||
#include "net/ipv6/addr.h" | ||
#include "net/conn/ip.h" | ||
|
||
#include "lwip/api.h" | ||
#include "lwip/conn.h" | ||
|
||
int conn_ip_create(conn_ip_t *conn, const void *addr, size_t addr_len, int family, int proto) | ||
{ | ||
struct netconn *tmp; | ||
int res; | ||
|
||
res = lwip_conn_create(&tmp, addr, addr_len, family, NETCONN_RAW, proto, 0); | ||
if (res < 0) { | ||
return res; | ||
} | ||
conn->lwip_conn = tmp; | ||
|
||
return res; | ||
} | ||
|
||
void conn_ip_close(conn_ip_t *conn) | ||
{ | ||
assert(conn != NULL); | ||
netconn_delete(conn->lwip_conn); | ||
} | ||
|
||
int conn_ip_getlocaladdr(conn_ip_t *conn, void *addr) | ||
{ | ||
assert(conn != NULL); | ||
return lwip_conn_getlocaladdr(conn->lwip_conn, addr, NULL); | ||
} | ||
|
||
int conn_ip_recvfrom(conn_ip_t *conn, void *data, size_t max_len, void *addr, size_t *addr_len) | ||
{ | ||
assert(conn != NULL); | ||
return lwip_conn_recvfrom(conn->lwip_conn, data, max_len, addr, addr_len, NULL); | ||
} | ||
|
||
int conn_ip_sendto(const void *data, size_t len, const void *src, size_t src_len, | ||
void *dst, size_t dst_len, int family, int proto) | ||
{ | ||
struct netconn *tmp; | ||
int res; | ||
|
||
res = lwip_conn_create(&tmp, src, src_len, family, NETCONN_RAW, proto, 0); | ||
if (res < 0) { | ||
return res; | ||
} | ||
res = lwip_conn_sendto(tmp, data, len, dst, dst_len, 0); | ||
netconn_delete(tmp); | ||
return res; | ||
} | ||
|
||
/** @} */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be possible/make sense to move this into
pkg/lwip/Makefile.dep
(just to keepMakefile.dep
a bit smaller)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would propose to find a general better concept for dependencies in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack