From 71e5adb2549836cf00151cca3987a32eb99d87a5 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Thu, 15 Jan 2009 22:15:51 +0000 Subject: [PATCH] Moved packet attributes specifications from rimebuf.h to the appropriate protocol header files --- core/net/rime/ipolite.h | 4 +++- core/net/rime/multihop.h | 9 ++++++++- core/net/rime/netflood.h | 7 ++++++- core/net/rime/polite.h | 4 +++- core/net/rime/rimebuf.h | 24 +----------------------- core/net/rime/rmh.h | 8 +++++++- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/core/net/rime/ipolite.h b/core/net/rime/ipolite.h index e98e55c69..8d8fcd1ef 100644 --- a/core/net/rime/ipolite.h +++ b/core/net/rime/ipolite.h @@ -46,7 +46,7 @@ * * This file is part of the Contiki operating system. * - * $Id: ipolite.h,v 1.4 2008/06/26 11:19:22 adamdunkels Exp $ + * $Id: ipolite.h,v 1.5 2009/01/15 22:15:51 adamdunkels Exp $ */ /** @@ -65,6 +65,8 @@ struct ipolite_conn; +#define IPOLITE_ATTRIBUTES IBC_ATTRIBUTES + struct ipolite_callbacks { void (* recv)(struct ipolite_conn *c, rimeaddr_t *from); void (* sent)(struct ipolite_conn *c); diff --git a/core/net/rime/multihop.h b/core/net/rime/multihop.h index 7555d3c13..884353b0d 100644 --- a/core/net/rime/multihop.h +++ b/core/net/rime/multihop.h @@ -48,7 +48,7 @@ * * This file is part of the Contiki operating system. * - * $Id: multihop.h,v 1.1 2008/07/03 22:36:03 adamdunkels Exp $ + * $Id: multihop.h,v 1.2 2009/01/15 22:15:51 adamdunkels Exp $ */ /** @@ -66,6 +66,13 @@ struct multihop_conn; +#define MULTIHOP_ATTRIBUTES { RIMEBUF_ADDR_ESENDER, RIMEBUF_ADDRSIZE }, \ + { RIMEBUF_ADDR_ERECEIVER, RIMEBUF_ADDRSIZE }, \ + { RIMEBUF_ATTR_TTL, RIMEBUF_ATTR_BIT * 5 }, \ + UNICAST_ATTRIBUTES + + + struct multihop_callbacks { void (* recv)(struct multihop_conn *ptr, rimeaddr_t *sender, diff --git a/core/net/rime/netflood.h b/core/net/rime/netflood.h index 53d51e53e..6d1576824 100644 --- a/core/net/rime/netflood.h +++ b/core/net/rime/netflood.h @@ -45,7 +45,7 @@ * * This file is part of the Contiki operating system. * - * $Id: netflood.h,v 1.1 2008/07/03 22:25:22 adamdunkels Exp $ + * $Id: netflood.h,v 1.2 2009/01/15 22:15:51 adamdunkels Exp $ */ /** @@ -65,6 +65,11 @@ struct netflood_conn; +#define NETFLOOD_ATTRIBUTES { RIMEBUF_ADDR_ESENDER, RIMEBUF_ADDRSIZE }, \ + { RIMEBUF_ATTR_HOPS, RIMEBUF_ATTR_BIT * 5 }, \ + { RIMEBUF_ATTR_EPACKET_ID, RIMEBUF_ATTR_BIT * 4 }, \ + IPOLITE_ATTRIBUTES + struct netflood_callbacks { int (* recv)(struct netflood_conn *c, rimeaddr_t *from, rimeaddr_t *originator, uint8_t seqno, uint8_t hops); diff --git a/core/net/rime/polite.h b/core/net/rime/polite.h index d91e639b8..1b8e237c5 100644 --- a/core/net/rime/polite.h +++ b/core/net/rime/polite.h @@ -46,7 +46,7 @@ * * This file is part of the Contiki operating system. * - * $Id: polite.h,v 1.3 2008/02/24 22:05:27 adamdunkels Exp $ + * $Id: polite.h,v 1.4 2009/01/15 22:15:51 adamdunkels Exp $ */ /** @@ -65,6 +65,8 @@ struct polite_conn; +#define POLITE_ATTRIBUTES ABC_ATTRIBUTES + struct polite_callbacks { void (* recv)(struct polite_conn *c); void (* sent)(struct polite_conn *c); diff --git a/core/net/rime/rimebuf.h b/core/net/rime/rimebuf.h index 3c8e23a62..1634e7782 100644 --- a/core/net/rime/rimebuf.h +++ b/core/net/rime/rimebuf.h @@ -40,7 +40,7 @@ * * This file is part of the Contiki operating system. * - * $Id: rimebuf.h,v 1.15 2008/06/30 19:57:10 adamdunkels Exp $ + * $Id: rimebuf.h,v 1.16 2009/01/15 22:15:51 adamdunkels Exp $ */ /** @@ -412,28 +412,6 @@ struct rimebuf_attrlist { uint8_t len; }; -/* XXX The definitions below will be placed the corresponding .h files: */ - -#define RMH_ATTRIBUTES { RIMEBUF_ADDR_ESENDER, RIMEBUF_ADDRSIZE }, \ - { RIMEBUF_ADDR_ERECEIVER, RIMEBUF_ADDRSIZE }, \ - { RIMEBUF_ATTR_TTL, RIMEBUF_ATTR_BIT * 5 }, \ - { RIMEBUF_ATTR_MAX_REXMIT, RIMEBUF_ATTR_BIT * 5 }, \ - RUC_ATTRIBUTES - -#define MH_ATTRIBUTES { RIMEBUF_ADDR_ESENDER, RIMEBUF_ADDRSIZE }, \ - { RIMEBUF_ADDR_ERECEIVER, RIMEBUF_ADDRSIZE }, \ - { RIMEBUF_ATTR_TTL, RIMEBUF_ATTR_BIT * 5 }, \ - UC_ATTRIBUTES - -#define POLITE_ATTRIBUTES ABC_ATTRIBUTES - -#define IPOLITE_ATTRIBUTES IBC_ATTRIBUTES - -#define NF_ATTRIBUTES { RIMEBUF_ADDR_ESENDER, RIMEBUF_ADDRSIZE }, \ - { RIMEBUF_ATTR_HOPS, RIMEBUF_ATTR_BIT * 5 }, \ - { RIMEBUF_ATTR_EPACKET_ID, RIMEBUF_ATTR_BIT * 4 }, \ - IPOLITE_ATTRIBUTES - #endif /* __RIMEBUF_H__ */ /** @} */ /** @} */ diff --git a/core/net/rime/rmh.h b/core/net/rime/rmh.h index 65c764c03..aced4cd6e 100644 --- a/core/net/rime/rmh.h +++ b/core/net/rime/rmh.h @@ -48,7 +48,7 @@ * * This file is part of the Contiki operating system. * - * $Id: rmh.h,v 1.5 2008/07/03 21:52:25 adamdunkels Exp $ + * $Id: rmh.h,v 1.6 2009/01/15 22:15:51 adamdunkels Exp $ */ /** @@ -66,6 +66,12 @@ struct rmh_conn; +#define RMH_ATTRIBUTES { PACKET_ADDR_ESENDER, PACKET_ADDRSIZE }, \ + { PACKET_ADDR_ERECEIVER, PACKET_ADDRSIZE }, \ + { PACKET_ATTR_TTL, PACKET_ATTR_BIT * 5 }, \ + { PACKET_ATTR_MAX_REXMIT, PACKET_ATTR_BIT * 5 }, \ + RUC_ATTRIBUTES + struct rmh_callbacks { void (* recv)(struct rmh_conn *ptr, rimeaddr_t *sender, uint8_t hops); rimeaddr_t *(* forward)(struct rmh_conn *ptr,