From ca5b45e2643fe3151f6a0da79645b7373423d4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20G=C3=BCndo=C4=9Fan?= Date: Thu, 31 Jul 2014 20:51:50 +0200 Subject: [PATCH] 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. --- sys/include/radio/radio.h | 28 +-- sys/include/radio/types.h | 44 ++-- sys/net/ccn_lite/ccnl-core.h | 24 +- sys/net/ccn_lite/ccnl-ext-appserver.c | 2 +- sys/net/ccn_lite/ccnl-ext-frag.c | 12 +- sys/net/ccn_lite/ccnl-ext-mgmt.c | 18 +- sys/net/ccn_lite/ccnl-ext.h | 10 +- sys/net/ccn_lite/ccnl.h | 62 ++--- sys/net/ccn_lite/ccnx.h | 82 +++---- sys/net/crosslayer/net_help/inet_ntop.c | 24 +- sys/net/crosslayer/net_help/inet_pton.c | 34 +-- sys/net/include/destiny/in.h | 212 +++++++++--------- sys/net/include/destiny/types.h | 2 +- sys/net/include/sixlowpan/lowpan.h | 26 +-- .../protocol-multiplex/protocol-multiplex.c | 12 +- sys/net/network_layer/sixlowpan/icmp.c | 72 +++--- sys/net/network_layer/sixlowpan/lowpan.c | 14 +- sys/net/routing/rpl/rpl_config.h | 8 +- sys/net/routing/rpl/rpl_storing.c | 2 +- sys/net/transport_layer/destiny/msg_help.c | 12 +- sys/net/transport_layer/destiny/msg_help.h | 30 +-- sys/net/transport_layer/destiny/socket.c | 18 +- sys/net/transport_layer/destiny/socket.h | 80 +++---- sys/net/transport_layer/destiny/tcp.c | 4 +- sys/net/transport_layer/destiny/tcp_hc.c | 18 +- sys/net/transport_layer/destiny/tcp_hc.h | 6 +- sys/net/transport_layer/destiny/tcp_timer.h | 34 +-- sys/net/transport_layer/destiny/udp.h | 4 +- sys/posix/include/semaphore.h | 4 +- sys/posix/pnet/include/sys/socket.h | 6 +- sys/uart0/uart0.c | 2 +- 31 files changed, 453 insertions(+), 453 deletions(-) diff --git a/sys/include/radio/radio.h b/sys/include/radio/radio.h index e604398bf..0fdf90f32 100644 --- a/sys/include/radio/radio.h +++ b/sys/include/radio/radio.h @@ -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 + * @author baar + * @author Thomas Hillebrandt * @version $Revision: 1961 $ * - * @note $Id$ + * @note $Id$ */ #include @@ -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); diff --git a/sys/include/radio/types.h b/sys/include/radio/types.h index 1fb8ba221..c8db388c0 100644 --- a/sys/include/radio/types.h +++ b/sys/include/radio/types.h @@ -15,13 +15,13 @@ /** * @file - * @brief Common network stack types (of all layers). + * @brief Common network stack types (of all layers). * - * @author Thomas Hillebrandt + * @author Thomas Hillebrandt * @author Oliver Hahm * @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 @@ -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); diff --git a/sys/net/ccn_lite/ccnl-core.h b/sys/net/ccn_lite/ccnl-core.h index 0f2d6c777..329bf62e5 100644 --- a/sys/net/ccn_lite/ccnl-core.h +++ b/sys/net/ccn_lite/ccnl-core.h @@ -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; diff --git a/sys/net/ccn_lite/ccnl-ext-appserver.c b/sys/net/ccn_lite/ccnl-ext-appserver.c index 000029679..9e5285aae 100644 --- a/sys/net/ccn_lite/ccnl-ext-appserver.c +++ b/sys/net/ccn_lite/ccnl-ext-appserver.c @@ -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(); diff --git a/sys/net/ccn_lite/ccnl-ext-frag.c b/sys/net/ccn_lite/ccnl-ext-frag.c index 618e65ad7..db0920064 100644 --- a/sys/net/ccn_lite/ccnl-ext-frag.c +++ b/sys/net/ccn_lite/ccnl-ext-frag.c @@ -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; diff --git a/sys/net/ccn_lite/ccnl-ext-mgmt.c b/sys/net/ccn_lite/ccnl-ext-mgmt.c index 4f24a0ad5..2095ace13 100644 --- a/sys/net/ccn_lite/ccnl-ext-mgmt.c +++ b/sys/net/ccn_lite/ccnl-ext-mgmt.c @@ -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); diff --git a/sys/net/ccn_lite/ccnl-ext.h b/sys/net/ccn_lite/ccnl-ext.h index 481259dba..18fe2bff4 100644 --- a/sys/net/ccn_lite/ccnl-ext.h +++ b/sys/net/ccn_lite/ccnl-ext.h @@ -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); diff --git a/sys/net/ccn_lite/ccnl.h b/sys/net/ccn_lite/ccnl.h index 7a61c9bcc..d6e7476c4 100644 --- a/sys/net/ccn_lite/ccnl.h +++ b/sys/net/ccn_lite/ccnl.h @@ -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" diff --git a/sys/net/ccn_lite/ccnx.h b/sys/net/ccn_lite/ccnx.h index fa8472471..4ba66e12e 100644 --- a/sys/net/ccn_lite/ccnx.h +++ b/sys/net/ccn_lite/ccnx.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 diff --git a/sys/net/crosslayer/net_help/inet_ntop.c b/sys/net/crosslayer/net_help/inet_ntop.c index 4e4d961e9..ebc5b04d6 100644 --- a/sys/net/crosslayer/net_help/inet_ntop.c +++ b/sys/net/crosslayer/net_help/inet_ntop.c @@ -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) { diff --git a/sys/net/crosslayer/net_help/inet_pton.c b/sys/net/crosslayer/net_help/inet_pton.c index a32e3107a..4bb7c16b7 100644 --- a/sys/net/crosslayer/net_help/inet_pton.c +++ b/sys/net/crosslayer/net_help/inet_pton.c @@ -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) { diff --git a/sys/net/include/destiny/in.h b/sys/net/include/destiny/in.h index 5184d674a..6e42f932f 100644 --- a/sys/net/include/destiny/in.h +++ b/sys/net/include/destiny/in.h @@ -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 */ diff --git a/sys/net/include/destiny/types.h b/sys/net/include/destiny/types.h index 1b168e092..d4233211c 100644 --- a/sys/net/include/destiny/types.h +++ b/sys/net/include/destiny/types.h @@ -26,7 +26,7 @@ /** * TCP packet header length */ -#define TCP_HDR_LEN 20 +#define TCP_HDR_LEN 20 /** * UDP packet header diff --git a/sys/net/include/sixlowpan/lowpan.h b/sys/net/include/sixlowpan/lowpan.h index 73bd74dad..ef2f8865f 100644 --- a/sys/net/include/sixlowpan/lowpan.h +++ b/sys/net/include/sixlowpan/lowpan.h @@ -37,7 +37,7 @@ * RFC 4944, section 5.1 * */ -#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 * */ -#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 * */ -#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 * */ -#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 * */ -#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 * */ -#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 * */ -#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 * */ -#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 * */ -#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 * */ -#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 * */ -#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 diff --git a/sys/net/link_layer/protocol-multiplex/protocol-multiplex.c b/sys/net/link_layer/protocol-multiplex/protocol-multiplex.c index b9721cfcf..02d2fe407 100644 --- a/sys/net/link_layer/protocol-multiplex/protocol-multiplex.c +++ b/sys/net/link_layer/protocol-multiplex/protocol-multiplex.c @@ -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 - * @author Heiko Will - * @author Michael Baar + * @author Thomas Hillebrandt + * @author Heiko Will + * @author Michael Baar * @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 diff --git a/sys/net/network_layer/sixlowpan/icmp.c b/sys/net/network_layer/sixlowpan/icmp.c index 0168e6324..465147261 100644 --- a/sys/net/network_layer/sixlowpan/icmp.c +++ b/sys/net/network_layer/sixlowpan/icmp.c @@ -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) diff --git a/sys/net/network_layer/sixlowpan/lowpan.c b/sys/net/network_layer/sixlowpan/lowpan.c index c8bb0a36f..02bc84704 100644 --- a/sys/net/network_layer/sixlowpan/lowpan.c +++ b/sys/net/network_layer/sixlowpan/lowpan.c @@ -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)); diff --git a/sys/net/routing/rpl/rpl_config.h b/sys/net/routing/rpl/rpl_config.h index 5f659145e..2a00786ec 100644 --- a/sys/net/routing/rpl/rpl_config.h +++ b/sys/net/routing/rpl/rpl_config.h @@ -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) && (A-B < RPL_COUNTER_SEQ_WINDOW))); + return (((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 */ diff --git a/sys/net/routing/rpl/rpl_storing.c b/sys/net/routing/rpl/rpl_storing.c index 2dafbca46..2379739af 100644 --- a/sys/net/routing/rpl/rpl_storing.c +++ b/sys/net/routing/rpl/rpl_storing.c @@ -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; diff --git a/sys/net/transport_layer/destiny/msg_help.c b/sys/net/transport_layer/destiny/msg_help.c index 69cdad486..4b27e4f0c 100644 --- a/sys/net/transport_layer/destiny/msg_help.c +++ b/sys/net/transport_layer/destiny/msg_help.c @@ -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) diff --git a/sys/net/transport_layer/destiny/msg_help.h b/sys/net/transport_layer/destiny/msg_help.h index 257f19665..fb5368d8b 100644 --- a/sys/net/transport_layer/destiny/msg_help.h +++ b/sys/net/transport_layer/destiny/msg_help.h @@ -17,22 +17,22 @@ #include // 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); diff --git a/sys/net/transport_layer/destiny/socket.c b/sys/net/transport_layer/destiny/socket.c index 8cb68e653..1a8245dbe 100644 --- a/sys/net/transport_layer/destiny/socket.c +++ b/sys/net/transport_layer/destiny/socket.c @@ -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, ¤t_mss_option, sizeof(tcp_mss_option_t)); } @@ -553,7 +553,7 @@ int destiny_socket_connect(int socket, sockaddr6_t *addr, uint32_t addrlen) /* Fill lcoal TCP socket information */ srand(addr->sin6_port); - current_tcp_socket->tcp_control.rcv_irs = 0; + current_tcp_socket->tcp_control.rcv_irs = 0; mutex_lock(&global_sequence_counter_mutex); current_tcp_socket->tcp_control.send_iss = global_sequence_counter; mutex_unlock(&global_sequence_counter_mutex); @@ -851,7 +851,7 @@ int32_t destiny_socket_send(int s, const void *buf, uint32_t len, int flags) * TODO: If window size > MSS, ACK was valid only for * a few segments, handle retransmit of missing * segments - * break; + * break; * } */ break; } diff --git a/sys/net/transport_layer/destiny/socket.h b/sys/net/transport_layer/destiny/socket.h index 90e715c44..f80cffd74 100644 --- a/sys/net/transport_layer/destiny/socket.h +++ b/sys/net/transport_layer/destiny/socket.h @@ -8,65 +8,65 @@ #include "tcp.h" #include "udp.h" -#define MAX_SOCKETS 5 -// #define MAX_QUEUED_SOCKETS 2 +#define MAX_SOCKETS 5 +// #define MAX_QUEUED_SOCKETS 2 -#define INC_PACKET 0 -#define OUT_PACKET 1 +#define INC_PACKET 0 +#define OUT_PACKET 1 typedef struct __attribute__((packed)) { - uint16_t context_id; - uint32_t seq_rcv; // Last received packet values - uint32_t ack_rcv; - uint16_t wnd_rcv; - uint32_t seq_snd; // Last sent packet values - uint32_t ack_snd; - uint16_t wnd_snd; - uint8_t hc_type; + uint16_t context_id; + uint32_t seq_rcv; // Last received packet values + uint32_t ack_rcv; + uint16_t wnd_rcv; + uint32_t seq_snd; // Last sent packet values + uint32_t ack_snd; + uint16_t wnd_snd; + uint8_t hc_type; } tcp_hc_context_t; typedef struct __attribute__((packed)) { - uint32_t send_una; - uint32_t send_nxt; - uint16_t send_wnd; - uint32_t send_iss; + uint32_t send_una; + uint32_t send_nxt; + uint16_t send_wnd; + uint32_t send_iss; - uint32_t rcv_nxt; - uint16_t rcv_wnd; - uint32_t rcv_irs; + uint32_t rcv_nxt; + uint16_t rcv_wnd; + uint32_t rcv_irs; - timex_t last_packet_time; - uint8_t no_of_retries; - uint16_t mss; + timex_t last_packet_time; + uint8_t no_of_retries; + uint16_t mss; - uint8_t state; + uint8_t state; - double srtt; - double rttvar; - double rto; + double srtt; + double rttvar; + double rto; #ifdef TCP_HC - tcp_hc_context_t tcp_context; + tcp_hc_context_t tcp_context; #endif } tcp_cb_t; typedef struct __attribute__((packed)) { - uint8_t domain; - uint8_t type; - uint8_t protocol; - tcp_cb_t tcp_control; - sockaddr6_t local_address; - sockaddr6_t foreign_address; + uint8_t domain; + uint8_t type; + uint8_t protocol; + tcp_cb_t tcp_control; + sockaddr6_t local_address; + sockaddr6_t foreign_address; } socket_t; typedef struct { - uint8_t socket_id; - uint8_t recv_pid; - uint8_t send_pid; - uint8_t tcp_input_buffer_end; - mutex_t tcp_buffer_mutex; - socket_t socket_values; - uint8_t tcp_input_buffer[DESTINY_SOCKET_MAX_TCP_BUFFER]; + uint8_t socket_id; + uint8_t recv_pid; + uint8_t send_pid; + uint8_t tcp_input_buffer_end; + mutex_t tcp_buffer_mutex; + socket_t socket_values; + uint8_t tcp_input_buffer[DESTINY_SOCKET_MAX_TCP_BUFFER]; } socket_internal_t; extern socket_internal_t sockets[MAX_SOCKETS]; diff --git a/sys/net/transport_layer/destiny/tcp.c b/sys/net/transport_layer/destiny/tcp.c index d8aafce4f..c62ec5873 100644 --- a/sys/net/transport_layer/destiny/tcp.c +++ b/sys/net/transport_layer/destiny/tcp.c @@ -290,7 +290,7 @@ void handle_tcp_no_flags_packet(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header, current_tcp_socket->tcp_control.send_wnd); /* Send packet */ - // block_continue_thread(); + // block_continue_thread(); #ifdef TCP_HC current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER; #endif @@ -298,7 +298,7 @@ void handle_tcp_no_flags_packet(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header, } /* ACK packet probably got lost */ else { - // block_continue_thread(); + // block_continue_thread(); #ifdef TCP_HC current_tcp_socket->tcp_control.tcp_context.hc_type = FULL_HEADER; #endif diff --git a/sys/net/transport_layer/destiny/tcp_hc.c b/sys/net/transport_layer/destiny/tcp_hc.c index c4ca3c4bc..e7e2dbbdc 100644 --- a/sys/net/transport_layer/destiny/tcp_hc.c +++ b/sys/net/transport_layer/destiny/tcp_hc.c @@ -142,7 +142,7 @@ uint16_t compress_tcp_packet(socket_internal_t *current_socket, tcp_hc_header |= 0xD000; /*----------------------------------*/ - /*| Sequence number handling |*/ + /*| Sequence number handling |*/ /*----------------------------------*/ if (full_tcp_header.seq_nr == tcp_context->seq_snd) { /* Nothing to do, Seq = (0|0) */ @@ -185,7 +185,7 @@ uint16_t compress_tcp_packet(socket_internal_t *current_socket, } /*----------------------------------*/ - /*| Acknowledgment number handling |*/ + /*| Acknowledgment number handling |*/ /*----------------------------------*/ if ((IS_TCP_ACK(full_tcp_header.reserved_flags) && (tcp_cb->tcp_context.ack_snd == full_tcp_header.ack_nr))) { @@ -235,7 +235,7 @@ uint16_t compress_tcp_packet(socket_internal_t *current_socket, } /*----------------------------------*/ - /*| Window handling |*/ + /*| Window handling |*/ /*----------------------------------*/ if (full_tcp_header.window == tcp_context->wnd_snd) { /* Nothing to do, Wnd = (0|0) */ @@ -335,7 +335,7 @@ uint16_t compress_tcp_packet(socket_internal_t *current_socket, tcp_hc_header |= 0x9000; /*----------------------------------*/ - /*| Sequence number handling |*/ + /*| Sequence number handling |*/ /*----------------------------------*/ /* Sending uncompressed sequence number */ /* Seq = (1|1) */ @@ -348,7 +348,7 @@ uint16_t compress_tcp_packet(socket_internal_t *current_socket, packet_size += 4; /*----------------------------------*/ - /*| Acknowledgment number handling |*/ + /*| Acknowledgment number handling |*/ /*----------------------------------*/ /* Ack = (1|1) */ tcp_hc_header |= 0x0300; @@ -360,7 +360,7 @@ uint16_t compress_tcp_packet(socket_internal_t *current_socket, packet_size += 4; /*----------------------------------*/ - /*| Window handling |*/ + /*| Window handling |*/ /*----------------------------------*/ /* Wnd = (1|1) */ tcp_hc_header |= 0x00C0; @@ -485,7 +485,7 @@ socket_internal_t *decompress_tcp_packet(ipv6_hdr_t *temp_ipv6_header) ¤t_socket->socket_values.tcp_control.tcp_context; /*----------------------------------*/ - /*| Sequence number handling |*/ + /*| Sequence number handling |*/ /*----------------------------------*/ if (!BITSET(tcp_hc_header, 11) && !BITSET(tcp_hc_header, 10)) { /* Seq = (0|0), sequence number didn't change, copy old value */ @@ -520,7 +520,7 @@ socket_internal_t *decompress_tcp_packet(ipv6_hdr_t *temp_ipv6_header) } /*----------------------------------*/ - /*| Acknowledgment number handling |*/ + /*| Acknowledgment number handling |*/ /*----------------------------------*/ if (!BITSET(tcp_hc_header, 9) && !BITSET(tcp_hc_header, 8)) { /* Ack = (0|0), acknowledgment number didn't change, copy old value */ @@ -560,7 +560,7 @@ socket_internal_t *decompress_tcp_packet(ipv6_hdr_t *temp_ipv6_header) } /*----------------------------------*/ - /*| Window handling |*/ + /*| Window handling |*/ /*----------------------------------*/ if (!BITSET(tcp_hc_header, 7) && !BITSET(tcp_hc_header, 6)) { /* Wnd = (0|0), copy old value */ diff --git a/sys/net/transport_layer/destiny/tcp_hc.h b/sys/net/transport_layer/destiny/tcp_hc.h index 3d89f6802..d3035abac 100644 --- a/sys/net/transport_layer/destiny/tcp_hc.h +++ b/sys/net/transport_layer/destiny/tcp_hc.h @@ -22,9 +22,9 @@ #ifdef TCP_HC -#define FULL_HEADER 1 -#define MOSTLY_COMPRESSED_HEADER 2 -#define COMPRESSED_HEADER 3 +#define FULL_HEADER 1 +#define MOSTLY_COMPRESSED_HEADER 2 +#define COMPRESSED_HEADER 3 void update_tcp_hc_context(bool incoming, socket_internal_t *current_socket, tcp_hdr_t *current_tcp_packet); uint16_t compress_tcp_packet(socket_internal_t *current_socket, uint8_t *current_tcp_packet, ipv6_hdr_t *temp_ipv6_header, uint8_t flags, uint8_t payload_length); diff --git a/sys/net/transport_layer/destiny/tcp_timer.h b/sys/net/transport_layer/destiny/tcp_timer.h index a3d0c83e1..5507fe97e 100644 --- a/sys/net/transport_layer/destiny/tcp_timer.h +++ b/sys/net/transport_layer/destiny/tcp_timer.h @@ -15,23 +15,23 @@ #ifndef TCP_TIMER_H_ #define TCP_TIMER_H_ -#define TCP_TIMER_RESOLUTION 500*1000 - -#define SECOND 1000.0f*1000.0f -#define TCP_TIMER_STACKSIZE KERNEL_CONF_STACKSIZE_DEFAULT -#define TCP_SYN_INITIAL_TIMEOUT 6*SECOND -#define TCP_SYN_TIMEOUT 24*SECOND -#define TCP_MAX_SYN_RETRIES 3 -#define TCP_INITIAL_ACK_TIMEOUT 3.0f*SECOND // still static, should be calculated via RTT -#define TCP_ACK_MAX_TIMEOUT 30*SECOND // TODO: Set back to 90 Seconds - -#define TCP_ALPHA 1.0f/8.0f -#define TCP_BETA 1.0f/4.0f - -#define TCP_NOT_DEFINED 0 -#define TCP_RETRY 1 -#define TCP_TIMEOUT 2 -#define TCP_CONTINUE 3 +#define TCP_TIMER_RESOLUTION 500*1000 + +#define SECOND 1000.0f*1000.0f +#define TCP_TIMER_STACKSIZE KERNEL_CONF_STACKSIZE_DEFAULT +#define TCP_SYN_INITIAL_TIMEOUT 6*SECOND +#define TCP_SYN_TIMEOUT 24*SECOND +#define TCP_MAX_SYN_RETRIES 3 +#define TCP_INITIAL_ACK_TIMEOUT 3.0f*SECOND // still static, should be calculated via RTT +#define TCP_ACK_MAX_TIMEOUT 30*SECOND // TODO: Set back to 90 Seconds + +#define TCP_ALPHA 1.0f/8.0f +#define TCP_BETA 1.0f/4.0f + +#define TCP_NOT_DEFINED 0 +#define TCP_RETRY 1 +#define TCP_TIMEOUT 2 +#define TCP_CONTINUE 3 void *tcp_general_timer(void *); diff --git a/sys/net/transport_layer/destiny/udp.h b/sys/net/transport_layer/destiny/udp.h index 46e544458..7eba5ad30 100644 --- a/sys/net/transport_layer/destiny/udp.h +++ b/sys/net/transport_layer/destiny/udp.h @@ -21,8 +21,8 @@ #include "ipv6.h" #include "destiny/types.h" -#define UDP_STACK_SIZE KERNEL_CONF_STACKSIZE_MAIN -#define UDP_PKT_RECV_BUF_SIZE (64) +#define UDP_STACK_SIZE KERNEL_CONF_STACKSIZE_MAIN +#define UDP_PKT_RECV_BUF_SIZE (64) uint16_t udp_csum(ipv6_hdr_t *ipv6_header, udp_hdr_t *udp_header); void *udp_packet_handler(void *); diff --git a/sys/posix/include/semaphore.h b/sys/posix/include/semaphore.h index a07329b1d..169d7f9b3 100644 --- a/sys/posix/include/semaphore.h +++ b/sys/posix/include/semaphore.h @@ -1,5 +1,5 @@ #ifndef _SEMAPHORE_H -#define _SEMAPHORE_H 1 +#define _SEMAPHORE_H 1 #include @@ -98,4 +98,4 @@ int sem_post(sem_t *sem); */ int sem_getvalue(sem_t *sem, int *sval); -#endif /* semaphore.h */ +#endif /* semaphore.h */ diff --git a/sys/posix/pnet/include/sys/socket.h b/sys/posix/pnet/include/sys/socket.h index a71761e80..33472eb17 100644 --- a/sys/posix/pnet/include/sys/socket.h +++ b/sys/posix/pnet/include/sys/socket.h @@ -25,11 +25,11 @@ #ifdef CPU_NATIVE /* Ignore Linux definitions in native */ -#define _BITS_SOCKADDR_H 1 -#define __SOCKADDR_COMMON(sa_prefix) \ +#define _BITS_SOCKADDR_H 1 +#define __SOCKADDR_COMMON(sa_prefix) \ sa_family_t sa_prefix##family -#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) +#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) #endif #include diff --git a/sys/uart0/uart0.c b/sys/uart0/uart0.c index b7f5bae47..1c2136fe5 100644 --- a/sys/uart0/uart0.c +++ b/sys/uart0/uart0.c @@ -36,7 +36,7 @@ #endif /* increase when ENABLE_DEBUG in chardev_thread is set to 1! */ -#define UART0_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT) +#define UART0_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT) ringbuffer_t uart0_ringbuffer; int uart0_handler_pid;