Merge pull request #1793 from BytesGalore/extern_C_in_headers_sys

sys: add extern "C" to headers
This commit is contained in:
DangNhat Pham-Huu 2014-11-10 08:57:48 +07:00
commit 429162c20f
110 changed files with 886 additions and 2 deletions

View File

@ -32,7 +32,15 @@
#ifndef AUTO_INIT_H #ifndef AUTO_INIT_H
#define AUTO_INIT_H #define AUTO_INIT_H
#ifdef __cplusplus
extern "C" {
#endif
void auto_init(void); void auto_init(void);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* AUTO_INIT_H */ #endif /* AUTO_INIT_H */

View File

@ -127,6 +127,10 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* hashfp_t hash function to use in thee filter * hashfp_t hash function to use in thee filter
*/ */
@ -215,5 +219,9 @@ void bloom_add(bloom_t *bloom, const uint8_t *buf, size_t len);
*/ */
bool bloom_check(bloom_t *bloom, const uint8_t *buf, size_t len); bool bloom_check(bloom_t *bloom, const uint8_t *buf, size_t len);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* _BLOOM_FILTER_H */ #endif /* _BLOOM_FILTER_H */

View File

@ -23,6 +23,10 @@
#include "kernel_types.h" #include "kernel_types.h"
#include "cpu-conf.h" /* To give user access to UART0_BUFSIZE */ #include "cpu-conf.h" /* To give user access to UART0_BUFSIZE */
#ifdef __cplusplus
extern "C" {
#endif
extern kernel_pid_t uart0_handler_pid; extern kernel_pid_t uart0_handler_pid;
void board_uart0_init(void); void board_uart0_init(void);
@ -32,5 +36,9 @@ void uart0_notify_thread(void);
int uart0_readc(void); int uart0_readc(void);
void uart0_putc(int c); void uart0_putc(int c);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* __BOARD_UART0_H */ #endif /* __BOARD_UART0_H */

View File

@ -99,10 +99,15 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#ifndef CBOR_NO_CTIME #ifndef CBOR_NO_CTIME
#include <time.h> #include <time.h>
#endif /* CBOR_NO_CTIME */ #endif /* CBOR_NO_CTIME */
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Struct containing CBOR-encoded data * @brief Struct containing CBOR-encoded data
* *
@ -363,6 +368,10 @@ bool cbor_at_break(const cbor_stream_t *s, size_t offset);
*/ */
bool cbor_at_end(const cbor_stream_t *s, size_t offset); bool cbor_at_end(const cbor_stream_t *s, size_t offset);
#ifdef __cplusplus
}
#endif
#endif #endif
/** @} */ /** @} */

View File

@ -18,7 +18,15 @@
#include "ringbuffer.h" #include "ringbuffer.h"
#ifdef __cplusplus
extern "C" {
#endif
void chardev_loop(ringbuffer_t *rb); void chardev_loop(ringbuffer_t *rb);
void *chardev_thread_entry(void *rb_); void *chardev_thread_entry(void *rb_);
#ifdef __cplusplus
}
#endif
#endif /* __CHARDEV_THREAD_H */ #endif /* __CHARDEV_THREAD_H */

View File

@ -23,6 +23,10 @@
#include <stdint.h> #include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Data-structure describing a RGB color * @brief Data-structure describing a RGB color
*/ */
@ -58,5 +62,9 @@ void color_rgb2hsv(color_rgb_t *rgb, color_hsv_t *hsv);
*/ */
void color_hsv2rgb(color_hsv_t *hsv, color_rgb_t *rgb); void color_hsv2rgb(color_hsv_t *hsv, color_rgb_t *rgb);
#ifdef __cplusplus
}
#endif
#endif /* __COLOR_H */ #endif /* __COLOR_H */
/** @} */ /** @} */

View File

@ -29,6 +29,10 @@
#ifndef THREEDES_H_ #ifndef THREEDES_H_
#define THREEDES_H_ #define THREEDES_H_
#ifdef __cplusplus
extern "C" {
#endif
#define THREEDES_BLOCK_SIZE 8 #define THREEDES_BLOCK_SIZE 8
#define THREEDES_KEY_SIZE PARSEC_KEYSIZE #define THREEDES_KEY_SIZE PARSEC_KEYSIZE
@ -148,5 +152,9 @@ uint8_t tripledes_get_preferred_block_size(void);
*/ */
extern block_cipher_interface_t tripledes_interface; extern block_cipher_interface_t tripledes_interface;
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* THREEDES_H_ */ #endif /* THREEDES_H_ */

View File

@ -29,6 +29,9 @@
#include <stdint.h> #include <stdint.h>
#include "crypto/ciphers.h" #include "crypto/ciphers.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef uint32_t u32; typedef uint32_t u32;
typedef uint16_t u16; typedef uint16_t u16;
@ -138,5 +141,9 @@ uint8_t aes_get_preferred_block_size(void);
*/ */
extern block_cipher_interface_t aes_inerface; extern block_cipher_interface_t aes_inerface;
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* AES_H */ #endif /* AES_H */

View File

@ -31,6 +31,10 @@
#include "crypto/ciphers.h" #include "crypto/ciphers.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MIN(a, b) ( ((a) < (b)) ? (a) : (b)) #define MIN(a, b) ( ((a) < (b)) ? (a) : (b))
#define DBG_CRYPTO 1 #define DBG_CRYPTO 1
@ -204,5 +208,9 @@ int block_cipher_mode_decrypt(CipherModeContext *context,
uint16_t num_bytes, uint16_t num_bytes,
uint8_t *IV); uint8_t *IV);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* CBCMODE_H_ */ #endif /* CBCMODE_H_ */

View File

@ -22,6 +22,10 @@
#ifndef __CIPHERS_H_ #ifndef __CIPHERS_H_
#define __CIPHERS_H_ #define __CIPHERS_H_
#ifdef __cplusplus
extern "C" {
#endif
/* Shared header file for all cipher algorithms */ /* Shared header file for all cipher algorithms */
/* Set the algorithms that should be compiled in here. When these defines /* Set the algorithms that should be compiled in here. When these defines
@ -119,5 +123,9 @@ typedef struct {
#endif #endif
} cipher_mac_context_t; } cipher_mac_context_t;
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* __CIPHERS_H_ */ #endif /* __CIPHERS_H_ */

View File

@ -23,6 +23,9 @@
#ifndef RC5_H_ #ifndef RC5_H_
#define RC5_H_ #define RC5_H_
#ifdef __cplusplus
extern "C" {
#endif
#define RC5_32_P 0xB7E15163L #define RC5_32_P 0xB7E15163L
#define RC5_32_Q 0x9E3779B9L #define RC5_32_Q 0x9E3779B9L
@ -137,5 +140,9 @@ uint8_t rc5_get_preferred_block_size(void);
*/ */
extern block_cipher_interface_t rc5_interface; extern block_cipher_interface_t rc5_interface;
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* RC5_H_ */ #endif /* RC5_H_ */

View File

@ -51,6 +51,10 @@
#include <inttypes.h> #include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
#define SHA256_DIGEST_LENGTH 32 #define SHA256_DIGEST_LENGTH 32
typedef struct { typedef struct {
@ -96,5 +100,9 @@ void sha256_final(unsigned char digest[32], sha256_context_t *ctx);
*/ */
unsigned char *sha256(const unsigned char *d, size_t n, unsigned char *md); unsigned char *sha256(const unsigned char *d, size_t n, unsigned char *md);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* _SHA256_H_ */ #endif /* _SHA256_H_ */

View File

@ -23,6 +23,10 @@
#include "crypto/ciphers.h" #include "crypto/ciphers.h"
#ifdef __cplusplus
extern "C" {
#endif
#define F(addr) /*CRYPTO_TABLE_ACCESS( &SJ_F[addr])*/ (SJ_F[addr]) #define F(addr) /*CRYPTO_TABLE_ACCESS( &SJ_F[addr])*/ (SJ_F[addr])
// G-Permutation: 4 round feistel structure // G-Permutation: 4 round feistel structure
@ -167,5 +171,9 @@ uint8_t skipjack_get_preferred_block_size(void);
*/ */
extern block_cipher_interface_t skipjack_interface; extern block_cipher_interface_t skipjack_interface;
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* SKIPJACK_H_ */ #endif /* SKIPJACK_H_ */

View File

@ -28,6 +28,10 @@
#ifndef TWOFISH_H_ #ifndef TWOFISH_H_
#define TWOFISH_H_ #define TWOFISH_H_
#ifdef __cplusplus
extern "C" {
#endif
#define TWOFISH_BLOCK_SIZE 16 #define TWOFISH_BLOCK_SIZE 16
#define TWOFISH_KEY_SIZE 16 //only alternative is 32! #define TWOFISH_KEY_SIZE 16 //only alternative is 32!
@ -278,5 +282,9 @@ uint8_t twofish_get_preferred_block_size(void);
*/ */
extern block_cipher_interface_t twofish_interface; extern block_cipher_interface_t twofish_interface;
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* TWOFISH_H_ */ #endif /* TWOFISH_H_ */

View File

@ -25,6 +25,10 @@
#include "kernel_types.h" #include "kernel_types.h"
#include "cpu.h" #include "cpu.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* File descriptor table. * File descriptor table.
*/ */
@ -87,4 +91,8 @@ fd_t *fd_get(int fd);
*/ */
void fd_destroy(int fd); void fd_destroy(int fd);
#ifdef __cplusplus
}
#endif
#endif /* FD_H */ #endif /* FD_H */

View File

@ -9,7 +9,15 @@
#ifndef __HASH_STRING_H #ifndef __HASH_STRING_H
#define __HASH_STRING_H #define __HASH_STRING_H
#ifdef __cplusplus
extern "C" {
#endif
unsigned long hash_string(unsigned char *str); unsigned long hash_string(unsigned char *str);
int cmp_string(char *a, char *b); int cmp_string(char *a, char *b);
#ifdef __cplusplus
}
#endif
#endif /* __HASH_STRING_H */ #endif /* __HASH_STRING_H */

View File

@ -25,6 +25,10 @@
#include <stddef.h> #include <stddef.h>
#include <inttypes.h> #include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief djb2_hash * @brief djb2_hash
* *
@ -155,5 +159,9 @@ uint32_t rotating_hash(const uint8_t *buf, size_t len);
*/ */
uint32_t one_at_a_time_hash(const uint8_t *buf, size_t len); uint32_t one_at_a_time_hash(const uint8_t *buf, size_t len);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* __HASHES_H */ #endif /* __HASHES_H */

View File

@ -15,6 +15,10 @@
#include "radio/radio.h" #include "radio/radio.h"
#ifdef __cplusplus
extern "C" {
#endif
void init_payload(void); void init_payload(void);
void ping_init(protocol_t protocol, uint8_t channr, radio_address_t addr); void ping_init(protocol_t protocol, uint8_t channr, radio_address_t addr);
void ping(radio_address_t addr, uint8_t channr); void ping(radio_address_t addr, uint8_t channr);
@ -38,3 +42,7 @@ typedef struct pong {
typedef struct ping_payload { typedef struct ping_payload {
char *payload; char *payload;
} ping_payload; } ping_payload;
#ifdef __cplusplus
}
#endif

View File

@ -38,6 +38,10 @@
#include "ringbuffer.h" #include "ringbuffer.h"
#include "thread.h" #include "thread.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef PIPE_BUF #ifndef PIPE_BUF
# define PIPE_BUF (128) /**< Size of a dynamically malloc'd pipe. */ # define PIPE_BUF (128) /**< Size of a dynamically malloc'd pipe. */
#endif #endif
@ -108,6 +112,10 @@ pipe_t *pipe_malloc(unsigned size);
*/ */
void pipe_free(pipe_t *rp); void pipe_free(pipe_t *rp);
#ifdef __cplusplus
}
#endif
#endif #endif
/** /**
* @} * @}

View File

@ -22,6 +22,10 @@
#include "kernel_types.h" #include "kernel_types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define OPEN 0 #define OPEN 0
#define CLOSE 1 #define CLOSE 1
#define READ 2 #define READ 2
@ -37,5 +41,9 @@ int posix_close(int pid);
int posix_read(int pid, char *buffer, int bufsize); int posix_read(int pid, char *buffer, int bufsize);
int posix_write(int pid, char *buffer, int bufsize); int posix_write(int pid, char *buffer, int bufsize);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* __READ_H */ #endif /* __READ_H */

View File

@ -16,7 +16,15 @@
#ifndef __PS_H #ifndef __PS_H
#define __PS_H #define __PS_H
#ifdef __cplusplus
extern "C" {
#endif
void thread_print_all(void); void thread_print_all(void);
void _ps_handler(int argc, char **argv); void _ps_handler(int argc, char **argv);
#ifdef __cplusplus
}
#endif
#endif /* __PS_H */ #endif /* __PS_H */

View File

@ -37,6 +37,10 @@
#include <stdbool.h> #include <stdbool.h>
#include "radio/types.h" #include "radio/types.h"
#ifdef __cplusplus
extern "C" {
#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 { enum layer_1_protocols {
@ -72,6 +76,10 @@ typedef struct {
void (*print_config)(void); void (*print_config)(void);
} radio_t; } radio_t;
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* RADIO_H_ */ #endif /* RADIO_H_ */

View File

@ -30,6 +30,10 @@
#include "board.h" #include "board.h"
#include "timex.h" #include "timex.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef uint8_t protocol_t; ///< Packet protocol type typedef uint8_t protocol_t; ///< Packet protocol type
typedef uint16_t radio_address_t; ///< Radio layer address type typedef uint16_t radio_address_t; ///< Radio layer address type
@ -97,4 +101,8 @@ typedef void (*packet_handler_t)(void *payload, int payload_size, packet_info_t
*/ */
typedef void (*packet_monitor_t)(void *payload, int payload_size, protocol_t protocol, packet_info_t *packet_info); typedef void (*packet_monitor_t)(void *payload, int payload_size, protocol_t protocol, packet_info_t *packet_info);
#ifdef __cplusplus
}
#endif
#endif /* COMMONTYPES_H_ */ #endif /* COMMONTYPES_H_ */

View File

@ -15,6 +15,10 @@
#include <inttypes.h> #include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef PRNG_FLOAT #ifndef PRNG_FLOAT
# define PRNG_FLOAT (0) # define PRNG_FLOAT (0)
#endif #endif
@ -72,3 +76,7 @@ double genrand_real_exclusive(void);
double genrand_res53(void); double genrand_res53(void);
#endif /* PRNG_FLOAT */ #endif /* PRNG_FLOAT */
#ifdef __cplusplus
}
#endif

View File

@ -19,6 +19,10 @@
#ifndef __RINGBUFFER_H #ifndef __RINGBUFFER_H
#define __RINGBUFFER_H #define __RINGBUFFER_H
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Ringbuffer. * @brief Ringbuffer.
* @details Non thread-safe FIFO ringbuffer implementation around a `char` array. * @details Non thread-safe FIFO ringbuffer implementation around a `char` array.
@ -146,4 +150,8 @@ int ringbuffer_peek_one(const ringbuffer_t *restrict rb);
*/ */
unsigned ringbuffer_peek(const ringbuffer_t *restrict rb, char *buf, unsigned n); unsigned ringbuffer_peek(const ringbuffer_t *restrict rb, char *buf, unsigned n);
#ifdef __cplusplus
}
#endif
#endif /* __RINGBUFFER_H */ #endif /* __RINGBUFFER_H */

View File

@ -19,6 +19,10 @@
#include "attributes.h" #include "attributes.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Protype of a shell callback handler. * @brief Protype of a shell callback handler.
* @details The functions supplied to shell_init() must use this signature. * @details The functions supplied to shell_init() must use this signature.
@ -84,4 +88,8 @@ void shell_init(shell_t *shell,
*/ */
void shell_run(shell_t *shell) NORETURN; void shell_run(shell_t *shell) NORETURN;
#ifdef __cplusplus
}
#endif
#endif /* __SHELL_H */ #endif /* __SHELL_H */

View File

@ -11,6 +11,10 @@
#include "shell.h" #include "shell.h"
#ifdef __cplusplus
extern "C" {
#endif
#define DISK_GET_SECTOR_SIZE "dget_ssize" #define DISK_GET_SECTOR_SIZE "dget_ssize"
#define DISK_GET_SECTOR_COUNT "dget_scount" #define DISK_GET_SECTOR_COUNT "dget_scount"
#define DISK_GET_BLOCK_SIZE "dget_bsize" #define DISK_GET_BLOCK_SIZE "dget_bsize"
@ -19,4 +23,8 @@
extern const shell_command_t _shell_command_list[]; extern const shell_command_t _shell_command_list[];
#ifdef __cplusplus
}
#endif
#endif /* __SHELL_COMMANDS_H */ #endif /* __SHELL_COMMANDS_H */

View File

@ -25,6 +25,10 @@
#include <stdio.h> #include <stdio.h>
#include <inttypes.h> #include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
// mspgcc bug : PRIxxx macros not defined before mid-2011 versions // mspgcc bug : PRIxxx macros not defined before mid-2011 versions
#ifndef PRIu32 #ifndef PRIu32
#define PRIu32 "lu" #define PRIu32 "lu"
@ -164,5 +168,9 @@ static inline const char *timex_to_str(timex_t t, char *timestamp)
return timestamp; return timestamp;
} }
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* __TIMEX_H */ #endif /* __TIMEX_H */

View File

@ -23,6 +23,10 @@
#include "attributes.h" #include "attributes.h"
#ifdef __cplusplus
extern "C" {
#endif
#define TM_WDAY_SUN (0) /**< Sunday in `struct tm::tm_wday`. */ #define TM_WDAY_SUN (0) /**< Sunday in `struct tm::tm_wday`. */
#define TM_WDAY_MON (1) /**< Monday in `struct tm::tm_wday`. */ #define TM_WDAY_MON (1) /**< Monday in `struct tm::tm_wday`. */
#define TM_WDAY_TUE (2) /**< Tuesday in `struct tm::tm_wday`. */ #define TM_WDAY_TUE (2) /**< Tuesday in `struct tm::tm_wday`. */
@ -110,4 +114,8 @@ int tm_is_valid_date(int year, int mon, int mday) CONST;
*/ */
int tm_is_valid_time(int hour, int min, int sec) CONST; int tm_is_valid_time(int hour, int min, int sec) CONST;
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -77,6 +77,10 @@
#endif #endif
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
/* Stack size for transceiver thread */ /* Stack size for transceiver thread */
#ifndef TRANSCEIVER_STACK_SIZE #ifndef TRANSCEIVER_STACK_SIZE
#define TRANSCEIVER_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT) #define TRANSCEIVER_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
@ -247,5 +251,9 @@ uint8_t transceiver_register(transceiver_type_t transceivers, kernel_pid_t pid);
*/ */
uint8_t transceiver_unregister(transceiver_type_t transceivers, kernel_pid_t pid); uint8_t transceiver_unregister(transceiver_type_t transceivers, kernel_pid_t pid);
#ifdef __cplusplus
}
#endif
#endif /* TRANSCEIVER_H */ #endif /* TRANSCEIVER_H */
/** @} */ /** @} */

View File

@ -28,6 +28,10 @@
#include "timex.h" #include "timex.h"
#include "msg.h" #include "msg.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MSG_TIMER 12345 #define MSG_TIMER 12345
/** /**
@ -138,5 +142,9 @@ void vtimer_print_long_queue(void);
#endif #endif
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* __VTIMER_H */ #endif /* __VTIMER_H */

View File

@ -54,6 +54,10 @@
#include "ccnl.h" #include "ccnl.h"
#ifdef __cplusplus
extern "C" {
#endif
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
typedef union { typedef union {
@ -290,5 +294,9 @@ void free_4ptr_list(void *a, void *b, void *c, void *d);
void free_prefix(struct ccnl_prefix_s *p); void free_prefix(struct ccnl_prefix_s *p);
void free_content(struct ccnl_content_s *c); void free_content(struct ccnl_content_s *c);
#ifdef __cplusplus
}
#endif
#endif /*CCNL_CORE_H__*/ #endif /*CCNL_CORE_H__*/
// eof // eof

View File

@ -26,6 +26,10 @@
#ifndef CCNL_EXT_H__ #ifndef CCNL_EXT_H__
#define CCNL_EXT_H__ #define CCNL_EXT_H__
#ifdef __cplusplus
extern "C" {
#endif
#define compute_ccnx_digest(buf) sha256(buf->data, buf->datalen, NULL) #define compute_ccnx_digest(buf) sha256(buf->data, buf->datalen, NULL)
#ifdef USE_FRAG #ifdef USE_FRAG
@ -93,6 +97,10 @@ ccnl_prefix_clone_strip(struct ccnl_prefix_s *p, int strip);
char *ccnl_prefix_to_path(struct ccnl_prefix_s *pr); char *ccnl_prefix_to_path(struct ccnl_prefix_s *pr);
#ifdef __cplusplus
}
#endif
#endif /* CCNL_EXT_H__ */ #endif /* CCNL_EXT_H__ */
// eof // eof

View File

@ -28,10 +28,18 @@
#include "crypto/sha256.h" #include "crypto/sha256.h"
#ifdef __cplusplus
extern "C" {
#endif
#define RIOT_MSG_DEV (1) #define RIOT_MSG_DEV (1)
#define RIOT_TRANS_DEV (2) #define RIOT_TRANS_DEV (2)
#define RIOT_MSG_IDX (0) #define RIOT_MSG_IDX (0)
#define RIOT_TRANS_IDX (1) #define RIOT_TRANS_IDX (1)
#ifdef __cplusplus
}
#endif
// eof // eof

View File

@ -16,6 +16,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef __cplusplus
extern "C" {
#endif
int dehead(unsigned char **buf, int *len, int *num, int *typ); int dehead(unsigned char **buf, int *len, int *num, int *typ);
int mkHeader(unsigned char *buf, unsigned int num, unsigned int tt); int mkHeader(unsigned char *buf, unsigned int num, unsigned int tt);
int mkBlob(unsigned char *out, unsigned int num, unsigned int tt, char *cp, int cnt); int mkBlob(unsigned char *out, unsigned int num, unsigned int tt, char *cp, int cnt);
@ -26,3 +30,7 @@ int unmkBinaryInt(unsigned char **data, int *datalen, unsigned int *result,
unsigned char *width); unsigned char *width);
int mkInterest(char **namecomp, unsigned int *nonce, unsigned char *out); int mkInterest(char **namecomp, unsigned int *nonce, unsigned char *out);
int mkContent(char **namecomp, char *data, int datalen, unsigned char *out); int mkContent(char **namecomp, char *data, int datalen, unsigned char *out);
#ifdef __cplusplus
}
#endif

View File

@ -20,6 +20,10 @@
#include <sys/time.h> #include <sys/time.h>
#ifdef __cplusplus
extern "C" {
#endif
// (ms) I moved the following struct def here because it is used by all // (ms) I moved the following struct def here because it is used by all
// containers apart from the kernel (this way I don't need to redefine it // containers apart from the kernel (this way I don't need to redefine it
// for omnet. // for omnet.
@ -47,3 +51,7 @@ void
ccnl_rem_timer(void *h); ccnl_rem_timer(void *h);
extern struct ccnl_timer_s *eventqueue; extern struct ccnl_timer_s *eventqueue;
#ifdef __cplusplus
}
#endif

View File

@ -18,6 +18,10 @@
#include "ccn_lite/ccnl-riot.h" #include "ccn_lite/ccnl-riot.h"
#ifdef __cplusplus
extern "C" {
#endif
#define RIOT_CCN_EVENT_NUMBER_OFFSET (1 << 8) #define RIOT_CCN_EVENT_NUMBER_OFFSET (1 << 8)
#define RIOT_BROADCAST (UINT16_MAX) #define RIOT_BROADCAST (UINT16_MAX)
@ -32,3 +36,7 @@ int riot_send_msg(uint8_t *buf, uint16_t size, uint16_t to);
void riot_send_nack(uint16_t to); void riot_send_nack(uint16_t to);
kernel_pid_t riot_start_helper_thread(void); kernel_pid_t riot_start_helper_thread(void);
char *riot_ccnl_event_to_string(int event); char *riot_ccnl_event_to_string(int event);
#ifdef __cplusplus
}
#endif

View File

@ -21,6 +21,10 @@
* 2011-03-30 created * 2011-03-30 created
*/ */
#ifdef __cplusplus
extern "C" {
#endif
#define CCNL_MAX_INTERFACES 2 /* transceiver and msg interfaces */ #define CCNL_MAX_INTERFACES 2 /* transceiver and msg interfaces */
#define CCNL_INTEREST_TIMEOUT_SEC 0 #define CCNL_INTEREST_TIMEOUT_SEC 0
@ -139,4 +143,8 @@
// function alias for RIOTs debug infrastructure // function alias for RIOTs debug infrastructure
#define DEBUGMSG(LVL, ...) DEBUG(__VA_ARGS__) #define DEBUGMSG(LVL, ...) DEBUG(__VA_ARGS__)
#ifdef __cplusplus
}
#endif
// eof // eof

View File

@ -20,6 +20,10 @@
* 2011-03-13 created * 2011-03-13 created
*/ */
#ifdef __cplusplus
extern "C" {
#endif
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
#define CCN_DEFAULT_MTU PAYOAD_SIZE #define CCN_DEFAULT_MTU PAYOAD_SIZE
@ -69,4 +73,8 @@
#define CCN_DTAG_SEQNO 256 #define CCN_DTAG_SEQNO 256
#define CCN_DTAG_CCNPDU 17702112 #define CCN_DTAG_CCNPDU 17702112
#ifdef __cplusplus
}
#endif
// eof // eof

View File

@ -16,7 +16,15 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef __cplusplus
extern "C" {
#endif
int mkNewFaceRequest(unsigned char *out, char *macsrc, char *ip4src, int mkNewFaceRequest(unsigned char *out, char *macsrc, char *ip4src,
char *host, char *port, char *flags); char *host, char *port, char *flags);
int mkPrefixregRequest(unsigned char *out, char reg, char *path, char *faceid); int mkPrefixregRequest(unsigned char *out, char reg, char *path, char *faceid);
#ifdef __cplusplus
}
#endif

View File

@ -38,6 +38,10 @@
#include "transceiver.h" #include "transceiver.h"
#ifdef __cplusplus
extern "C" {
#endif
#define TRANSCEIVER TRANSCEIVER_DEFAULT #define TRANSCEIVER TRANSCEIVER_DEFAULT
#define CCNL_DEFAULT_CHANNEL 6 #define CCNL_DEFAULT_CHANNEL 6
@ -82,6 +86,10 @@ void *ccnl_riot_relay_start(void *arg);
*/ */
void *ccnl_riot_appserver_start(void *arg); void *ccnl_riot_appserver_start(void *arg);
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -16,6 +16,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef __cplusplus
extern "C" {
#endif
#define RIOT_CCNL_POPULATE (1) #define RIOT_CCNL_POPULATE (1)
#if RIOT_CCNL_POPULATE #if RIOT_CCNL_POPULATE
@ -357,3 +361,7 @@ unsigned char text_txt_ccnb_9[] = {
unsigned int text_txt_ccnb_9_len = 118; unsigned int text_txt_ccnb_9_len = 118;
#endif #endif
#ifdef __cplusplus
}
#endif

View File

@ -27,6 +27,10 @@
#ifndef CCNL_RIOT_CLIENT_H #ifndef CCNL_RIOT_CLIENT_H
#define CCNL_RIOT_CLIENT_H #define CCNL_RIOT_CLIENT_H
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief high level function to fetch a file (all chunks of a file) * @brief high level function to fetch a file (all chunks of a file)
* *
@ -103,6 +107,10 @@ int ccnl_riot_client_new_face(kernel_pid_t relay_pid, char *type, char *faceid,
int ccnl_riot_client_register_prefix(kernel_pid_t relay_pid, char *prefix, int ccnl_riot_client_register_prefix(kernel_pid_t relay_pid, char *prefix,
char *faceid, unsigned char *reply_buf); char *faceid, unsigned char *reply_buf);
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -11,6 +11,10 @@
#include <stdint.h> #include <stdint.h>
#include "sixlowpan.h" #include "sixlowpan.h"
#ifdef __cplusplus
extern "C" {
#endif
//[option|length|ipaddr.|packetcount] with up to 15 ipaddr|packetcount pairs //[option|length|ipaddr.|packetcount] with up to 15 ipaddr|packetcount pairs
// 1 Byte 1 Byte 1 Byte 1 Byte // 1 Byte 1 Byte 1 Byte 1 Byte
#define ETX_BUF_SIZE (32) #define ETX_BUF_SIZE (32)
@ -99,4 +103,8 @@ void etx_update(etx_neighbor_t *neighbor);
#define ETX_PKT_HDR_LEN (2) //Option type + Length (1 Byte each) #define ETX_PKT_HDR_LEN (2) //Option type + Length (1 Byte each)
#define ETX_PKT_DATA (2) //Begin of Data Bytes #define ETX_PKT_DATA (2) //Begin of Data Bytes
#ifdef __cplusplus
}
#endif
#endif /* ETX_BEACONING_H_ */ #endif /* ETX_BEACONING_H_ */

View File

@ -25,6 +25,10 @@
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* maximum 802.15.4 header length */ /* maximum 802.15.4 header length */
#define IEEE_802154_MAX_HDR_LEN (23) #define IEEE_802154_MAX_HDR_LEN (23)
/* ...and FCS*/ /* ...and FCS*/
@ -109,5 +113,9 @@ uint8_t ieee802154_frame_read(uint8_t *buf, ieee802154_frame_t *frame, uint8_t l
void ieee802154_frame_print_fcf_frame(ieee802154_frame_t *frame); void ieee802154_frame_print_fcf_frame(ieee802154_frame_t *frame);
uint16_t ieee802154_frame_get_fcs(const uint8_t *frame, uint8_t frame_len); uint16_t ieee802154_frame_get_fcs(const uint8_t *frame, uint8_t frame_len);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* IEEE802154_IEEE802154_FRAME */ #endif /* IEEE802154_IEEE802154_FRAME */

View File

@ -19,6 +19,10 @@
#define INET_NTOP_H_ #define INET_NTOP_H_
#include <stdlib.h> #include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef AF_INET #ifndef AF_INET
#define AF_INET 2 ///< internetwork address family: UDP, TCP, etc. #define AF_INET 2 ///< internetwork address family: UDP, TCP, etc.
#endif #endif
@ -50,4 +54,8 @@
const char *inet_ntop(int af, const void *src, char *dst, size_t size); const char *inet_ntop(int af, const void *src, char *dst, size_t size);
#ifdef __cplusplus
}
#endif
#endif /* INET_NTOP_H_ */ #endif /* INET_NTOP_H_ */

View File

@ -19,6 +19,10 @@
#define INET_PTON_H_ #define INET_PTON_H_
#include <stdlib.h> #include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef AF_INET #ifndef AF_INET
#define AF_INET 2 ///< internetwork address family: UDP, TCP, etc. #define AF_INET 2 ///< internetwork address family: UDP, TCP, etc.
#endif #endif
@ -54,4 +58,8 @@
int inet_pton(int af, const char *src, void *dst); int inet_pton(int af, const char *src, void *dst);
#ifdef __cplusplus
}
#endif
#endif /* INET_PTON_H_ */ #endif /* INET_PTON_H_ */

View File

@ -28,6 +28,14 @@
#include "../network_layer/sixlowpan/icmp.h" /* TODO: remove if not needed anymore */ #include "../network_layer/sixlowpan/icmp.h" /* TODO: remove if not needed anymore */
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* IPV6_H */ #endif /* IPV6_H */
/** /**
* @} * @}

View File

@ -29,6 +29,10 @@
#include "byteorder.h" #include "byteorder.h"
#ifdef __cplusplus
extern "C" {
#endif
#define BITSET(var,pos) ((var) & (1<<(pos))) #define BITSET(var,pos) ((var) & (1<<(pos)))
static inline uint16_t HTONS(uint16_t a) static inline uint16_t HTONS(uint16_t a)
@ -66,5 +70,9 @@ static inline uint64_t NTOHLL(uint64_t a)
uint16_t csum(uint16_t sum, uint8_t *buf, uint16_t len); uint16_t csum(uint16_t sum, uint8_t *buf, uint16_t len);
void printArrayRange(uint8_t *array, uint16_t len, char *str); void printArrayRange(uint8_t *array, uint16_t len, char *str);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* __NET_HELP_H */ #endif /* __NET_HELP_H */

View File

@ -27,6 +27,10 @@
#include "mutex.h" #include "mutex.h"
#include "transceiver.h" #include "transceiver.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief type to specify types of upper layer addresses * @brief type to specify types of upper layer addresses
*/ */
@ -497,6 +501,10 @@ int32_t net_if_get_pan_id(int if_id);
*/ */
int32_t net_if_set_pan_id(int if_id, uint16_t pan_id); int32_t net_if_set_pan_id(int if_id, uint16_t pan_id);
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -31,6 +31,10 @@
#include "cpu-conf.h" #include "cpu-conf.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef PKTBUF_SIZE #ifndef PKTBUF_SIZE
/** /**
* @brief Maximum size of the packet buffer. * @brief Maximum size of the packet buffer.
@ -183,5 +187,9 @@ int pktbuf_contains(const void *pkt);
void pktbuf_reset(void); void pktbuf_reset(void);
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* __PKTBUF_H_ */ #endif /* __PKTBUF_H_ */
/** @} */ /** @} */

View File

@ -26,6 +26,10 @@
#include "priority_queue.h" #include "priority_queue.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief data type for packet queue nodes * @brief data type for packet queue nodes
* *
@ -129,6 +133,10 @@ static inline void pktqueue_remove(pktqueue_t *queue, pktqueue_node_t *node)
priority_queue_remove((priority_queue_t *)queue, (priority_queue_node_t *) node); priority_queue_remove((priority_queue_t *)queue, (priority_queue_node_t *) node);
} }
#ifdef __cplusplus
}
#endif
#endif /* __PKTQUEUE_H_ */ #endif /* __PKTQUEUE_H_ */
/** /**
* @} * @}

View File

@ -26,6 +26,10 @@
#include "radio/types.h" #include "radio/types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct { typedef struct {
packet_handler_t handler; packet_handler_t handler;
protocol_t protocol; protocol_t protocol;
@ -42,5 +46,9 @@ int pm_set_handler(const pm_table_t *table, protocol_t protocol, packet_handler_
void pm_remove_handler(const pm_table_t *table, protocol_t protocol, packet_handler_t handler); void pm_remove_handler(const pm_table_t *table, protocol_t protocol, packet_handler_t handler);
int pm_invoke(const pm_table_t *table, protocol_t protocol, void *payload, int payload_size, packet_info_t *packet_info); int pm_invoke(const pm_table_t *table, protocol_t protocol, void *payload, int payload_size, packet_info_t *packet_info);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* PROTOCOLMULTIPLEX_H_ */ #endif /* PROTOCOLMULTIPLEX_H_ */

View File

@ -35,6 +35,10 @@
#include "ipv6.h" #include "ipv6.h"
#include "rpl/rpl_dodag.h" #include "rpl/rpl_dodag.h"
#ifdef __cplusplus
extern "C" {
#endif
#undef CC1100_RADIO_MODE #undef CC1100_RADIO_MODE
#define CC1100_RADIO_MODE CC1100_MODE_WOR #define CC1100_RADIO_MODE CC1100_MODE_WOR
@ -263,5 +267,9 @@ void rpl_clear_routing_table(void);
* */ * */
rpl_routing_entry_t *rpl_get_routing_table(void); rpl_routing_entry_t *rpl_get_routing_table(void);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* __RPL_H */ #endif /* __RPL_H */

View File

@ -18,6 +18,10 @@
#ifndef RPL_CONFIG_H_INCLUDED #ifndef RPL_CONFIG_H_INCLUDED
#define RPL_CONFIG_H_INCLUDED #define RPL_CONFIG_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
/* Default values */ /* Default values */
#define RPL_NO_DOWNWARD_ROUTES 0x00 #define RPL_NO_DOWNWARD_ROUTES 0x00
#define RPL_NON_STORING_MODE 0x01 #define RPL_NON_STORING_MODE 0x01
@ -133,4 +137,8 @@ static inline bool RPL_COUNTER_GREATER_THAN(uint8_t A,uint8_t B)
#define RPL_GROUNDED_SHIFT 7 #define RPL_GROUNDED_SHIFT 7
#define RPL_DEFAULT_OCP 0 #define RPL_DEFAULT_OCP 0
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -20,6 +20,10 @@
#include "rpl_structs.h" #include "rpl_structs.h"
#include "rpl_config.h" #include "rpl_config.h"
#ifdef __cplusplus
extern "C" {
#endif
void rpl_instances_init(void); void rpl_instances_init(void);
rpl_instance_t *rpl_new_instance(uint8_t instanceid); rpl_instance_t *rpl_new_instance(uint8_t instanceid);
rpl_instance_t *rpl_get_instance(uint8_t instanceid); rpl_instance_t *rpl_get_instance(uint8_t instanceid);
@ -42,3 +46,7 @@ void rpl_parent_update(rpl_parent_t *parent);
void rpl_global_repair(rpl_dodag_t *dodag, ipv6_addr_t *p_addr, uint16_t rank); void rpl_global_repair(rpl_dodag_t *dodag, ipv6_addr_t *p_addr, uint16_t rank);
void rpl_local_repair(void); void rpl_local_repair(void);
uint16_t rpl_calc_rank(uint16_t abs_rank, uint16_t minhoprankincrease); uint16_t rpl_calc_rank(uint16_t abs_rank, uint16_t minhoprankincrease);
#ifdef __cplusplus
}
#endif

View File

@ -30,6 +30,10 @@
#include "rpl_config.h" #include "rpl_config.h"
#include "rpl.h" #include "rpl.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Initialization of RPL-root. * @brief Initialization of RPL-root.
* *
@ -141,5 +145,9 @@ void recv_rpl_dao_ack_mode(void);
*/ */
void rpl_send(ipv6_addr_t *destination, uint8_t *payload, uint16_t p_len, uint8_t next_header); void rpl_send(ipv6_addr_t *destination, uint8_t *payload, uint16_t p_len, uint8_t next_header);
#ifdef __cplusplus
}
#endif
#endif /* __RPL_SM_H */ #endif /* __RPL_SM_H */
/** @} */ /** @} */

View File

@ -20,6 +20,11 @@
#ifndef RPL_STRUCTS_H_INCLUDED #ifndef RPL_STRUCTS_H_INCLUDED
#define RPL_STRUCTS_H_INCLUDED #define RPL_STRUCTS_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
/* Modes of Operation */ /* Modes of Operation */
/* DIO Base Object (RFC 6550 Fig. 14) */ /* DIO Base Object (RFC 6550 Fig. 14) */
@ -179,4 +184,8 @@ typedef struct {
uint8_t used; uint8_t used;
} rpl_routing_entry_t; } rpl_routing_entry_t;
#ifdef __cplusplus
}
#endif
#endif #endif

View File

@ -47,5 +47,13 @@
#include "sixlowpan/lowpan.h" #include "sixlowpan/lowpan.h"
#include "sixlowpan/mac.h" #include "sixlowpan/mac.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* SIXLOWPAN_H */ #endif /* SIXLOWPAN_H */
/** @} */ /** @} */

View File

@ -19,6 +19,10 @@
#ifndef SIXLOWPAN_ERROR_H #ifndef SIXLOWPAN_ERROR_H
#define SIXLOWPAN_ERROR_H #define SIXLOWPAN_ERROR_H
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* Functions return this if call was success. Only defined if not * Functions return this if call was success. Only defined if not
* already defined by other header. * already defined by other header.
@ -95,5 +99,9 @@
*/ */
#define SIXLOWERROR_CSUM (141) #define SIXLOWERROR_CSUM (141)
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* SIXLOWPAN_ERROR_H */ #endif /* SIXLOWPAN_ERROR_H */

View File

@ -30,6 +30,10 @@
#include "sixlowpan/types.h" #include "sixlowpan/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief ICMPv6 packet type for parameter problem message. * @brief ICMPv6 packet type for parameter problem message.
* @see <a href="http://tools.ietf.org/html/rfc4443#section-3.4"> * @see <a href="http://tools.ietf.org/html/rfc4443#section-3.4">
@ -246,5 +250,10 @@ void icmpv6_send_neighbor_adv(ipv6_addr_t *src, ipv6_addr_t *dst,
* @return The internet checksum of the given ICMPv6 packet. * @return The internet checksum of the given ICMPv6 packet.
*/ */
uint16_t icmpv6_csum(ipv6_hdr_t *ipv6_buf, icmpv6_hdr_t *icmpv6_buf); uint16_t icmpv6_csum(ipv6_hdr_t *ipv6_buf, icmpv6_hdr_t *icmpv6_buf);
#ifdef __cplusplus
}
#endif
#endif /* SIXLOWPAN_ICMP_H */ #endif /* SIXLOWPAN_ICMP_H */
/** @} */ /** @} */

View File

@ -31,6 +31,10 @@
#include "net_help.h" #include "net_help.h"
#include "sixlowpan/types.h" #include "sixlowpan/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief IPv6 maximum transmission unit. * @brief IPv6 maximum transmission unit.
*/ */
@ -542,5 +546,9 @@ void ipv6_iface_set_routing_provider(ipv6_addr_t *(*next_hop)(ipv6_addr_t *dest)
*/ */
uint16_t ipv6_csum(ipv6_hdr_t *ipv6_header, uint8_t *buf, uint16_t len, uint8_t proto); uint16_t ipv6_csum(ipv6_hdr_t *ipv6_header, uint8_t *buf, uint16_t len, uint8_t proto);
#ifdef __cplusplus
}
#endif
#endif /* SIXLOWPAN_IP_H */ #endif /* SIXLOWPAN_IP_H */
/** @} */ /** @} */

View File

@ -31,6 +31,10 @@
#include "net_if.h" #include "net_if.h"
#include "sixlowpan/types.h" #include "sixlowpan/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief 6LoWPAN dispatch value for uncompressed IPv6 packets. * @brief 6LoWPAN dispatch value for uncompressed IPv6 packets.
* @see <a href="http://tools.ietf.org/html/rfc4944#section-5.1"> * @see <a href="http://tools.ietf.org/html/rfc4944#section-5.1">
@ -301,5 +305,9 @@ void sixlowpan_lowpan_print_reassembly_buffers(void);
*/ */
int sixlowpan_lowpan_init(void); int sixlowpan_lowpan_init(void);
#ifdef __cplusplus
}
#endif
#endif /* SIXLOWPAN_LOWPAN_H */ #endif /* SIXLOWPAN_LOWPAN_H */
/** @} */ /** @} */

View File

@ -28,6 +28,10 @@
#include "sixlowpan/types.h" #include "sixlowpan/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Maximum length of a IEEE 802.15.4 long address represented as string. * @brief Maximum length of a IEEE 802.15.4 long address represented as string.
*/ */
@ -58,5 +62,9 @@ int sixlowpan_mac_send_ieee802154_frame(int if_id, const void *dest,
*/ */
kernel_pid_t sixlowpan_mac_init(void); kernel_pid_t sixlowpan_mac_init(void);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* SIXLOWPAN_MAC_H */ #endif /* SIXLOWPAN_MAC_H */

View File

@ -30,6 +30,10 @@
#include "timex.h" #include "timex.h"
#include "sixlowpan/types.h" #include "sixlowpan/types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define NDP_6LOWPAN_CONTEXT_MAX (16) #define NDP_6LOWPAN_CONTEXT_MAX (16)
#define NDP_OPT_SLLAO_TYPE (1) #define NDP_OPT_SLLAO_TYPE (1)
@ -227,5 +231,9 @@ ndp_prefix_info_t *ndp_prefix_info_match(int if_id, const ipv6_addr_t *prefix,
ndp_a6br_cache_t *ndp_a6br_cache_get_most_current(void); ndp_a6br_cache_t *ndp_a6br_cache_get_most_current(void);
ndp_a6br_cache_t *ndp_a6br_cache_get_oldest(void); ndp_a6br_cache_t *ndp_a6br_cache_get_oldest(void);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* SIXLOWPAN_NDP_H */ #endif /* SIXLOWPAN_NDP_H */

View File

@ -26,6 +26,10 @@
#include <stdint.h> #include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Data type to represent an EUI-64. * @brief Data type to represent an EUI-64.
*/ */
@ -394,5 +398,9 @@ typedef enum __attribute__((packed)) {
NDP_ADDR_STATE_ANY ///< addresses of this state are always permitted. NDP_ADDR_STATE_ANY ///< addresses of this state are always permitted.
} ndp_addr_state_t; } ndp_addr_state_t;
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* SIXLOWPAN_TYPES_H */ #endif /* SIXLOWPAN_TYPES_H */

View File

@ -37,4 +37,12 @@
#include "socket_base/socket.h" #include "socket_base/socket.h"
#include "socket_base/types.h" #include "socket_base/types.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* SOCKET_BASE_H */ #endif /* SOCKET_BASE_H */

View File

@ -29,6 +29,10 @@
#ifndef SOCKET_BASE_IN_H #ifndef SOCKET_BASE_IN_H
#define SOCKET_BASE_IN_H #define SOCKET_BASE_IN_H
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* Protocols (RFC 1700) TODO: may be deleted due to some double definition * Protocols (RFC 1700) TODO: may be deleted due to some double definition
* in sys/net/sixlowpan/include/sixlowpan/ip.h * in sys/net/sixlowpan/include/sixlowpan/ip.h
@ -149,4 +153,8 @@
#define IN_LOOPBACKNET (127) ///< official! #define IN_LOOPBACKNET (127) ///< official!
#ifdef __cplusplus
}
#endif
#endif /* SOCKET_BASE_IN_H */ #endif /* SOCKET_BASE_IN_H */

View File

@ -28,6 +28,10 @@
#include "socket_base/in.h" #include "socket_base/in.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef uint8_t sa_family_t; ///< POSIX compatible type for address family. typedef uint8_t sa_family_t; ///< POSIX compatible type for address family.
typedef uint32_t socklen_t; ///< POSIX compatible type for address length. typedef uint32_t socklen_t; ///< POSIX compatible type for address length.
@ -327,6 +331,10 @@ int socket_base_accept(int s, sockaddr6_t *addr, socklen_t *addrlen);
*/ */
void socket_base_print_sockets(void); void socket_base_print_sockets(void);
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -18,6 +18,10 @@
#define SOCKET_BASE_TYPES_H_ #define SOCKET_BASE_TYPES_H_
#include <stdint.h> #include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* UDP packet header length * UDP packet header length
*/ */
@ -69,6 +73,10 @@ typedef struct __attribute__((packed)) {
uint16_t urg_pointer; ///< urgent pointer uint16_t urg_pointer; ///< urgent pointer
} tcp_hdr_t; } tcp_hdr_t;
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -30,6 +30,10 @@
#include "socket_base/socket.h" #include "socket_base/socket.h"
#include "socket_base/types.h" #include "socket_base/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* Initializes tcp. * Initializes tcp.
* *
@ -37,4 +41,8 @@
*/ */
int tcp_init_transport_layer(void); int tcp_init_transport_layer(void);
#ifdef __cplusplus
}
#endif
#endif /* TCP_H */ #endif /* TCP_H */

View File

@ -30,6 +30,10 @@
#include "socket_base/socket.h" #include "socket_base/socket.h"
#include "socket_base/types.h" #include "socket_base/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* Initializes udp. * Initializes udp.
* *
@ -37,4 +41,8 @@
*/ */
int udp_init_transport_layer(void); int udp_init_transport_layer(void);
#ifdef __cplusplus
}
#endif
#endif /* UDP_H */ #endif /* UDP_H */

View File

@ -29,6 +29,10 @@
#include "ip.h" #include "ip.h"
#include "semaphore.h" #include "semaphore.h"
#ifdef __cplusplus
extern "C" {
#endif
extern ipv6_addr_t *abr_addr; extern ipv6_addr_t *abr_addr;
kernel_pid_t border_get_serial_reader(void); kernel_pid_t border_get_serial_reader(void);
@ -38,4 +42,8 @@ uint8_t *get_serial_in_buffer(int offset);
void border_process_lowpan(void); void border_process_lowpan(void);
#ifdef __cplusplus
}
#endif
#endif /* _SIXLOWPAN_BORDER_H*/ #endif /* _SIXLOWPAN_BORDER_H*/

View File

@ -24,6 +24,10 @@
#include "ip.h" #include "ip.h"
#ifdef __cplusplus
extern "C" {
#endif
/* packet types of uart-packets */ /* packet types of uart-packets */
#define BORDER_PACKET_RAW_TYPE (0) #define BORDER_PACKET_RAW_TYPE (0)
#define BORDER_PACKET_CONF_TYPE (2) #define BORDER_PACKET_CONF_TYPE (2)
@ -89,4 +93,8 @@ void multiplex_send_addr_over_uart(ipv6_addr_t *addr);
int readpacket(uint8_t *packet_buf, size_t size); int readpacket(uint8_t *packet_buf, size_t size);
int writepacket(uint8_t *packet_buf, size_t size); int writepacket(uint8_t *packet_buf, size_t size);
#ifdef __cplusplus
}
#endif
#endif /* _SIXLOWPAN_BORDERMULTIPLEX_H*/ #endif /* _SIXLOWPAN_BORDERMULTIPLEX_H*/

View File

@ -28,6 +28,10 @@
#include "border.h" #include "border.h"
#include "bordermultiplex.h" #include "bordermultiplex.h"
#ifdef __cplusplus
extern "C" {
#endif
/* packet types for flowcontrol */ /* packet types for flowcontrol */
#define BORDER_PACKET_ACK_TYPE (1) #define BORDER_PACKET_ACK_TYPE (1)
@ -74,4 +78,8 @@ ipv6_addr_t flowcontrol_init(void);
void flowcontrol_send_over_uart(border_packet_t *packet, int len); void flowcontrol_send_over_uart(border_packet_t *packet, int len);
void flowcontrol_deliver_from_uart(border_packet_t *packet, int len); void flowcontrol_deliver_from_uart(border_packet_t *packet, int len);
#ifdef __cplusplus
}
#endif
#endif /* _SIXLOWPAN_FLOWCONTROL_H*/ #endif /* _SIXLOWPAN_FLOWCONTROL_H*/

View File

@ -32,6 +32,10 @@
#include "lowpan.h" #include "lowpan.h"
#include "ip.h" #include "ip.h"
#ifdef __cplusplus
extern "C" {
#endif
enum option_types_t { enum option_types_t {
OPT_SLLAO = 1, OPT_SLLAO = 1,
OPT_TLLAO, OPT_TLLAO,
@ -58,4 +62,9 @@ void nbr_cache_auto_rem(void);
ndp_a6br_cache_t *abr_add_context(uint16_t version, ipv6_addr_t *abr_addr, ndp_a6br_cache_t *abr_add_context(uint16_t version, ipv6_addr_t *abr_addr,
uint8_t cid); uint8_t cid);
void abr_remove_context(uint8_t cid); void abr_remove_context(uint8_t cid);
#ifdef __cplusplus
}
#endif
#endif /* _SIXLOWPAN_ICMP_H*/ #endif /* _SIXLOWPAN_ICMP_H*/

View File

@ -33,6 +33,10 @@
#include "sixlowpan/ip.h" #include "sixlowpan/ip.h"
#include "sixlowpan/types.h" #include "sixlowpan/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* IPv6 field values */ /* IPv6 field values */
#define IPV6_VER (0x60) #define IPV6_VER (0x60)
/* size of global buffer */ /* size of global buffer */
@ -99,4 +103,8 @@ ipv6_net_if_hit_t *ipv6_net_if_addr_match(ipv6_net_if_hit_t *hit, const ipv6_add
uint32_t get_remaining_time(timex_t *t); uint32_t get_remaining_time(timex_t *t);
void set_remaining_time(timex_t *t, uint32_t time); void set_remaining_time(timex_t *t, uint32_t time);
#ifdef __cplusplus
}
#endif
#endif /* _SIXLOWPAN_IP_H*/ #endif /* _SIXLOWPAN_IP_H*/

View File

@ -25,6 +25,10 @@
#include "sixlowpan/lowpan.h" #include "sixlowpan/lowpan.h"
#ifdef __cplusplus
extern "C" {
#endif
#define IEEE802154_TRANSCEIVER (TRANSCEIVER_AT86RF231 | TRANSCEIVER_CC2420 | TRANSCEIVER_MC1322X) #define IEEE802154_TRANSCEIVER (TRANSCEIVER_AT86RF231 | TRANSCEIVER_CC2420 | TRANSCEIVER_MC1322X)
typedef struct { typedef struct {
@ -48,4 +52,8 @@ lowpan_context_t *lowpan_context_update(uint8_t num,
lowpan_context_t *lowpan_context_get(void); lowpan_context_t *lowpan_context_get(void);
lowpan_context_t *lowpan_context_num_lookup(uint8_t num); lowpan_context_t *lowpan_context_num_lookup(uint8_t num);
#ifdef __cplusplus
}
#endif
#endif /* _SIXLOWPAN_LOWPAN_H */ #endif /* _SIXLOWPAN_LOWPAN_H */

View File

@ -14,6 +14,10 @@
#define _SIXLOWPAN_SERIALNUMBER_H #define _SIXLOWPAN_SERIALNUMBER_H
#include <stdint.h> #include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum serial_comp_res_t { typedef enum serial_comp_res_t {
LESS = 0, LESS = 0,
EQUAL = 1, EQUAL = 1,
@ -87,4 +91,8 @@ serial_comp_res_t serial_comp16(uint16_t s1, uint16_t s2);
**/ **/
serial_comp_res_t serial_comp32(uint32_t s1, uint32_t s2); serial_comp_res_t serial_comp32(uint32_t s1, uint32_t s2);
#ifdef __cplusplus
}
#endif
#endif /* _SIXLOWPAN_SERIALNUMBER_H*/ #endif /* _SIXLOWPAN_SERIALNUMBER_H*/

View File

@ -12,6 +12,14 @@
#include "rpl/rpl_structs.h" #include "rpl/rpl_structs.h"
#include "rpl/rpl_config.h" #include "rpl/rpl_config.h"
#ifdef __cplusplus
extern "C" {
#endif
rpl_of_t *rpl_get_of0(void); rpl_of_t *rpl_get_of0(void);
#ifdef __cplusplus
}
#endif
#endif /* OF0_H */ #endif /* OF0_H */

View File

@ -12,6 +12,10 @@
#include "rpl/rpl_structs.h" #include "rpl/rpl_structs.h"
#include "rpl/rpl_config.h" #include "rpl/rpl_config.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* Disallow links with greater than 4 expected * Disallow links with greater than 4 expected
* transmission counts on the selected path. * transmission counts on the selected path.
@ -46,4 +50,8 @@
rpl_of_t *rpl_get_of_mrhof(void); rpl_of_t *rpl_get_of_mrhof(void);
#ifdef __cplusplus
}
#endif
#endif /* OF_MRHOF_H */ #endif /* OF_MRHOF_H */

View File

@ -18,6 +18,10 @@
#include "vtimer.h" #include "vtimer.h"
#include "thread.h" #include "thread.h"
#ifdef __cplusplus
extern "C" {
#endif
#define TRICKLE_TIMER_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN) #define TRICKLE_TIMER_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define TRICKLE_INTERVAL_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN) #define TRICKLE_INTERVAL_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN)
#define DAO_DELAY_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN) #define DAO_DELAY_STACKSIZE (KERNEL_CONF_STACKSIZE_MAIN)
@ -29,3 +33,7 @@ void start_trickle(uint8_t DIOINtMin, uint8_t DIOIntDoubl, uint8_t DIORedundancy
void trickle_increment_counter(void); void trickle_increment_counter(void);
void delay_dao(void); void delay_dao(void);
void dao_ack_received(void); void dao_ack_received(void);
#ifdef __cplusplus
}
#endif

View File

@ -16,6 +16,10 @@
#include <stdint.h> #include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
// Function IDs // Function IDs
#define FID_SIXLOWIP_TCP 0 #define FID_SIXLOWIP_TCP 0
#define FID_SIXLOWIP_UDP 1 #define FID_SIXLOWIP_UDP 1
@ -40,6 +44,10 @@ int socket_base_net_msg_reply(msg_t *m, msg_t *reply, uint16_t message);
int socket_base_net_msg_send(msg_t *m, kernel_pid_t pid, bool block, uint16_t message); int socket_base_net_msg_send(msg_t *m, kernel_pid_t pid, bool block, uint16_t message);
int socket_base_net_msg_send_recv(msg_t *m, msg_t *reply, kernel_pid_t pid, uint16_t message); int socket_base_net_msg_send_recv(msg_t *m, msg_t *reply, kernel_pid_t pid, uint16_t message);
#ifdef __cplusplus
}
#endif
#endif /* MSG_HELP_H_ */ #endif /* MSG_HELP_H_ */
/** /**
* @} * @}

View File

@ -90,10 +90,18 @@ typedef struct {
extern socket_internal_t socket_base_sockets[MAX_SOCKETS]; extern socket_internal_t socket_base_sockets[MAX_SOCKETS];
#ifdef __cplusplus
extern "C" {
#endif
socket_internal_t *socket_base_get_socket(int s); socket_internal_t *socket_base_get_socket(int s);
uint16_t socket_base_get_free_source_port(uint8_t protocol); uint16_t socket_base_get_free_source_port(uint8_t protocol);
int socket_base_exists_socket(int socket); int socket_base_exists_socket(int socket);
int socket_base_socket(int domain, int type, int protocol); int socket_base_socket(int domain, int type, int protocol);
void socket_base_print_sockets(void); void socket_base_print_sockets(void);
#ifdef __cplusplus
}
#endif
#endif /* _SOCKET_BASE_SOCKET */ #endif /* _SOCKET_BASE_SOCKET */

View File

@ -21,6 +21,10 @@
#include "socket_base/types.h" #include "socket_base/types.h"
#include "socket.h" #include "socket.h"
#ifdef __cplusplus
extern "C" {
#endif
#define TCP_EOO_OPTION (0x00) /* End of option list */ #define TCP_EOO_OPTION (0x00) /* End of option list */
#define TCP_NOP_OPTION (0x01) /* No operation */ #define TCP_NOP_OPTION (0x01) /* No operation */
#define TCP_MSS_OPTION (0x02) /* Maximum segment size */ #define TCP_MSS_OPTION (0x02) /* Maximum segment size */
@ -108,6 +112,10 @@ int32_t tcp_recv(int s, void *buf, uint32_t len, int flags);
bool tcp_socket_compliancy(int s); bool tcp_socket_compliancy(int s);
int tcp_teardown(socket_internal_t *current_socket); int tcp_teardown(socket_internal_t *current_socket);
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -20,6 +20,10 @@
#include "tcp.h" #include "tcp.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef TCP_HC #ifdef TCP_HC
#define FULL_HEADER 1 #define FULL_HEADER 1
@ -30,6 +34,11 @@ void update_tcp_hc_context(bool incoming, socket_internal_t *current_socket, tcp
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); 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);
socket_internal_t *decompress_tcp_packet(ipv6_hdr_t *temp_ipv6_header); socket_internal_t *decompress_tcp_packet(ipv6_hdr_t *temp_ipv6_header);
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* TCP_HC_H_ */ #endif /* TCP_HC_H_ */
/** /**
* @} * @}

View File

@ -15,6 +15,10 @@
#ifndef TCP_TIMER_H_ #ifndef TCP_TIMER_H_
#define TCP_TIMER_H_ #define TCP_TIMER_H_
#ifdef __cplusplus
extern "C" {
#endif
#define TCP_TIMER_RESOLUTION 500*1000 #define TCP_TIMER_RESOLUTION 500*1000
#define SECOND 1000.0f*1000.0f #define SECOND 1000.0f*1000.0f
@ -35,6 +39,10 @@
void *tcp_general_timer(void *); void *tcp_general_timer(void *);
#ifdef __cplusplus
}
#endif
#endif /* TCP_TIMER_H_ */ #endif /* TCP_TIMER_H_ */
/** /**
* @} * @}

View File

@ -21,6 +21,10 @@
#include "ipv6.h" #include "ipv6.h"
#include "socket_base/types.h" #include "socket_base/types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define UDP_STACK_SIZE KERNEL_CONF_STACKSIZE_MAIN #define UDP_STACK_SIZE KERNEL_CONF_STACKSIZE_MAIN
#define UDP_PKT_RECV_BUF_SIZE (64) #define UDP_PKT_RECV_BUF_SIZE (64)
@ -31,6 +35,10 @@ bool udp_socket_compliancy(int s);
int32_t udp_recvfrom(int s, void *buf, uint32_t len, int flags, sockaddr6_t *from, uint32_t *fromlen); int32_t udp_recvfrom(int s, void *buf, uint32_t len, int flags, sockaddr6_t *from, uint32_t *fromlen);
int32_t udp_sendto(int s, const void *buf, uint32_t len, int flags, sockaddr6_t *to, socklen_t tolen); int32_t udp_sendto(int s, const void *buf, uint32_t len, int flags, sockaddr6_t *to, socklen_t tolen);
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -28,6 +28,10 @@
#include <stdlib.h> #include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Allocation a block of memory. * @brief Allocation a block of memory.
* @param[in] size Size of the block to allocate in bytes. * @param[in] size Size of the block to allocate in bytes.
@ -65,6 +69,10 @@ void *calloc(int size, size_t cnt);
*/ */
void free(void *ptr); void free(void *ptr);
#ifdef __cplusplus
}
#endif
#endif /* __MALLOC_H */ #endif /* __MALLOC_H */
/** /**

View File

@ -3,11 +3,15 @@
#include <time.h> #include <time.h>
#include "priority_queue.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Value returned if `sem_open' failed. */ /** Value returned if `sem_open' failed. */
#define SEM_FAILED ((sem_t *) 0) #define SEM_FAILED ((sem_t *) 0)
#include "priority_queue.h"
typedef struct sem { typedef struct sem {
volatile unsigned int value; volatile unsigned int value;
priority_queue_t queue; priority_queue_t queue;
@ -98,4 +102,8 @@ int sem_post(sem_t *sem);
*/ */
int sem_getvalue(sem_t *sem, int *sval); int sem_getvalue(sem_t *sem, int *sval);
#ifdef __cplusplus
}
#endif
#endif /* semaphore.h */ #endif /* semaphore.h */

View File

@ -25,6 +25,10 @@
#include <sys/types.h> #include <sys/types.h>
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Returns the position of the first (least significant) bit set in * @brief Returns the position of the first (least significant) bit set in
* integer *i*, or 0 if no bits are set in i. * integer *i*, or 0 if no bits are set in i.
@ -115,4 +119,8 @@ int strncasecmp(const char *s1, const char *s2, size_t n);
*/ */
#define strcasecmp_l(s1, s2, l) strncasecmp(s1, s2, -1) #define strcasecmp_l(s1, s2, l) strncasecmp(s1, s2, -1)
#ifdef __cplusplus
}
#endif
#endif /* STRINGS_H */ #endif /* STRINGS_H */

View File

@ -28,6 +28,10 @@
#include "timex.h" #include "timex.h"
#include "vtimer.h" #include "vtimer.h"
#ifdef __cplusplus
extern "C" {
#endif
#define STDIN_FILENO 0 ///< stdin file descriptor #define STDIN_FILENO 0 ///< stdin file descriptor
#define STDOUT_FILENO 1 ///< stdout file descriptor #define STDOUT_FILENO 1 ///< stdout file descriptor
#define STDERR_FILENO 2 ///< stderr file descriptor #define STDERR_FILENO 2 ///< stderr file descriptor
@ -100,6 +104,10 @@ int usleep(useconds_t useconds);
*/ */
unsigned int sleep(unsigned int seconds); unsigned int sleep(unsigned int seconds);
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -29,6 +29,10 @@
#include "inet_ntop.h" #include "inet_ntop.h"
#include "inet_pton.h" #include "inet_pton.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef uint16_t in_port_t; ///< Internet port type typedef uint16_t in_port_t; ///< Internet port type
typedef uint32_t in_addr_t; ///< IPv4 address type typedef uint32_t in_addr_t; ///< IPv4 address type
@ -94,6 +98,10 @@ struct in_addr {
*/ */
#define ntohs(netshort) NTOHS(netshort) #define ntohs(netshort) NTOHS(netshort)
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -29,6 +29,10 @@
#include "ipv6.h" #include "ipv6.h"
#include "socket_base/socket.h" #include "socket_base/socket.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* IPv4 socket address type. * IPv4 socket address type.
*/ */
@ -151,6 +155,10 @@ extern const struct sockaddr_in6 in6addr_loopback;
*/ */
#define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff) #define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff)
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -38,6 +38,10 @@
#include "socket_base/socket.h" #include "socket_base/socket.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Used to define the socket address. * @brief Used to define the socket address.
*/ */
@ -464,6 +468,10 @@ int setsockopt(int socket, int level, int option_name, const void *option_value,
*/ */
int socket(int domain, int type, int protocol); int socket(int domain, int type, int protocol);
#ifdef __cplusplus
}
#endif
/** /**
* @} * @}
*/ */

View File

@ -32,6 +32,14 @@
#include "pthread_cancellation.h" #include "pthread_cancellation.h"
#include "pthread_cond.h" #include "pthread_cond.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif #endif
/** /**

View File

@ -11,6 +11,10 @@
#include "mutex.h" #include "mutex.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @def PTHREAD_PROCESS_SHARED * @def PTHREAD_PROCESS_SHARED
* @brief Share the structure with child processes (default). * @brief Share the structure with child processes (default).
@ -120,6 +124,10 @@ int pthread_barrierattr_getpshared(const pthread_barrierattr_t *attr, int *pshar
*/ */
int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr, int pshared); int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr, int pshared);
#ifdef __cplusplus
}
#endif
#endif #endif
/** /**

View File

@ -10,6 +10,10 @@
#ifndef __SYS__POSIX__PTHREAD_CANCELLCATION__H #ifndef __SYS__POSIX__PTHREAD_CANCELLCATION__H
#define __SYS__POSIX__PTHREAD_CANCELLCATION__H #define __SYS__POSIX__PTHREAD_CANCELLCATION__H
#ifdef __cplusplus
extern "C" {
#endif
#define PTHREAD_CANCEL_DISABLE 0 #define PTHREAD_CANCEL_DISABLE 0
#define PTHREAD_CANCEL_ENABLE 1 #define PTHREAD_CANCEL_ENABLE 1
@ -50,6 +54,10 @@ int pthread_cancel(pthread_t th);
*/ */
void pthread_testcancel(void); void pthread_testcancel(void);
#ifdef __cplusplus
}
#endif
#endif #endif
/** /**

View File

@ -9,6 +9,10 @@
#ifndef __SYS__POSIX__PTHREAD_CLEANUP__H #ifndef __SYS__POSIX__PTHREAD_CLEANUP__H
#define __SYS__POSIX__PTHREAD_CLEANUP__H #define __SYS__POSIX__PTHREAD_CLEANUP__H
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Internal structure for pthread_cleanup_push() * @brief Internal structure for pthread_cleanup_push()
*/ */
@ -79,6 +83,10 @@ void __pthread_cleanup_pop(__pthread_cleanup_datum_t *datum, int execute);
__pthread_cleanup_pop(&____datum__, ____execute__); \ __pthread_cleanup_pop(&____datum__, ____execute__); \
} while (0) } while (0)
#ifdef __cplusplus
}
#endif
#endif #endif
/** /**

View File

@ -24,6 +24,10 @@
# include "msp430_types.h" # include "msp430_types.h"
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @note condition attributes are currently NOT USED in RIOT condition variables * @note condition attributes are currently NOT USED in RIOT condition variables
*/ */
@ -132,5 +136,9 @@ int pthread_cond_signal(struct pthread_cond_t *cond);
*/ */
int pthread_cond_broadcast(struct pthread_cond_t *cond); int pthread_cond_broadcast(struct pthread_cond_t *cond);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif /* _CONDITION_VARIABLE_H */ #endif /* _CONDITION_VARIABLE_H */

Some files were not shown because too many files have changed in this diff Show More