Commit graph

1260 commits

Author SHA1 Message Date
Jukka Rissanen 5d3685f85f net: Add separate buffers for MAC layer
We do not need large 1280 bytes long buffers in lower IP stack
layers. After long packet has been fragmented to smaller chunks
it depends on the radio technology how long buffers we need
to use. For 802.15.4 we can use 128 bytes long buffers.

Change-Id: I8cd6085944d78fa26a4aa1a93c58fc436856541b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:29 -05:00
Jukka Rissanen 2f5b1d1570 net: Add a way to see who is trying to alloc/dealloc a net_buf
Change-Id: Ib7813bc5809f85f27aa4fe06583b64461741466a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:29 -05:00
Jukka Rissanen 9099884162 net: Allow user application to get the packet data length
The uip_len(buf) cannot be used as the Contiki stack zeroes
the buffer len after sending and after processing received packet.

Thus the application can use uip_appdatalen(buf) macro to get
the application data length.

Change-Id: Iaaa508acb96c28919cfc0188ef46bb2b4a693090
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:28 -05:00
Jukka Rissanen 53fd129094 net: Add max length of the IPv6 address as a string
Change-Id: If7f5f3624cd34b5bff4ebb77c95ae7397e058430
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:24 -05:00
Jukka Rissanen 66fc2795e5 net: Add loopback and any IPv6 address definitions
Create IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT address
definitions for applications.

Change-Id: Ic864f559cae90a5f85e45ee90d73127b0ed8fde6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:24 -05:00
Jukka Rissanen 6b3c739d7d net: Add helper function to set the link local address
Network driver should call this when it knows the device MAC or
EUI-64 address.

Change-Id: Ie03a80fcdb9a10cd1cb15f12037b3802da13bca9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:24 -05:00
Jukka Rissanen 8ccc4b229a net: Make the union in net_addr anonymous
The network address union that holds IPv4 and IPv6 address
should be anonymous as there is no need to refer the union
separately.

Change-Id: I70bab6b91dcf49dfb5adb405eb2b9c602f932603
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:24 -05:00
Jukka Rissanen 251a45b602 net: Use our network buffers instead of global ones in Contiki
This mega patch changes how Contiki uses buffers. In standard
Contiki there is only couple of static and global buffers.
This makes the stack non-reentrant and only usable in one
thread. This patch replaces the global buffer with buffer
supplied by caller (net_buf.h). The Contiki stack is still not
fully re-entrant after this (packet reassembly needs more TLC)
but it is a good start.

Change-Id: I63abc230b36b14f33f687d3ef64cffb0f3a69f5d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:20 -05:00
Jukka Rissanen da36c6371c net: Simple socket API introduced
The network context defines a network connection.

Change-Id: I29a186be6c9de9d824f10b6442fa1dfd3711d24d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:20 -05:00
Jukka Rissanen 4f5723a5d0 net: Network initialization and tx/rx functionality
Functions to receive data from apps and transmit it to network, and
receive from network and pass data to apps.

Change-Id: I1b1b8c041e6c5e20294081d2cd403636e9909cdc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:20 -05:00