diff --git a/sys/include/transceiver.h b/sys/include/transceiver.h index 473058cbc9..80d6e62118 100644 --- a/sys/include/transceiver.h +++ b/sys/include/transceiver.h @@ -131,6 +131,13 @@ enum transceiver_msg_type_t { /* Error messages */ ENOBUFFER, ///< No buffer left + + /* reserve message types for higher layer notifications */ + UPPER_LAYER_1, ///< reserved + UPPER_LAYER_2, ///< reserved + UPPER_LAYER_3, ///< reserved + UPPER_LAYER_4, ///< reserved + UPPER_LAYER_5, ///< reserved }; /** diff --git a/sys/net/include/sixlowpan/ip.h b/sys/net/include/sixlowpan/ip.h index 5799ee627a..8e40f6b056 100644 --- a/sys/net/include/sixlowpan/ip.h +++ b/sys/net/include/sixlowpan/ip.h @@ -60,6 +60,13 @@ */ #define IPV6_PROTO_NUM_IPV6_OPTS (60) +/** + * @brief message type for notification + * + * @see ipv6_register_packet_handler() + */ +#define IPV6_PACKET_RECEIVED (UPPER_LAYER_2) + /** * @brief Get IPv6 send/receive buffer. * diff --git a/sys/net/include/sixlowpan/lowpan.h b/sys/net/include/sixlowpan/lowpan.h index 2edf02174f..c3db5fb873 100644 --- a/sys/net/include/sixlowpan/lowpan.h +++ b/sys/net/include/sixlowpan/lowpan.h @@ -152,6 +152,12 @@ */ #define SIXLOWPAN_FRAGN_HDR_LEN (5) +/** + * @brief message type for notification + * + * @see sixlowpan_lowpan_register() + */ +#define LOWPAN_FRAME_RECEIVED (UPPER_LAYER_1) /** * @brief Data type to configure 6LoWPAN IPv6 header compression. diff --git a/sys/net/sixlowpan/ip.c b/sys/net/sixlowpan/ip.c index 7203e79e22..f47334fb76 100644 --- a/sys/net/sixlowpan/ip.c +++ b/sys/net/sixlowpan/ip.c @@ -304,6 +304,7 @@ void ipv6_process(void) for (i = 0; i < SIXLOWIP_MAX_REGISTERED; i++) { if (sixlowip_reg[i]) { msg_t m_send; + m_send.type = IPV6_PACKET_RECEIVED; m_send.content.ptr = (char *) &ipv6_buf; msg_send(&m_send, sixlowip_reg[i], 1); } diff --git a/sys/net/sixlowpan/lowpan.c b/sys/net/sixlowpan/lowpan.c index c5f536d6b1..c90864ef68 100644 --- a/sys/net/sixlowpan/lowpan.c +++ b/sys/net/sixlowpan/lowpan.c @@ -742,6 +742,7 @@ void lowpan_read(uint8_t *data, uint8_t length, ieee_802154_long_t *s_laddr, for (i = 0; i < SIXLOWPAN_MAX_REGISTERED; i++) { if (sixlowpan_reg[i]) { msg_t m_send; + m_send.type = LOWPAN_FRAME_RECEIVED;; current_frame.length = length; current_frame.data = data; m_send.content.ptr = (char *) ¤t_frame;