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

98 Commits

Author SHA1 Message Date
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
Cenk Gündoğan
f41fe7bb04 destiny: segfault due to dereferencing nullpointer
get_socket(i) returns NULL, when no specific socket is found.
Without an appropriate check for NULL, the current state
of the code leads to a segfault.

destiny: added parens

destiny: continuing the loop makes more sense than returning at first sight of NULL
2014-06-03 22:48:01 +02:00
Oleg Hahm
5bcbb09b73 net: destiny: fixed typo and further cleanups 2014-03-18 12:03:03 +01:00
Oleg Hahm
5687553411 cosmetics 2014-03-18 10:08:30 +01:00
Oleg Hahm
5e4a9c0e94 net: destiny: renamed internal TCP enums
Rationale: LISTEN was used in MSP430-Lib for the USART.
2014-03-17 19:38:10 +01:00
Martin Lenders
00acab920b Let IPv6 and ICMP use new 6LoWPAN layer (+fixes) 2014-03-01 15:08:18 +01:00
Christian Mehlis
8556403f8f Merge pull request #680 from benpicco/fix_crash
set up message queues for the IP and UDP thread
2014-02-24 15:10:19 +01:00
Benjamin Valentin
4068133f3d also add msg_queue for UDP
All other layers in the network stack use a msg_queue to not drop messages, which in this context represent packages.
This finally fixes the random crashes when UDP network traffic is present. Turns out RIOT is not handling lost messages well.
2014-02-13 07:07:46 +01:00
Christian Mehlis
bfadc1a18e Merge pull request #640 from benpicco/fixes
newlib doesn't support the z modifier
2014-02-10 20:33:42 +01:00
Benjamin Valentin
2e26bb7214 newlib doesn't support the z modifier
on msba2 this will print

    Initializing transport layer packages. Size of socket_type: zu
2014-02-08 21:31:13 +01:00
Oleg Hahm
70747d8bb4 streamlined driver include pathes 2014-02-05 18:56:47 +01:00
Martin Lenders
333a19db03 Add Oliver Gesch as author of his files and license header 2014-01-31 17:01:51 +01:00
Christian Mehlis
f2f36f8179 math.h: remove unneeded math.h includes 2014-01-24 15:41:30 +01:00
Christian Mehlis
5c3381b70a tcp_timer: fix 'remove without use' behavior 2014-01-18 01:20:40 +01:00
Christian Mehlis
a4f1dc464a demo: fix printf handling 2014-01-18 01:15:29 +01:00
Christian Mehlis
b6734ce2cb socket: fix warning of void pointer arithmetic 2014-01-18 01:12:38 +01:00
Oleg Hahm
420dc8953b Merge pull request #504 from mehlis/ipv6-send-return-value
ipv6_sendto: return the success
2014-01-16 08:04:00 -08:00
Christian Mehlis
8cfab9d014 ipv6_sendto: return the success 2014-01-14 07:29:28 +01:00
Christian Mehlis
a19ff87d21 socket.c: fix usage of timex_t 2014-01-09 16:36:40 +01:00
Christian Mehlis
e28481b1b1 tcp_timer.c: fix usage of timex_t 2014-01-09 16:36:40 +01:00
Christian Mehlis
0934d10e4b destiny.c: fix usage of timex_t 2014-01-09 16:36:40 +01:00
Oleg Hahm
593ee623b6 simplify and unify include pathes
additional:
* exporting include path in sys is mandatory for subfolders
* removed duplicate object file in linker call
2014-01-05 16:11:07 +01:00
Oleg Hahm
a7d3092a4e moved destiny into transport_layer subfolder 2013-12-19 19:13:26 +01:00