1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

72 Commits

Author SHA1 Message Date
Martine Lenders
90ece67f94 Merge pull request #2880 from authmillenon/ng_udp/fix/csum
ng_udp: fix checksum calculation for extension headers
2015-04-29 12:01:31 +02:00
Martine Lenders
797de13f01 ng_udp: fix setting of length field
udp_slip contains the UDP header already so this line technically adds
the length of the UDP header twice.
2015-04-28 21:02:52 +02:00
Martine Lenders
3ba2a59cf5 ng_udp: fix checksum calculation for extension headers 2015-04-28 17:05:25 +02:00
haukepetersen
b1d8752711 net: added NG_UDP implementation 2015-04-26 21:53:07 +02:00
Lotte Steenbrink
b1c3ca458a ng_udp: improve debug output
This PR corrects the faulty debug output from ng_udp.c:151 and unifies
all debug messages with the prefix ``udp: cannot send packet``.
2015-04-15 20:09:35 -07:00
Joakim Gebart
824c0a3daf udp: Delete unused udp_csum function.
udp_csum is never referenced anywhere in the tree, not even in a header file.
2015-03-02 12:32:02 +01:00
haukepetersen
df9dabfa7d net/udp: cleaned up header and documentation 2015-01-22 14:23:03 +01:00
Oleg Hahm
000450c894 Merge pull request #2117 from OlegHahm/doxygen_eliminate_warnings
Doxygen eliminate warnings pt. 2
2014-12-04 17:18:42 +01:00
Oleg Hahm
588ddda1fe socket: socket_base_exists_socket returns bool
Adapt the prototype to the actual used return value.
2014-12-02 14:58:44 +01:00
Oleg Hahm
a93a74daed socket: cosmetics 2014-12-02 14:53:17 +01:00
Oleg Hahm
a2b21fb019 net: socket: fix for e93d030058
The former fix for socket initialization was broken. This fixes the
"fix" by using the right exit condition for the loops.
2014-12-02 14:51:19 +01:00
Oleg Hahm
dc74bd48bf doc: removed superfluous (and broken) @file params 2014-11-30 21:52:54 +01:00
Fabian Brandt
12cd62c689 Introduction of RPL non-storing mode.
This implementation is based on RFC 6550 with addition of RFC 6554 (Source Routing Header for RPL). Both can be found under the following links:
- http://tools.ietf.org/html/rfc6550
- http://tools.ietf.org/html/rfc6554

The PR provides basic functionality for handling and forwarding packages in non-storing mode. In addition the structure of the previous implemented RPL storing mode is now revised, so that readability and modularity is increased. The following features are implemented:
- building function for a SRH and integration in common packets
- source-route build algorithm based on the structure of the DODAG
- an RPL-based interpretation of the SRH and removal at destination
- new structure for RPl-module with extracted beaconing-functionality
- leaf nodes are now supported

There are some missed goals and should be included in future updates:
- building a common routing table structure for different types of routing protocols
- routing tables are statically assigned via source code, future update should have an optional variable at build-time, which sets the size of the routing table depending on the desired functionality of a node in the network (root, node, leaf)
2014-11-27 21:42:40 +01:00
Martine Lenders
c9219b87d6 net_help: prefix csum properly and add documentation 2014-11-18 14:59:37 +01:00
Martine Lenders
53eaa4feb8 net_help: remove printArrayRange()
The od module does the same, much less specialized, much more
sophisticated.
2014-11-17 09:39:45 +01:00
Oleg Hahm
e93d030058 net: fix buffer overrun in socket initialization 2014-11-10 21:33:11 +01:00
BytesGalore
de3c3cebd0 c++: sys: add extern C to header files 2014-11-08 20:09:55 +01:00
Hinnerk van Bruinehsen
d1775a1ad1 lint: fix redundantCopy in udp code 2014-10-31 01:24:32 +01:00
Hinnerk van Bruinehsen
8723ba7568 lint: fix variableScope warnings 2014-10-31 01:24:30 +01:00
Hinnerk van Bruinehsen
a5aeaab87b lint: fix unreadVariable warnings 2014-10-31 01:24:30 +01:00
5146c66786 core: adapt to msg_try_send 2014-10-22 12:37:33 +02:00
Sebastian Sontberg
c8c518005f udp: fix byte order in sockaddr6_t
udp_recvfrom wrote the sender port number in host byte order into the
provided sockaddr6_t. Because all send functions expect the port number
in network byte order this introduces a superfluous conversion step in
case one wants to reuse the address for replying.

closes #1406
2014-10-10 15:43:34 +02:00
Hinnerk van Bruinehsen
eb9ab083bc sys: remove break after return 2014-09-13 23:47:41 +02:00
Hinnerk van Bruinehsen
57b998e4a1 cpu/examples/sys/drivers: reduce scope of variables 2014-09-13 19:03:40 +02:00
Cenk Gündoğan
710c7e6cf6 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*.
2014-09-11 20:07:46 +02:00
Ludwig Ortmann
b7992922ce fix license headers in non-.c files 2014-08-23 16:16:26 +02:00
Oleg Hahm
1de5c2b4a0 fixed remaining variables to kernel_pid_t 2014-08-07 17:29:53 +02:00
Oleg Hahm
0ad7b170ed make kernel_pid_t comparisons consistent 2014-08-07 16:31:27 +02:00
Oleg Hahm
aa2ecf6216 initialize kernel_pid_t correctly 2014-08-07 16:31:27 +02:00
Oleg Hahm
c2b0423918 core: renamed KERNEL_PID_NULL to KERNEL_PID_UNDEF
As @authmillenon pointed out the "null" in the old name is somewhat
misleading, since the actual value is -1.
2014-08-07 16:31:27 +02:00
Oleg Hahm
983d056c75 core: harmonizes the data type for the process ID
Instead of using differing integer types use kernel_pid_t for process
identifier. This type is introduced in a new header file to avoid
circular dependencies.
2014-08-01 12:02:54 +02:00
Ludwig Ortmann
d55da67fb6 Merge pull request #1329 from LudwigOrtmann/riot_license
RIOT default license header change
2014-07-31 23:12:47 +02:00
Ludwig Ortmann
3ca4f18479 doc: use lgplv2.1-short license header instead of lgpl-short-riot 2014-07-31 22:57:20 +02:00
Cenk Gündoğan
ca5b45e264 converting tabs to spaces in sys (#1439)
This PR converts tabs to white spaces.
The statement I used for the conversion:
```find . -name "*.[ch]" -exec zsh -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;```
Afterwards, I had a quick overview of the converted files to prevent odd indentation.
2014-07-31 20:51:50 +02:00
René Kijewski
ba1a15535b core: remove extra thread_create_arg() function 2014-07-09 10:28:23 +02:00
Oleg Hahm
1518d6ac64 Merge pull request #1390 from cgundogan/fix_socket_internal_t_packed_attr
destiny: deleting packed attribute from socket_internal_t
2014-07-08 22:33:54 +02:00
Cenk Gündoğan
8724eb1169 destiny: Adjust TCP_STACK_SIZE
Currently, the TCP_STACK_SIZE is `KERNEL_CONF_STACKSIZE_DEFAULT`.
However, since printf statements are used in the tcp relevant code,
this stack size is too small (esp. for MSBA2).
2014-07-08 21:30:58 +02:00
Cenk Gündoğan
b5e7460d45 destiny: deleting packed attribute from socket_internal_t
While testing the tcp implementation on MSBA2 I noticed that
the value of `tcp_input_buffer_end` gets changed whenever acquiring or
releasing the mutex of the struct on the server side.

After deleting the packed attribute of the struct this problem was
resolved and the value stayed the same after acquiring and releasing.

This problem could maybe arise from badly placed cache lines due to
missing padding... I am not sure.

Anyway, I guess using the packed attribute is useless here and makes it
more error-prone.
2014-07-08 20:40:55 +02:00
Christian Mehlis
381fec1fa8 Merge pull request #1301 from cgundogan/fix_tcp_handshake_seq_ack_rfc_compliancy
destiny: wireshark revealed wrong seq/ack nr. in tcp handshake
2014-06-30 22:05:23 +02:00
Oleg Hahm
fda7ce12d2 Merge pull request #1321 from cgundogan/fix_missing_ack_bit
destiny: set ack bit for (almost) all segments after syn
2014-06-24 11:16:37 +02:00
Cenk Gündoğan
75546fcf6c destiny: set ack bit for (almost) all segments after syn
The current implementation does not set the ack bit
for outgoing data segments and the fin segment.

However, RFC793 states that all segments
should have an ack bit set in order to present a valid
ack nr. in outgoing segments.

Currently, data segments and acknowledgement segments
are distinguished by the existence of their ack bit.
With the new assumption, that both of these types of
segments need an ack bit set, I had to change several
parts of the current implementation to make this
decision by inspecting the payload size.

destiny: added parens
2014-06-24 10:44:11 +02:00
Cenk Gündoğan
400286168f destiny: wireshark revealed wrong seq/ack nr. in tcp handshake
Capturing the tcp handshake with wireshark revealed that the
sequence and ack nrs. are not rfc compliant.
I did the changes based on
http://tools.ietf.org/html/rfc793#page-52 to http://tools.ietf.org/html/rfc793#page-72
2014-06-24 10:21:23 +02:00
René Kijewski
840c0f0a57 make: detect their module name automatically
For many modules the `Makefile` contains a line like
```
MODULE:=$(shell basename $(CURDIR))
```
This conclusively shows that we do not have to set the module name
manually.

This PR removes the need to set the module name manually, if it is the
same as the basename. E.g. for `…/sys/vtimer/Makefile` the variable
make `MODULE` will still be `vtimer`, because it is the basename of the
Makefile.
2014-06-17 15:49:32 +02:00
Christian Mehlis
997dcd7e88 Merge pull request #1302 from cgundogan/fix_tcp_header_data_offset
destiny: using a bit field for tcp_header->data_offset is more convenient
2014-06-14 15:40:49 +02:00
Christian Mehlis
50a07d9874 Merge pull request #1280 from cgundogan/fix_send_tcp_error_check
destiny: fixed condition for error handling of send_tcp in destiny_socket_send
2014-06-12 09:55:37 +02:00
Oleg Hahm
f6cd96b023 Merge pull request #1300 from cgundogan/fix_wrong_byte_order_ipv6_length
destiny: change byte order of ipv6_header->length
2014-06-09 22:01:41 +02:00
Cenk Gündoğan
ecf47b1f48 destiny: using a bit field for tcp_header->data_offset is more convenient
In the current implementation the data offset is coded into an uint8_t.
Of this uint8_t only 3 bits apply for the data offset.
The remaining bits represent reserved flags for future use.
However, a proper bit masking is forgotten in order
to obtain the data offset part of this uint8_t.

Therefore, defining this uint8_t as a bit field allows a more convenient
method of access.
2014-06-09 19:37:37 +02:00
Cenk Gündoğan
97da23051a destiny: change byte order of ipv6_header->length
When accessing the length field of an ipv6_header a byte order switch (host -> network) is necessary.
Otherwise, it breaks calculations or the checksum and other tcp related computations.
Furthermore, when writing to ipv6_header->length it is important to switch this
from host byte order to network byte order.
2014-06-08 20:50:45 +02:00
Cenk Gündoğan
7584ffe887 destiny: fixed condition for error handling
send_tcp returns either the length of the sent data,
or -1, if an error was detected.

The current implementation checks for != 1.
This results in executing the error case, although
there was semantically no error returned from send_tcp.
2014-06-05 14:17:48 +02:00
Cenk Gündoğan
43b7a393b1 destiny: wireshark compliant tcp flags
This enum is also used to set the tcp flags within a tcp header.
With the current values in this enum, wireshark is not able to
recognize the tcp segments as their actual tcp type,
and thus odd messages in wireshark appear.

destiny: reusing tcp flags for combinations
2014-06-05 13:15:00 +02:00