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.
dev/timer
Cenk Gündoğan 9 years ago
parent ae4a668695
commit ca5b45e264

@ -14,10 +14,10 @@
#define RADIO_H_
/**
* @defgroup net_datalink Data link layer
* @ingroup net
* @defgroup net_datalink Data link layer
* @ingroup net
*
* @brief Defines interface of data link layers for use with micro mesh stack.
* @brief Defines interface of data link layers for use with micro mesh stack.
*
* @{
*/
@ -26,11 +26,11 @@
* @file
* @brief
*
* @author baar
* @author Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
* @author baar
* @author Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
* @version $Revision: 1961 $
*
* @note $Id$
* @note $Id$
*/
#include <stdint.h>
@ -41,23 +41,23 @@
#define FEUERWARE_CONF_NUM_RADIOS 1
#endif
#define L1_PROTOCOL_CATCH_ALL (0xff) ///< Catch all protocol ID
#define L1_PROTOCOL_CATCH_ALL (0xff) ///< Catch all protocol ID
enum layer_1_protocols {
LAYER_1_PROTOCOL_LL_ACK = 1, ///< Link-Level Acknowledgement (LL-ACK)
LAYER_1_PROTOCOL_MM = 2, ///< Micro Mesh network packet (MM)
LAYER_1_PROTOCOL_LL_ACK = 1, ///< Link-Level Acknowledgement (LL-ACK)
LAYER_1_PROTOCOL_MM = 2, ///< Micro Mesh network packet (MM)
};
/**
* Radio/MAC API.
*/
typedef struct {
const char *name;
const char *name;
const radio_address_t broadcast_address;
const uint8_t output_power_max;
/**
* @return the average transmission duration of one packet
* in milliseconds, e.g. till ACK received.
* @return the average transmission duration of one packet
* in milliseconds, e.g. till ACK received.
*/
int (*get_avg_transmission_duration)(void);
radio_address_t (*get_address)(void);
@ -65,11 +65,11 @@ typedef struct {
bool (*set_output_power)(uint8_t pa_idx);
bool (*set_packet_monitor)(packet_monitor_t monitor);
/**
* @return -1 if an error occurs (e.g. handler table full) else >= 0.
* @return -1 if an error occurs (e.g. handler table full) else >= 0.
*/
int (*set_packet_handler)(protocol_t protocol, packet_handler_t handler);
/**
* @return A negative value if operation failed; else the number of transmitted bytes.
* @return A negative value if operation failed; else the number of transmitted bytes.
*/
int (*send)(radio_address_t address, protocol_t protocol, int priority, char *payload, int payload_len);
void (*print_stats)(void);

@ -15,13 +15,13 @@
/**
* @file
* @brief Common network stack types (of all layers).
* @brief Common network stack types (of all layers).
*
* @author Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
* @author Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
* @author Oliver Hahm <oliver.hahm@inria.fr>
* @version $Revision: 2061 $
*
* @note $Id: common-types.h 2061 2010-04-01 12:13:22Z hillebra $
* @note $Id: common-types.h 2061 2010-04-01 12:13:22Z hillebra $
*/
#include <stdint.h>
@ -30,13 +30,13 @@
#include "board.h"
#include "timex.h"
typedef uint8_t protocol_t; ///< Packet protocol type
typedef uint16_t radio_address_t; ///< Radio layer address type
typedef uint8_t protocol_t; ///< Packet protocol type
typedef uint16_t radio_address_t; ///< Radio layer address type
#define NUM_PRIORITY_LEVELS 3 ///< Number of packet transmission priorities
#define NUM_PRIORITY_LEVELS 3 ///< Number of packet transmission priorities
/**
* @brief Packet transmission priorities of various layers.
* @brief Packet transmission priorities of various layers.
*/
enum transmission_priorities {
PRIORITY_ALARM = 0,
@ -50,14 +50,14 @@ enum transmission_priorities {
* all layers. Each layers fills in additional information.
*/
typedef struct __attribute__((packed)) packet_info_t {
uint16_t source; ///< Net layer: source
uint16_t destination; ///< Net layer: destination
radio_address_t phy_src; ///< Radio layer: source
uint8_t rssi; ///< Radio layer: RSSI
uint8_t lqi; ///< Radio layer: LQI
uint8_t ttl; ///< Net layer: TTL
uint8_t tos; ///< Net layer: TOS
bool promiscuous; ///< Radio layer: whether network interface is in promiscuous mode
uint16_t source; ///< Net layer: source
uint16_t destination; ///< Net layer: destination
radio_address_t phy_src; ///< Radio layer: source
uint8_t rssi; ///< Radio layer: RSSI
uint8_t lqi; ///< Radio layer: LQI
uint8_t ttl; ///< Net layer: TTL
uint8_t tos; ///< Net layer: TOS
bool promiscuous; ///< Radio layer: whether network interface is in promiscuous mode
} packet_info_t;
@ -80,9 +80,9 @@ radio_packet_t;
/**
* Packet handler (receive function) of all layers.
* @param [in/out] payload Pointer to packet payload data
* @param [in] payload_size Size of the packet payload data in bytes
* @param [in/out] packet_info Cross-layer meta data
* @param [in/out] payload Pointer to packet payload data
* @param [in] payload_size Size of the packet payload data in bytes
* @param [in/out] packet_info Cross-layer meta data
*/
typedef void (*packet_handler_t)(void *payload, int payload_size, packet_info_t *packet_info);
@ -90,10 +90,10 @@ typedef void (*packet_handler_t)(void *payload, int payload_size, packet_info_t
* Packet monitor of all layers. Normally there can be one packet
* monitor per layer (if any). The payload must not be changed!
*
* @param payload Pointer to packet payload data
* @param payload_size Size of the packet payload data in bytes
* @param protocol Protocol type of the packet payload data
* @param packet_info Cross-layer meta data
* @param payload Pointer to packet payload data
* @param payload_size Size of the packet payload data in bytes
* @param protocol Protocol type of the packet payload data
* @param packet_info Cross-layer meta data
*/
typedef void (*packet_monitor_t)(void *payload, int payload_size, protocol_t protocol, packet_info_t *packet_info);

@ -31,15 +31,15 @@
#define CMP_MATCH 1 // used to match interest and content
#define CMP_LONGEST 2 // used to lookup the FIB
#define CCNL_FACE_FLAGS_STATIC 1
#define CCNL_FACE_FLAGS_REFLECT 2
#define CCNL_FACE_FLAGS_SERVED 4
#define CCNL_FACE_FLAGS_FWDALLI 8 // forward all interests, also known ones
#define CCNL_FACE_FLAGS_STATIC 1
#define CCNL_FACE_FLAGS_REFLECT 2
#define CCNL_FACE_FLAGS_SERVED 4
#define CCNL_FACE_FLAGS_FWDALLI 8 // forward all interests, also known ones
#define CCNL_FACE_FLAGS_BROADCAST 16
#define CCNL_FRAG_NONE 0
#define CCNL_FRAG_SEQUENCED2012 1
#define CCNL_FRAG_CCNx2013 2
#define CCNL_FRAG_NONE 0
#define CCNL_FRAG_SEQUENCED2012 1
#define CCNL_FRAG_CCNx2013 2
#define CCNL_CONTENT_FLAGS_STATIC 0x01
#define CCNL_CONTENT_FLAGS_STALE 0x02
@ -90,10 +90,10 @@ struct ccnl_relay_s {
struct ccnl_interest_s *pit;
struct ccnl_content_s *contents; //, *contentsend;
struct ccnl_nonce_s *nonces;
int contentcnt; // number of cached items
int max_cache_entries; // -1: unlimited
int contentcnt; // number of cached items
int max_cache_entries; // -1: unlimited
struct ccnl_if_s ifs[CCNL_MAX_INTERFACES];
int ifcount; // number of active interfaces
int ifcount; // number of active interfaces
char halt_flag;
struct ccnl_sched_s *(*defaultFaceScheduler)(struct ccnl_relay_s *,
void(*cts_done)(void *, void *));
@ -184,8 +184,8 @@ struct ccnl_interest_s {
struct ccnl_pendint_s *pending; // linked list of faces wanting that content
struct ccnl_prefix_s *prefix;
int minsuffix, maxsuffix;
struct ccnl_buf_s *ppkd; // publisher public key digest
struct ccnl_buf_s *pkt; // full datagram
struct ccnl_buf_s *ppkd; // publisher public key digest
struct ccnl_buf_s *pkt; // full datagram
struct timeval last_used;
int retries;
struct ccnl_forward_s *forwarded_over;

@ -168,7 +168,7 @@ static void riot_ccnl_appserver_register(void)
void *ccnl_riot_appserver_start(void *arg)
{
int _relay_pid = (int) arg;
int _relay_pid = (int) arg;
relay_pid = _relay_pid;
riot_ccnl_appserver_register();
riot_ccnl_appserver_ioloop();

@ -494,10 +494,10 @@ void ccnl_frag_RX_serialfragment(RX_datagram callback,
/* ---------------------------------------------------------------------- */
#define getNumField(var,len,flag,rem) \
DEBUGMSG(19, " parsing " rem "\n"); \
if (unmkBinaryInt(data, datalen, &var, &len) != 0) \
goto Bail; \
s.HAS |= flag
DEBUGMSG(19, " parsing " rem "\n"); \
if (unmkBinaryInt(data, datalen, &var, &len) != 0) \
goto Bail; \
s.HAS |= flag
#define HAS_FLAGS 0x01
#define HAS_OSEQ 0x02
#define HAS_OLOS 0x04
@ -522,7 +522,7 @@ int ccnl_frag_RX_frag2012(RX_datagram callback, struct ccnl_relay_s *relay,
case CCN_DTAG_CONTENT:
DEBUGMSG(18, " frag content\n");
// if (s.content) /* error: more than one content entry */
// if (s.content) /* error: more than one content entry */
if (consume(typ, num, data, datalen, &s.content, &s.contlen)
< 0) {
goto Bail;
@ -624,7 +624,7 @@ int ccnl_frag_RX_CCNx2013(RX_datagram callback, struct ccnl_relay_s *relay,
case CCN_DTAG_CONTENT:
// if (frag) /* error: more than one content entry */
// if (frag) /* error: more than one content entry */
if (consume(typ, num, data, datalen, &s.content, &s.contlen)
< 0) {
goto Bail;

@ -100,13 +100,13 @@ ccnl_prefix_clone(struct ccnl_prefix_s *p)
#define extractStr(VAR,DTAG) \
if (typ == CCN_TT_DTAG && num == DTAG) { \
char *s; unsigned char *valptr; int vallen; \
if (consume(typ, num, &buf, &buflen, &valptr, &vallen) < 0) goto Bail; \
s = ccnl_malloc(vallen+1); if (!s) goto Bail; \
memcpy(s, valptr, vallen); s[vallen] = '\0'; \
ccnl_free(VAR); \
VAR = (unsigned char*) s; \
continue; \
char *s; unsigned char *valptr; int vallen; \
if (consume(typ, num, &buf, &buflen, &valptr, &vallen) < 0) goto Bail; \
s = ccnl_malloc(vallen+1); if (!s) goto Bail; \
memcpy(s, valptr, vallen); s[vallen] = '\0'; \
ccnl_free(VAR); \
VAR = (unsigned char*) s; \
continue; \
} do {} while(0)
void
@ -200,7 +200,7 @@ ccnl_mgmt_newface(struct ccnl_relay_s *ccnl, struct ccnl_buf_s *orig,
extractStr(proto, CCN_DTAG_IPPROTO);
extractStr(host, CCN_DTAG_HOST);
extractStr(port, CCN_DTAG_PORT);
// extractStr(frag, CCNL_DTAG_FRAG);
// extractStr(frag, CCNL_DTAG_FRAG);
extractStr(flags, CCNL_DTAG_FACEFLAGS);
if (consume(typ, num, &buf, &buflen, 0, 0) < 0) {
@ -245,7 +245,7 @@ ccnl_mgmt_newface(struct ccnl_relay_s *ccnl, struct ccnl_buf_s *orig,
if (f) {
int flagval = flags ?
strtol((const char *)flags, NULL, 0) : CCNL_FACE_FLAGS_STATIC;
// DEBUGMSG(1, " flags=%s %d\n", flags, flagval);
// DEBUGMSG(1, " flags=%s %d\n", flags, flagval);
DEBUGMSG(99, " adding a new face (id=%d) worked!\n", f->faceid);
f->flags = flagval &
(CCNL_FACE_FLAGS_STATIC | CCNL_FACE_FLAGS_REFLECT);

@ -43,15 +43,15 @@ struct ccnl_buf_s *ccnl_frag_getnext(struct ccnl_frag_s *e,
/*
struct ccnl_buf_s* ccnl_frag_handle_fragment(struct ccnl_relay_s *r,
struct ccnl_face_s *f, unsigned char *data, int datalen);
struct ccnl_face_s *f, unsigned char *data, int datalen);
*/
void ccnl_frag_destroy(struct ccnl_frag_s *e);
/*
struct ccnl_buf_s* ccnl_frag_fragment(struct ccnl_relay_s *ccnl,
struct ccnl_frag_s *frag,
struct ccnl_buf_s *buf);
struct ccnl_frag_s *frag,
struct ccnl_buf_s *buf);
*/
typedef int (RX_datagram)(struct ccnl_relay_s *, struct ccnl_face_s *,
@ -88,8 +88,8 @@ ccnl_prefix_clone_strip(struct ccnl_prefix_s *p, int strip);
// ----------------------------------------------------------------------
# define ccnl_sched_CTS_done(S,C,L) do{}while(0)
# define ccnl_sched_destroy(S) do{}while(0)
# define ccnl_sched_CTS_done(S,C,L) do{}while(0)
# define ccnl_sched_destroy(S) do{}while(0)
char *ccnl_prefix_to_path(struct ccnl_prefix_s *pr);

@ -60,15 +60,15 @@
// our own CCN-lite extensions for the ccnb encoding:
// management protocol: (ccnl-ext-mgmt.c)
#define CCNL_DTAG_MACSRC 99001 // newface: which L2 interface
#define CCNL_DTAG_IP4SRC 99002 // newface: which L3 interface
#define CCNL_DTAG_UNIXSRC 99003 // newface: which UNIX path
#define CCNL_DTAG_FRAG 99004 // fragmentation protocol, see core.h
#define CCNL_DTAG_FACEFLAGS 99005 //
#define CCNL_DTAG_DEVINSTANCE 99006 // adding/removing a device/interface
#define CCNL_DTAG_DEVNAME 99007 // name of interface (eth0, wlan0)
#define CCNL_DTAG_DEVFLAGS 99008 //
#define CCNL_DTAG_MTU 99009 //
#define CCNL_DTAG_MACSRC 99001 // newface: which L2 interface
#define CCNL_DTAG_IP4SRC 99002 // newface: which L3 interface
#define CCNL_DTAG_UNIXSRC 99003 // newface: which UNIX path
#define CCNL_DTAG_FRAG 99004 // fragmentation protocol, see core.h
#define CCNL_DTAG_FACEFLAGS 99005 //
#define CCNL_DTAG_DEVINSTANCE 99006 // adding/removing a device/interface
#define CCNL_DTAG_DEVNAME 99007 // name of interface (eth0, wlan0)
#define CCNL_DTAG_DEVFLAGS 99008 //
#define CCNL_DTAG_MTU 99009 //
#define CCNL_DTAG_DEBUGREQUEST 99100 //
#define CCNL_DTAG_DEBUGACTION 99101 // dump, halt, dump+halt
@ -100,38 +100,38 @@
#define CCNL_DTAG_SERVEDCTN 99224
// fragmentation protocol: (ccnl-ext-frag.c, FRAG_SEQUENCED2012)
#define CCNL_DTAG_FRAGMENT2012 144144 // http://redmine.ccnx.org/issues/100803
#define CCNL_DTAG_FRAGMENT 144199 // pending request (2013-07-24)
#define CCNL_DTAG_FRAGMENT2012 144144 // http://redmine.ccnx.org/issues/100803
#define CCNL_DTAG_FRAGMENT 144199 // pending request (2013-07-24)
#define CCNL_DTAG_FRAG_TYPE (CCNL_DTAG_FRAGMENT+1)
#define CCNL_DTAG_FRAG_FLAGS (CCNL_DTAG_FRAGMENT+2)
#define CCNL_DTAG_FRAG_SEQNR (CCNL_DTAG_FRAGMENT+3) // our seq number
#define CCNL_DTAG_FRAG_TYPE (CCNL_DTAG_FRAGMENT+1)
#define CCNL_DTAG_FRAG_FLAGS (CCNL_DTAG_FRAGMENT+2)
#define CCNL_DTAG_FRAG_SEQNR (CCNL_DTAG_FRAGMENT+3) // our seq number
#define CCNL_DTAG_FRAG_OLOSS (CCNL_DTAG_FRAGMENT+5) // our loss count
#define CCNL_DTAG_FRAG_YSEQN (CCNL_DTAG_FRAGMENT+6) // your (highest) seq no
#define CCNL_DTAG_FRAG_OLOSS (CCNL_DTAG_FRAGMENT+5) // our loss count
#define CCNL_DTAG_FRAG_YSEQN (CCNL_DTAG_FRAGMENT+6) // your (highest) seq no
/*
#define CCNL_DTAG_FRAG_YSEQN16 (CCNL_DTAG_FRAGMENT+4)
#define CCNL_DTAG_FRAG_YSEQN32 (CCNL_DTAG_FRAGMENT+5)
#define CCNL_DTAG_FRAG_YSEQN16 (CCNL_DTAG_FRAGMENT+4)
#define CCNL_DTAG_FRAG_YSEQN32 (CCNL_DTAG_FRAGMENT+5)
*/
#define CCNL_DTAG_FRAG_FLAG_MASK 0x03
#define CCNL_DTAG_FRAG_FLAG_FIRST 0x01
#define CCNL_DTAG_FRAG_FLAG_MID 0x00
#define CCNL_DTAG_FRAG_FLAG_LAST 0x02
#define CCNL_DTAG_FRAG_FLAG_SINGLE 0x03
#define CCNL_DTAG_FRAG_FLAG_MASK 0x03
#define CCNL_DTAG_FRAG_FLAG_FIRST 0x01
#define CCNL_DTAG_FRAG_FLAG_MID 0x00
#define CCNL_DTAG_FRAG_FLAG_LAST 0x02
#define CCNL_DTAG_FRAG_FLAG_SINGLE 0x03
#define CCNL_DTAG_FRAG_FLAG_STATUSREQ 0x04
#define CCNL_DTAG_FRAG_FLAG_STATUSREQ 0x04
// echo "FHBH" | base64 -d | hexdump -v -e '/1 "@x%02x"'| tr @ '\\'; echo
#define CCNL_FRAG_TYPE_CCNx2013_VAL "\x14\x70\x47"
// fragmentation protocol: (ccnl-ext-frag.c, FRAG_WIRE2013)
#define CCNL_DTAG_WIRE 333333
#define CCNL_DTAG_WFRAG_FLAGS (CCNL_DTAG_WIRE+1)
#define CCNL_DTAG_WFRAG_OSEQN (CCNL_DTAG_WIRE+2) // our seq number
#define CCNL_DTAG_WFRAG_OLOSS (CCNL_DTAG_WIRE+3) // our loss count
#define CCNL_DTAG_WFRAG_YSEQN (CCNL_DTAG_WIRE+4) // your (highest) seq no
#define CCNL_DTAG_WFRAG_FLAG_FIRST 0x01
#define CCNL_DTAG_WFRAG_FLAG_LAST 0x02
#define CCNL_DTAG_WIRE 333333
#define CCNL_DTAG_WFRAG_FLAGS (CCNL_DTAG_WIRE+1)
#define CCNL_DTAG_WFRAG_OSEQN (CCNL_DTAG_WIRE+2) // our seq number
#define CCNL_DTAG_WFRAG_OLOSS (CCNL_DTAG_WIRE+3) // our loss count
#define CCNL_DTAG_WFRAG_YSEQN (CCNL_DTAG_WIRE+4) // your (highest) seq no
#define CCNL_DTAG_WFRAG_FLAG_FIRST 0x01
#define CCNL_DTAG_WFRAG_FLAG_LAST 0x02
#define ENABLE_DEBUG (1)
#include "debug.h"

@ -26,47 +26,47 @@
// ----------------------------------------------------------------------
#define CCN_TT_TAG 1
#define CCN_TT_DTAG 2
#define CCN_TT_ATTR 3
#define CCN_TT_DATTR 4
#define CCN_TT_BLOB 5
#define CCN_TT_UDATA 6
#define CCN_TT_TAG 1
#define CCN_TT_DTAG 2
#define CCN_TT_ATTR 3
#define CCN_TT_DATTR 4
#define CCN_TT_BLOB 5
#define CCN_TT_UDATA 6
#define CCN_DTAG_ANY 13
#define CCN_DTAG_NAME 14
#define CCN_DTAG_COMPONENT 15
#define CCN_DTAG_CONTENT 19
#define CCN_DTAG_SIGNEDINFO 20
#define CCN_DTAG_INTEREST 26
#define CCN_DTAG_KEY 27
#define CCN_DTAG_KEYLOCATOR 28
#define CCN_DTAG_KEYNAME 29
#define CCN_DTAG_SIGNATURE 37
#define CCN_DTAG_TIMESTAMP 39
#define CCN_DTAG_TYPE 40
#define CCN_DTAG_NONCE 41
#define CCN_DTAG_SCOPE 42
#define CCN_DTAG_EXCLUDE 43
#define CCN_DTAG_ANSWERORIGKIND 47
#define CCN_DTAG_WITNESS 53
#define CCN_DTAG_SIGNATUREBITS 54
#define CCN_DTAG_FRESHNESS 58
#define CCN_DTAG_FINALBLOCKID 59
#define CCN_DTAG_PUBPUBKDIGEST 60
#define CCN_DTAG_PUBCERTDIGEST 61
#define CCN_DTAG_CONTENTOBJ 64
#define CCN_DTAG_ACTION 73
#define CCN_DTAG_FACEID 74
#define CCN_DTAG_IPPROTO 75
#define CCN_DTAG_HOST 76
#define CCN_DTAG_PORT 77
#define CCN_DTAG_FWDINGFLAGS 79
#define CCN_DTAG_FACEINSTANCE 80
#define CCN_DTAG_FWDINGENTRY 81
#define CCN_DTAG_MINSUFFCOMP 83
#define CCN_DTAG_MAXSUFFCOMP 84
#define CCN_DTAG_SEQNO 256
#define CCN_DTAG_CCNPDU 17702112
#define CCN_DTAG_ANY 13
#define CCN_DTAG_NAME 14
#define CCN_DTAG_COMPONENT 15
#define CCN_DTAG_CONTENT 19
#define CCN_DTAG_SIGNEDINFO 20
#define CCN_DTAG_INTEREST 26
#define CCN_DTAG_KEY 27
#define CCN_DTAG_KEYLOCATOR 28
#define CCN_DTAG_KEYNAME 29
#define CCN_DTAG_SIGNATURE 37
#define CCN_DTAG_TIMESTAMP 39
#define CCN_DTAG_TYPE 40
#define CCN_DTAG_NONCE 41
#define CCN_DTAG_SCOPE 42
#define CCN_DTAG_EXCLUDE 43
#define CCN_DTAG_ANSWERORIGKIND 47
#define CCN_DTAG_WITNESS 53
#define CCN_DTAG_SIGNATUREBITS 54
#define CCN_DTAG_FRESHNESS 58
#define CCN_DTAG_FINALBLOCKID 59
#define CCN_DTAG_PUBPUBKDIGEST 60
#define CCN_DTAG_PUBCERTDIGEST 61
#define CCN_DTAG_CONTENTOBJ 64
#define CCN_DTAG_ACTION 73
#define CCN_DTAG_FACEID 74
#define CCN_DTAG_IPPROTO 75
#define CCN_DTAG_HOST 76
#define CCN_DTAG_PORT 77
#define CCN_DTAG_FWDINGFLAGS 79
#define CCN_DTAG_FACEINSTANCE 80
#define CCN_DTAG_FWDINGENTRY 81
#define CCN_DTAG_MINSUFFCOMP 83
#define CCN_DTAG_MAXSUFFCOMP 84
#define CCN_DTAG_SEQNO 256
#define CCN_DTAG_CCNPDU 17702112
// eof

@ -22,14 +22,14 @@
/* const char *
* inet_ntop4(src, dst, size)
* format an IPv4 address, more or less like inet_ntoa()
* format an IPv4 address, more or less like inet_ntoa()
* return:
* `dst' (as a const)
* `dst' (as a const)
* notes:
* (1) uses no statics
* (2) takes a u_char* not an in_addr as input
* (1) uses no statics
* (2) takes a u_char* not an in_addr as input
* author:
* Paul Vixie, 1996.
* Paul Vixie, 1996.
*/
static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size)
{
@ -67,9 +67,9 @@ static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size)
/* const char *
* inet_ntop6(src, dst, size)
* convert IPv6 binary address into presentation (printable) format
* convert IPv6 binary address into presentation (printable) format
* author:
* Paul Vixie, 1996.
* Paul Vixie, 1996.
*/
static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size)
{
@ -91,8 +91,8 @@ static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size)
/*
* Preprocess:
* Copy the input (bytewise) array into a wordwise array.
* Find the longest run of 0x00's in src[] for :: shorthanding.
* Copy the input (bytewise) array into a wordwise array.
* Find the longest run of 0x00's in src[] for :: shorthanding.
*/
next_src = src;
src_end = src + IN6ADDRSZ;
@ -191,11 +191,11 @@ static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size)
/* char *
* inet_ntop(af, src, dst, size)
* convert a network format address to presentation format.
* convert a network format address to presentation format.
* return:
* pointer to presentation format address (`dst'), or NULL (see errno).
* pointer to presentation format address (`dst'), or NULL (see errno).
* author:
* Paul Vixie, 1996.
* Paul Vixie, 1996.
*/
const char *inet_ntop(int af, const void *src, char *dst, size_t size)
{

@ -24,13 +24,13 @@
/* int
* inet_pton4(src, dst)
* like inet_aton() but without all the hexadecimal and shorthand.
* like inet_aton() but without all the hexadecimal and shorthand.
* return:
* 1 if `src' is a valid dotted quad, else 0.
* 1 if `src' is a valid dotted quad, else 0.
* notice:
* does not touch `dst' unless it's returning 1.
* does not touch `dst' unless it's returning 1.
* author:
* Paul Vixie, 1996.
* Paul Vixie, 1996.
*/
static int inet_pton4(const char *src, unsigned char *dst)
{
@ -85,16 +85,16 @@ static int inet_pton4(const char *src, unsigned char *dst)
/* int
* inet_pton6(src, dst)
* convert presentation level address to network order binary form.
* convert presentation level address to network order binary form.
* return:
* 1 if `src' is a valid [RFC1884 2.2] address, else 0.
* 1 if `src' is a valid [RFC1884 2.2] address, else 0.
* notice:
* (1) does not touch `dst' unless it's returning 1.
* (2) :: in a full address is silently ignored.
* (1) does not touch `dst' unless it's returning 1.
* (2) :: in a full address is silently ignored.
* credit:
* inspired by Mark Andrews.
* inspired by Mark Andrews.
* author:
* Paul Vixie, 1996.
* Paul Vixie, 1996.
*/
static int inet_pton6(const char *src, unsigned char *dst)
{
@ -165,7 +165,7 @@ static int inet_pton6(const char *src, unsigned char *dst)
inet_pton4(curtok, tp) > 0) {
tp += INADDRSZ;
saw_xdigit = 0;
break; /* '\0' was seen by inet_pton4(). */
break; /* '\0' was seen by inet_pton4(). */
}
return (0);
@ -206,14 +206,14 @@ static int inet_pton6(const char *src, unsigned char *dst)
/* int
* inet_pton(af, src, dst)
* convert from presentation format (which usually means ASCII printable)
* to network format (which is usually some kind of binary format).
* convert from presentation format (which usually means ASCII printable)
* to network format (which is usually some kind of binary format).
* return:
* 1 if the address was valid for the specified address family
* 0 if the address wasn't valid (`dst' is untouched in this case)
* -1 if some other error occurred (`dst' is untouched in this case, too)
* 1 if the address was valid for the specified address family
* 0 if the address wasn't valid (`dst' is untouched in this case)
* -1 if some other error occurred (`dst' is untouched in this case, too)
* author:
* Paul Vixie, 1996.
* Paul Vixie, 1996.
*/
int inet_pton(int af, const char *src, void *dst)
{

@ -25,120 +25,120 @@
* Protocols (RFC 1700) TODO: may be deleted due to some double definition
* in sys/net/sixlowpan/include/sixlowpan/ip.h
*/
#define IPPROTO_IP (0) ///< dummy for IP
#define IPPROTO_HOPOPTS (0) ///< IP6 hop-by-hop options
#define IPPROTO_ICMP (1) ///< control message protocol
#define IPPROTO_IGMP (2) ///< group mgmt protocol
#define IPPROTO_GGP (3) ///< gateway^2 (deprecated)
#define IPPROTO_IPV4 (4) ///< IPv4 encapsulation
#define IPPROTO_IP (0) ///< dummy for IP
#define IPPROTO_HOPOPTS (0) ///< IP6 hop-by-hop options
#define IPPROTO_ICMP (1) ///< control message protocol
#define IPPROTO_IGMP (2) ///< group mgmt protocol
#define IPPROTO_GGP (3) ///< gateway^2 (deprecated)
#define IPPROTO_IPV4 (4) ///< IPv4 encapsulation
#define IPPROTO_IPIP IPPROTO_IPV4 ///< for compatibility
#define IPPROTO_TCP (6) ///< tcp
#define IPPROTO_ST (7) ///< Stream protocol II
#define IPPROTO_EGP (8) ///< exterior gateway protocol
#define IPPROTO_PIGP (9) ///< private interior gateway
#define IPPROTO_RCCMON (10) ///< BBN RCC Monitoring
#define IPPROTO_NVPII (11) ///< network voice protocol
#define IPPROTO_PUP (12) ///< pup
#define IPPROTO_ARGUS (13) ///< Argus
#define IPPROTO_EMCON (14) ///< EMCON
#define IPPROTO_XNET (15) ///< Cross Net Debugger
#define IPPROTO_CHAOS (16) ///< Chaos
#define IPPROTO_UDP (17) ///< user datagram protocol
#define IPPROTO_MUX (18) ///< Multiplexing
#define IPPROTO_MEAS (19) ///< DCN Measurement Subsystems
#define IPPROTO_HMP (20) ///< Host Monitoring
#define IPPROTO_PRM (21) ///< Packet Radio Measurement
#define IPPROTO_IDP (22) ///< xns idp
#define IPPROTO_TRUNK1 (23) ///< Trunk-1
#define IPPROTO_TRUNK2 (24) ///< Trunk-2
#define IPPROTO_LEAF1 (25) ///< Leaf-1
#define IPPROTO_LEAF2 (26) ///< Leaf-2
#define IPPROTO_RDP (27) ///< Reliable Data
#define IPPROTO_IRTP (28) ///< Reliable Transaction
#define IPPROTO_TP (29) ///< tp-4 w/ class negotiation
#define IPPROTO_BLT (30) ///< Bulk Data Transfer
#define IPPROTO_NSP (31) ///< Network Services
#define IPPROTO_INP (32) ///< Merit Internodal
#define IPPROTO_SEP (33) ///< Sequential Exchange
#define IPPROTO_3PC (34) ///< Third Party Connect
#define IPPROTO_IDPR (35) ///< InterDomain Policy Routing
#define IPPROTO_XTP (36) ///< XTP
#define IPPROTO_DDP (37) ///< Datagram Delivery
#define IPPROTO_CMTP (38) ///< Control Message Transport
#define IPPROTO_TPXX (39) ///< TP++ Transport
#define IPPROTO_IL (40) ///< IL transport protocol
#define IPPROTO_IPV6 (41) ///< IP6 header
#define IPPROTO_SDRP (42) ///< Source Demand Routing
#define IPPROTO_ROUTING (43) ///< IP6 routing header
#define IPPROTO_FRAGMENT (44) ///< IP6 fragmentation header
#define IPPROTO_IDRP (45) ///< InterDomain Routing
#define IPPROTO_RSVP (46) ///< resource reservation
#define IPPROTO_GRE (47) ///< General Routing Encap.
#define IPPROTO_MHRP (48) ///< Mobile Host Routing
#define IPPROTO_BHA (49) ///< BHA
#define IPPROTO_ESP (50) ///< IP6 Encap Sec. Payload
#define IPPROTO_AH (51) ///< IP6 Auth Header
#define IPPROTO_INLSP (52) ///< Integ. Net Layer Security
#define IPPROTO_SWIPE (53) ///< IP with encryption
#define IPPROTO_NHRP (54) ///< Next Hop Resolution
#define IPPROTO_TCP (6) ///< tcp
#define IPPROTO_ST (7) ///< Stream protocol II
#define IPPROTO_EGP (8) ///< exterior gateway protocol
#define IPPROTO_PIGP (9) ///< private interior gateway
#define IPPROTO_RCCMON (10) ///< BBN RCC Monitoring
#define IPPROTO_NVPII (11) ///< network voice protocol
#define IPPROTO_PUP (12) ///< pup
#define IPPROTO_ARGUS (13) ///< Argus
#define IPPROTO_EMCON (14) ///< EMCON
#define IPPROTO_XNET (15) ///< Cross Net Debugger
#define IPPROTO_CHAOS (16) ///< Chaos
#define IPPROTO_UDP (17) ///< user datagram protocol
#define IPPROTO_MUX (18) ///< Multiplexing
#define IPPROTO_MEAS (19) ///< DCN Measurement Subsystems
#define IPPROTO_HMP (20) ///< Host Monitoring
#define IPPROTO_PRM (21) ///< Packet Radio Measurement
#define IPPROTO_IDP (22) ///< xns idp
#define IPPROTO_TRUNK1 (23) ///< Trunk-1
#define IPPROTO_TRUNK2 (24) ///< Trunk-2
#define IPPROTO_LEAF1 (25) ///< Leaf-1
#define IPPROTO_LEAF2 (26) ///< Leaf-2
#define IPPROTO_RDP (27) ///< Reliable Data
#define IPPROTO_IRTP (28) ///< Reliable Transaction
#define IPPROTO_TP (29) ///< tp-4 w/ class negotiation
#define IPPROTO_BLT (30) ///< Bulk Data Transfer
#define IPPROTO_NSP (31) ///< Network Services
#define IPPROTO_INP (32) ///< Merit Internodal
#define IPPROTO_SEP (33) ///< Sequential Exchange
#define IPPROTO_3PC (34) ///< Third Party Connect
#define IPPROTO_IDPR (35) ///< InterDomain Policy Routing
#define IPPROTO_XTP (36) ///< XTP
#define IPPROTO_DDP (37) ///< Datagram Delivery
#define IPPROTO_CMTP (38) ///< Control Message Transport
#define IPPROTO_TPXX (39) ///< TP++ Transport
#define IPPROTO_IL (40) ///< IL transport protocol
#define IPPROTO_IPV6 (41) ///< IP6 header
#define IPPROTO_SDRP (42) ///< Source Demand Routing
#define IPPROTO_ROUTING (43) ///< IP6 routing header
#define IPPROTO_FRAGMENT (44) ///< IP6 fragmentation header
#define IPPROTO_IDRP (45) ///< InterDomain Routing
#define IPPROTO_RSVP (46) ///< resource reservation
#define IPPROTO_GRE (47) ///< General Routing Encap.
#define IPPROTO_MHRP (48) ///< Mobile Host Routing
#define IPPROTO_BHA (49) ///< BHA
#define IPPROTO_ESP (50) ///< IP6 Encap Sec. Payload
#define IPPROTO_AH (51) ///< IP6 Auth Header
#define IPPROTO_INLSP (52) ///< Integ. Net Layer Security
#define IPPROTO_SWIPE (53) ///< IP with encryption
#define IPPROTO_NHRP (54) ///< Next Hop Resolution
///< 55-57: Unassigned
#define IPPROTO_ICMPV6 (58) ///< ICMP6
#define IPPROTO_NONE (59) ///< IP6 no next header
#define IPPROTO_DSTOPTS (60) ///< IP6 destination option
#define IPPROTO_AHIP (61) ///< any host internal protocol
#define IPPROTO_CFTP (62) ///< CFTP
#define IPPROTO_HELLO (63) ///< "hello" routing protocol
#define IPPROTO_SATEXPAK (64) ///< SATNET/Backroom EXPAK
#define IPPROTO_KRYPTOLAN (65) ///< Kryptolan
#define IPPROTO_RVD (66) ///< Remote Virtual Disk
#define IPPROTO_IPPC (67) ///< Pluribus Packet Core
#define IPPROTO_ADFS (68) ///< Any distributed FS
#define IPPROTO_SATMON (69) ///< Satnet Monitoring
#define IPPROTO_VISA (70) ///< VISA Protocol
#define IPPROTO_IPCV (71) ///< Packet Core Utility
#define IPPROTO_CPNX (72) ///< Comp. Prot. Net. Executive
#define IPPROTO_CPHB (73) ///< Comp. Prot. HeartBeat
#define IPPROTO_WSN (74) ///< Wang Span Network
#define IPPROTO_PVP (75) ///< Packet Video Protocol
#define IPPROTO_BRSATMON (76) ///< BackRoom SATNET Monitoring
#define IPPROTO_ND (77) ///< Sun net disk proto (temp.)
#define IPPROTO_WBMON (78) ///< WIDEBAND Monitoring
#define IPPROTO_WBEXPAK (79) ///< WIDEBAND EXPAK
#define IPPROTO_EON (80) ///< ISO cnlp
#define IPPROTO_VMTP (81) ///< VMTP
#define IPPROTO_SVMTP (82) ///< Secure VMTP
#define IPPROTO_VINES (83) ///< Banyon VINES
#define IPPROTO_TTP (84) ///< TTP
#define IPPROTO_IGP (85) ///< NSFNET-IGP
#define IPPROTO_DGP (86) ///< dissimilar gateway prot.
#define IPPROTO_TCF (87) ///< TCF
#define IPPROTO_IGRP (88) ///< Cisco/GXS IGRP
#define IPPROTO_OSPFIGP (89) ///< OSPFIGP
#define IPPROTO_SRPC (90) ///< Strite RPC protocol
#define IPPROTO_LARP (91) ///< Locus Address Resoloution
#define IPPROTO_MTP (92) ///< Multicast Transport
#define IPPROTO_AX25 (93) ///< AX.25 Frames
#define IPPROTO_IPEIP (94) ///< IP encapsulated in IP
#define IPPROTO_MICP (95) ///< Mobile Int.ing control
#define IPPROTO_SCCSP (96) ///< Semaphore Comm. security
#define IPPROTO_ETHERIP (97) ///< Ethernet IP encapsulation
#define IPPROTO_ENCAP (98) ///< encapsulation header
#define IPPROTO_APES (99) ///< any private encr. scheme
#define IPPROTO_GMTP (100) ///< GMTP
#define IPPROTO_IPCOMP (108) ///< payload compression (IPComp)
#define IPPROTO_ICMPV6 (58) ///< ICMP6
#define IPPROTO_NONE (59) ///< IP6 no next header
#define IPPROTO_DSTOPTS (60) ///< IP6 destination option
#define IPPROTO_AHIP (61) ///< any host internal protocol
#define IPPROTO_CFTP (62) ///< CFTP
#define IPPROTO_HELLO (63) ///< "hello" routing protocol
#define IPPROTO_SATEXPAK (64) ///< SATNET/Backroom EXPAK
#define IPPROTO_KRYPTOLAN (65) ///< Kryptolan
#define IPPROTO_RVD (66) ///< Remote Virtual Disk
#define IPPROTO_IPPC (67) ///< Pluribus Packet Core
#define IPPROTO_ADFS (68) ///< Any distributed FS
#define IPPROTO_SATMON (69) ///< Satnet Monitoring
#define IPPROTO_VISA (70) ///< VISA Protocol
#define IPPROTO_IPCV (71) ///< Packet Core Utility
#define IPPROTO_CPNX (72) ///< Comp. Prot. Net. Executive
#define IPPROTO_CPHB (73) ///< Comp. Prot. HeartBeat
#define IPPROTO_WSN (74) ///< Wang Span Network
#define IPPROTO_PVP (75) ///< Packet Video Protocol
#define IPPROTO_BRSATMON (76) ///< BackRoom SATNET Monitoring
#define IPPROTO_ND (77) ///< Sun net disk proto (temp.)
#define IPPROTO_WBMON (78) ///< WIDEBAND Monitoring
#define IPPROTO_WBEXPAK (79) ///< WIDEBAND EXPAK
#define IPPROTO_EON (80) ///< ISO cnlp
#define IPPROTO_VMTP (81) ///< VMTP
#define IPPROTO_SVMTP (82) ///< Secure VMTP
#define IPPROTO_VINES (83) ///< Banyon VINES
#define IPPROTO_TTP (84) ///< TTP
#define IPPROTO_IGP (85) ///< NSFNET-IGP
#define IPPROTO_DGP (86) ///< dissimilar gateway prot.
#define IPPROTO_TCF (87) ///< TCF
#define IPPROTO_IGRP (88) ///< Cisco/GXS IGRP
#define IPPROTO_OSPFIGP (89) ///< OSPFIGP
#define IPPROTO_SRPC (90) ///< Strite RPC protocol
#define IPPROTO_LARP (91) ///< Locus Address Resoloution
#define IPPROTO_MTP (92) ///< Multicast Transport
#define IPPROTO_AX25 (93) ///< AX.25 Frames
#define IPPROTO_IPEIP (94) ///< IP encapsulated in IP
#define IPPROTO_MICP (95) ///< Mobile Int.ing control
#define IPPROTO_SCCSP (96) ///< Semaphore Comm. security
#define IPPROTO_ETHERIP (97) ///< Ethernet IP encapsulation
#define IPPROTO_ENCAP (98) ///< encapsulation header
#define IPPROTO_APES (99) ///< any private encr. scheme
#define IPPROTO_GMTP (100) ///< GMTP
#define IPPROTO_IPCOMP (108) ///< payload compression (IPComp)
/**
* 101-254: Partly Unassigned
*/
#define IPPROTO_PIM (103) ///< Protocol Independent Mcast
#define IPPROTO_PGM (113) ///< PGM
#define IPPROTO_PIM (103) ///< Protocol Independent Mcast
#define IPPROTO_PGM (113) ///< PGM
/* 255: Reserved */
/* */
#define IPPROTO_DIVERT (254) ///< divert pseudo-protocol (BSD Private, local use, namespace incursion)
#define IPPROTO_RAW (255) ///< raw IP packet
#define IPPROTO_MAX (256)
#define IPPROTO_DIVERT (254) ///< divert pseudo-protocol (BSD Private, local use, namespace incursion)
#define IPPROTO_RAW (255) ///< raw IP packet
#define IPPROTO_MAX (256)
#define IPPROTO_DONE (257) ///< last return value of *_input(), meaning "all job for this pkt is done".
#define IPPROTO_DONE (257) ///< last return value of *_input(), meaning "all job for this pkt is done".
#define IN_LOOPBACKNET (127) ///< official!
#define IN_LOOPBACKNET (127) ///< official!
#endif /* DESTINY_IN_H */

@ -26,7 +26,7 @@
/**
* TCP packet header length
*/
#define TCP_HDR_LEN 20
#define TCP_HDR_LEN 20
/**
* UDP packet header

@ -37,7 +37,7 @@
* RFC 4944, section 5.1
* </a>
*/
#define SIXLOWPAN_IPV6_DISPATCH (0x41)
#define SIXLOWPAN_IPV6_DISPATCH (0x41)
/**
* @brief 6LoWPAN dispatch value for IPv6 header compression (part of
@ -46,7 +46,7 @@
* RFC 4944, section 3.1.1
* </a>
*/
#define SIXLOWPAN_IPHC1_DISPATCH (0x60)
#define SIXLOWPAN_IPHC1_DISPATCH (0x60)
/**
* @brief Flag for Flow Label elision (part of first byte of
@ -55,7 +55,7 @@
* RFC 6282, section 3.1.1
* </a>
*/
#define SIXLOWPAN_IPHC1_FL_C (0x10)
#define SIXLOWPAN_IPHC1_FL_C (0x10)
/**
* @brief Flag for Traffic Class elision (part of first byte of
@ -64,7 +64,7 @@
* RFC 6282, section 3.1.1
* </a>
*/
#define SIXLOWPAN_IPHC1_TC_C (0x08)
#define SIXLOWPAN_IPHC1_TC_C (0x08)
/**
* @brief Flag for Next Header Compression (part of first byte of
@ -73,7 +73,7 @@
* RFC 6282, section 3.1.1
* </a>
*/
#define SIXLOWPAN_IPHC1_NH (0x04)
#define SIXLOWPAN_IPHC1_NH (0x04)
/**
* @brief Flag for Context Identifier Extention (part of second byte
@ -82,7 +82,7 @@
* RFC 6282, section 3.1.1
* </a>
*/
#define SIXLOWPAN_IPHC2_CID (0x80)
#define SIXLOWPAN_IPHC2_CID (0x80)
/**
* @brief Flag for Source Address Compression (part of second byte
@ -91,7 +91,7 @@
* RFC 6282, section 3.1.1
* </a>
*/
#define SIXLOWPAN_IPHC2_SAC (0x40)
#define SIXLOWPAN_IPHC2_SAC (0x40)
/**
* @brief Bits for Source Address Mode (part of second byte of
@ -100,7 +100,7 @@
* RFC 6282, section 3.1.1
* </a>
*/
#define SIXLOWPAN_IPHC2_SAM (0x30)
#define SIXLOWPAN_IPHC2_SAM (0x30)
/**
* @brief Flag for Destination Address Compression (part of second
@ -109,7 +109,7 @@
* RFC 6282, section 3.1.1
* </a>
*/
#define SIXLOWPAN_IPHC2_DAC (0x04)
#define SIXLOWPAN_IPHC2_DAC (0x04)
/**
* @brief Bits for Destination Address Mode (part of second byte of
@ -118,7 +118,7 @@
* RFC 6282, section 3.1.1
* </a>
*/
#define SIXLOWPAN_IPHC2_DAM (0x03)
#define SIXLOWPAN_IPHC2_DAM (0x03)
/**
* @brief Flag for Multicast Compression (part of second byte of
@ -127,7 +127,7 @@
* RFC 6282, section 3.1.1
* </a>
*/
#define SIXLOWPAN_IPHC2_M (0x08)
#define SIXLOWPAN_IPHC2_M (0x08)
/**
@ -150,12 +150,12 @@
/**
* 6LoWPAN fragmentation header length (first fragment)
*/
#define SIXLOWPAN_FRAG1_HDR_LEN (4)
#define SIXLOWPAN_FRAG1_HDR_LEN (4)
/**
* 6LoWPAN fragmentation header length (subsequent fragment)
*/
#define SIXLOWPAN_FRAGN_HDR_LEN (5)
#define SIXLOWPAN_FRAGN_HDR_LEN (5)
/**
* @brief message type for notification

@ -13,21 +13,21 @@ and Telematics group (http://cst.mi.fu-berlin.de).
*******************************************************************************/
/**
* @addtogroup net_mmstack
* @addtogroup net_mmstack
* @{
*/
/**
* @file
* @internal
* @brief Protocol handler multiplexing
* @brief Protocol handler multiplexing
*
* @author Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
* @author Heiko Will <hwill@inf.fu-berlin.de>
* @author Michael Baar <baar@inf.fu-berlin.de>
* @author Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
* @author Heiko Will <hwill@inf.fu-berlin.de>
* @author Michael Baar <baar@inf.fu-berlin.de>
* @version $Revision: 1938 $
*
* @note $Id: protocol-multiplex.c 1938 2010-03-02 12:14:29Z baar $
* @note $Id: protocol-multiplex.c 1938 2010-03-02 12:14:29Z baar $
*/
#include <stddef.h>

@ -38,61 +38,61 @@
#endif
#include "debug.h"
#define LLHDR_ICMPV6HDR_LEN (LL_HDR_LEN + IPV6_HDR_LEN + ICMPV6_HDR_LEN)
#define ND_HOPLIMIT (0xFF)
#define LLHDR_ICMPV6HDR_LEN (LL_HDR_LEN + IPV6_HDR_LEN + ICMPV6_HDR_LEN)
#define ND_HOPLIMIT (0xFF)
/* parameter problem [rfc4443] */
#define PARA_PROB_LEN (8)
#define PARA_PROB_LEN (8)
/* echo request */
#define ECHO_REQ_LEN (4)
/* echo reply */
#define ECHO_REPL_LEN (4)
/* router solicitation */
#define RTR_SOL_LEN (4)
#define RTR_SOL_INTERVAL (4)
#define RTR_SOL_MAX (3)
#define RTR_SOL_LEN (4)
#define RTR_SOL_INTERVAL (4)
#define RTR_SOL_MAX (3)
/* router advertisment */
#define RTR_ADV_MAX (3)
#define RTR_ADV_MAX_INTERVAL (600)
#define RTR_ADV_LEN (12)
#define RTR_ADV_MAX (3)
#define RTR_ADV_MAX_INTERVAL (600)
#define RTR_ADV_LEN (12)
/* neighbour solicitation */
#define NBR_SOL_LEN (20)
#define NBR_SOL_LEN (20)
/* neighbour advertisement */
#define NBR_ADV_LEN (20)
#define NBR_ADV_LEN (20)
/* stllao option rfc4861 4.6.1 */
#define OPT_STLLAO_MIN_LEN (8)
#define OPT_STLLAO_MAX_LEN (16)
#define OPT_STLLAO_MIN_LEN (8)
#define OPT_STLLAO_MAX_LEN (16)
/* prefix info option rfc 4.6.2 */
#define OPT_PI_LIST_LEN (5) //TODO: initalwert suchen
#define OPT_PI_TYPE (3)
#define OPT_PI_LEN (4)
#define OPT_PI_HDR_LEN (32)
#define OPT_PI_LIST_LEN (5) //TODO: initalwert suchen
#define OPT_PI_TYPE (3)
#define OPT_PI_LEN (4)
#define OPT_PI_HDR_LEN (32)
/* mtu option rfc4861 4.6.4 */
#define OPT_MTU_TYPE (5)
#define OPT_MTU_LEN (1)
#define OPT_MTU_HDR_LEN (8)
#define OPT_MTU_TYPE (5)
#define OPT_MTU_LEN (1)
#define OPT_MTU_HDR_LEN (8)
/* aro - address registration option rfc6775 4.1 */
#define OPT_ARO_TYPE (33)
#define OPT_ARO_LEN (2)
#define OPT_ARO_HDR_LEN (16)
#define OPT_ARO_LTIME (300) /* TODO: geeigneten wert finden */
#define OPT_ARO_TYPE (33)
#define OPT_ARO_LEN (2)
#define OPT_ARO_HDR_LEN (16)
#define OPT_ARO_LTIME (300) /* TODO: geeigneten wert finden */
/* 6lowpan context option */
#define OPT_6CO_TYPE (34)
#define OPT_6CO_MIN_LEN (2)
#define OPT_6CO_MAX_LEN (3)
#define OPT_6CO_HDR_LEN (8)
#define OPT_6CO_LTIME (5) /* TODO geeigneten Wert finden */
#define OPT_6CO_TYPE (34)
#define OPT_6CO_MIN_LEN (2)
#define OPT_6CO_MAX_LEN (3)
#define OPT_6CO_HDR_LEN (8)
#define OPT_6CO_LTIME (5) /* TODO geeigneten Wert finden */
/* authoritative border router option */
#define OPT_ABRO_TYPE (35)
#define OPT_ABRO_LEN (3)
#define OPT_ABRO_HDR_LEN (24)
#define OPT_ABRO_TYPE (35)
#define OPT_ABRO_LEN (3)
#define OPT_ABRO_HDR_LEN (24)
/* authoritive border router cache size */
#define ABR_CACHE_SIZE (2)
#define ABR_CACHE_SIZE (2)
/* neighbor cache size */
#define NBR_CACHE_SIZE (8)
#define NBR_CACHE_LTIME_TEN (20)
#define NBR_CACHE_SIZE (8)
#define NBR_CACHE_LTIME_TEN (20)
/* default router list size */
#define DEF_RTR_LST_SIZE (3) /* geeigneten wert finden */
#define DEF_RTR_LST_SIZE (3) /* geeigneten wert finden */
#define PREFIX_BUF_LEN (NET_IF_MAX * OPT_PI_LIST_LEN)

@ -59,7 +59,7 @@ char addr_str[IPV6_MAX_ADDR_STR_LEN];
#define SIXLOWPAN_MAX_REGISTERED (4)
#define LOWPAN_REAS_BUF_TIMEOUT (15 * 1000 * 1000)
/* TODO: Set back to 3 * 1000 * (1000) */
/* TODO: Set back to 3 * 1000 * (1000) */
#define IPV6_LL_ADDR_LEN (8)
@ -1149,13 +1149,13 @@ uint8_t lowpan_iphc_encoding(int if_id, const uint8_t *dest, int dest_len,
/*uint8_t *ptr;
if (ipv6_buf->nextheader == IPV6_PROTO_NUM_TCP)
{
ptr = get_payload_buf_send(ipv6_ext_hdr_len);
}
{
ptr = get_payload_buf_send(ipv6_ext_hdr_len);
}
else
{
ptr = get_payload_buf(ipv6_ext_hdr_len);
}
{
ptr = get_payload_buf(ipv6_ext_hdr_len);
}
*/
memcpy(&ipv6_hdr_fields[hdr_pos], &ptr[IPV6_HDR_LEN], NTOHS(ipv6_buf->length));

@ -64,22 +64,22 @@
static inline uint8_t RPL_COUNTER_INCREMENT(uint8_t counter)
{
return (counter > RPL_COUNTER_LOWER_REGION ? (counter == RPL_COUNTER_MAX ? counter=0 : ++counter) : (counter == RPL_COUNTER_LOWER_REGION ? counter=0 : ++counter));
return (counter > RPL_COUNTER_LOWER_REGION ? (counter == RPL_COUNTER_MAX ? counter=0 : ++counter) : (counter == RPL_COUNTER_LOWER_REGION ? counter=0 : ++counter));
}
static inline bool RPL_COUNTER_IS_INIT(uint8_t counter)
{
return (counter > RPL_COUNTER_LOWER_REGION);
return (counter > RPL_COUNTER_LOWER_REGION);
}
static inline bool RPL_COUNTER_GREATER_THAN_LOCAL(uint8_t A,uint8_t B)
{
return (((A<B) && (RPL_COUNTER_LOWER_REGION + 1 - B + A < RPL_COUNTER_SEQ_WINDOW)) || ((A > B) && (A-B < RPL_COUNTER_SEQ_WINDOW)));
return (((A<B) && (RPL_COUNTER_LOWER_REGION + 1 - B + A < RPL_COUNTER_SEQ_WINDOW)) || ((A > B) && (A-B < RPL_COUNTER_SEQ_WINDOW)));
}
static inline bool RPL_COUNTER_GREATER_THAN(uint8_t A,uint8_t B)
{
return ((A>RPL_COUNTER_LOWER_REGION) ? ((B > RPL_COUNTER_LOWER_REGION ) ? RPL_COUNTER_GREATER_THAN_LOCAL(A,B) : 0): (( B>RPL_COUNTER_LOWER_REGION ) ? 1: RPL_COUNTER_GREATER_THAN_LOCAL(A,B)));
return ((A>RPL_COUNTER_LOWER_REGION) ? ((B > RPL_COUNTER_LOWER_REGION ) ? RPL_COUNTER_GREATER_THAN_LOCAL(A,B) : 0): (( B>RPL_COUNTER_LOWER_REGION ) ? 1: RPL_COUNTER_GREATER_THAN_LOCAL(A,B)));
}
/* Node Status */

@ -496,7 +496,7 @@ void recv_rpl_DIO_mode(void)
dio_dodag.dio_interval_doubling = rpl_opt_dodag_conf_buf->DIOIntDoubl;
dio_dodag.dio_min = rpl_opt_dodag_conf_buf->DIOIntMin;
dio_dodag.dio_redundancy = rpl_opt_dodag_conf_buf->DIORedun;
dio_dodag.maxrankincrease = rpl_opt_dodag_conf_buf->MaxRankIncrease;
dio_dodag.maxrankincrease = rpl_opt_dodag_conf_buf->MaxRankIncrease;
dio_dodag.minhoprankincrease = rpl_opt_dodag_conf_buf->MinHopRankIncrease;
dio_dodag.default_lifetime = rpl_opt_dodag_conf_buf->default_lifetime;
dio_dodag.lifetime_unit = rpl_opt_dodag_conf_buf->lifetime_unit;

@ -23,12 +23,12 @@
void block_continue_thread(void)
{
// msg_t recv_m;
// recv_m.type = TCP_NOT_DEFINED;
// while (recv_m.type != TCP_CONTINUE)
// {
// net_msg_receive(&recv_m);
// }
// msg_t recv_m;
// recv_m.type = TCP_NOT_DEFINED;
// while (recv_m.type != TCP_CONTINUE)
// {
// net_msg_receive(&recv_m);
// }
}
int net_msg_receive(msg_t *m)

@ -17,22 +17,22 @@
#include <stdint.h>
// Function IDs
#define FID_SIXLOWIP_TCP 0
#define FID_SIXLOWIP_UDP 1
#define FID_TCP_PH 2
#define FID_UDP_PH 3
#define FID_H_PAYLOAD 4
#define FID_SOCKET_RECV 5
#define FID_SOCKET_RECV_FROM 6
#define FID_TCP_SYN_ACK 7
#define FID_SOCKET_CONNECT 8
#define FID_SOCKET_HANDLE_NEW_TCP_CON 9
#define FID_TCP_ACK 10
#define FID_SOCKET_CLOSE 11
#define FID_TCP_CHT 12
#define FID_TCP_SHELL 13
#define FID_SIXLOWIP_TCP 0
#define FID_SIXLOWIP_UDP 1
#define FID_TCP_PH 2
#define FID_UDP_PH 3
#define FID_H_PAYLOAD 4
#define FID_SOCKET_RECV 5
#define FID_SOCKET_RECV_FROM 6
#define FID_TCP_SYN_ACK 7
#define FID_SOCKET_CONNECT 8
#define FID_SOCKET_HANDLE_NEW_TCP_CON 9
#define FID_TCP_ACK 10
#define FID_SOCKET_CLOSE 11
#define FID_TCP_CHT 12
#define FID_TCP_SHELL 13
#define RETURNNOW 4000
#define RETURNNOW 4000
void block_continue_thread(void);
int net_msg_receive(msg_t *m);

@ -35,7 +35,7 @@
#include "socket.h"
#define EPHEMERAL_PORTS 49152
#define EPHEMERAL_PORTS 49152
socket_internal_t sockets[MAX_SOCKETS];
@ -383,9 +383,9 @@ uint16_t get_free_source_port(uint8_t protocol)
void set_socket_address(sockaddr6_t *sockaddr, uint8_t sin6_family,
uint16_t sin6_port, uint32_t sin6_flowinfo, ipv6_addr_t *sin6_addr)
{
sockaddr->sin6_family = sin6_family;
sockaddr->sin6_port = sin6_port;
sockaddr->sin6_flowinfo = sin6_flowinfo;
sockaddr->sin6_family = sin6_family;
sockaddr->sin6_port = sin6_port;
sockaddr->sin6_flowinfo = sin6_flowinfo;
memcpy(&sockaddr->sin6_addr, sin6_addr, 16);
}
@ -461,9 +461,9 @@ int send_tcp(socket_internal_t *current_socket, tcp_hdr_t *current_tcp_packet,
tcp_mss_option_t current_mss_option;
header_length += sizeof(tcp_mss_option_t) / 4;
current_mss_option.kind = TCP_MSS_OPTION;
current_mss_option.len = sizeof(tcp_mss_option_t);
current_mss_option.mss = DESTINY_SOCKET_STATIC_MSS;
current_mss_option.kind = TCP_MSS_OPTION;
current_mss_option.len = sizeof(tcp_mss_option_t);
current_mss_option.mss = DESTINY_SOCKET_STATIC_MSS;
memcpy(((uint8_t *)current_tcp_packet) + TCP_HDR_LEN,
&current_mss_option, sizeof(tcp_mss_option_t));