-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
transport_layer: Splitting UDP and TCP
Currently, the tcp and udp implementations are bound to each other in a module called *destiny*. Thus, when using only one of them then the other one gets also compiled into the binary and initialized, which results in unnecessary RAM usage and workload for the CPU. The approach in this PR defines a common module named *socket_base*, which contains functions used by the posix layer. Compiled by it's own, those functions return negative error codes, to symbolize upper layers that they are not supported. When also including the modules *udp* or *tcp* respectively, functions from *socket_base* get overwritten with the correct functionality. Defining *udp* or *tcp* in a Makefile also includes *socket_base*. Defining *pnet* in a Makefile also includes *socket_base*.
- Loading branch information
Showing
41 changed files
with
1,777 additions
and
1,552 deletions.
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
PSEUDOMODULES += defaulttransceiver | ||
PSEUDOMODULES += transport_layer |
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
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
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
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* destiny.h - Wraps all API types, constants and functions of the transport | ||
* socket_base.h - Wraps all API types, constants and functions of the transport | ||
* layer implementation. | ||
* | ||
* Copyright (C) 2013 INRIA. | ||
|
@@ -10,9 +10,9 @@ | |
*/ | ||
|
||
/** | ||
* @defgroup destiny DESTiny - Transport layer implementation | ||
* @defgroup socket_base Transport layer implementation | ||
* @ingroup net | ||
* @brief DESTiny module implements the transport layer. This includes | ||
* @brief This module implements the transport layer. This includes | ||
* 6LoWPAN UDP header compression and (experimental) 6LoWPAN TCP header | ||
* compression. | ||
* @see <a href="http://tools.ietf.org/html/rfc6282#section-4.3"> | ||
|
@@ -25,23 +25,16 @@ | |
* </a> | ||
* @{ | ||
* @file | ||
* @brief destiny functions | ||
* @brief transport_layer functions | ||
* @author Oliver Gesch <[email protected]> | ||
* @author Martin Lenders <[email protected]> | ||
*/ | ||
|
||
#ifndef DESTINY_H | ||
#define DESTINY_H | ||
#ifndef SOCKET_BASE_H | ||
#define SOCKET_BASE_H | ||
|
||
#include "destiny/in.h" | ||
#include "destiny/socket.h" | ||
#include "destiny/types.h" | ||
#include "socket_base/in.h" | ||
#include "socket_base/socket.h" | ||
#include "socket_base/types.h" | ||
|
||
/** | ||
* Initializes transport layer. | ||
* | ||
* @return 0 on success, other else. | ||
*/ | ||
int destiny_init_transport_layer(void); | ||
|
||
#endif /* DESTINY_H */ | ||
#endif /* SOCKET_BASE_H */ |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* destiny/in.h - Constants defined by the internet system, per RFC 790, | ||
* socket_base/in.h - Constants defined by the internet system, per RFC 790, | ||
* September 1981, and numerous additions, inspired by | ||
* netinet/in.h definitions. | ||
* @{ | ||
|
@@ -18,8 +18,8 @@ | |
* @author Martin Lenders <[email protected]> | ||
*/ | ||
|
||
#ifndef DESTINY_IN_H | ||
#define DESTINY_IN_H | ||
#ifndef SOCKET_BASE_IN_H | ||
#define SOCKET_BASE_IN_H | ||
|
||
/* | ||
* Protocols (RFC 1700) TODO: may be deleted due to some double definition | ||
|
@@ -141,4 +141,4 @@ | |
|
||
#define IN_LOOPBACKNET (127) ///< official! | ||
|
||
#endif /* DESTINY_IN_H */ | ||
#endif /* SOCKET_BASE_IN_H */ |
Oops, something went wrong.