Made rimeaddr_t pointers const where they should be.

This commit is contained in:
adamdunkels 2009-11-08 19:40:16 +00:00
parent 8c040be133
commit 56218aba3b
32 changed files with 108 additions and 97 deletions

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: announcement.c,v 1.1 2009/02/05 19:32:01 adamdunkels Exp $
* $Id: announcement.c,v 1.2 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -123,7 +123,7 @@ announcement_list(void)
}
/*---------------------------------------------------------------------------*/
void
announcement_heard(rimeaddr_t *from, uint16_t id, uint16_t value)
announcement_heard(const rimeaddr_t *from, uint16_t id, uint16_t value)
{
struct announcement *a;
for(a = list_head(announcements); a != NULL; a = a->next) {

View file

@ -54,7 +54,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: announcement.h,v 1.4 2009/05/26 13:58:53 nvt-se Exp $
* $Id: announcement.h,v 1.5 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -72,7 +72,7 @@
struct announcement;
typedef void (*announcement_callback_t)(struct announcement *a,
rimeaddr_t *from,
const rimeaddr_t *from,
uint16_t id, uint16_t val);
/**
@ -211,7 +211,7 @@ struct announcement *announcement_list(void);
* neighbor has been heard.
*
*/
void announcement_heard(rimeaddr_t *from, uint16_t id, uint16_t value);
void announcement_heard(const rimeaddr_t *from, uint16_t id, uint16_t value);
/**
* \brief Register a listen callback with the announcement module

View file

@ -53,7 +53,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: broadcast.h,v 1.3 2009/03/12 21:58:20 adamdunkels Exp $
* $Id: broadcast.h,v 1.4 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -80,7 +80,7 @@ struct broadcast_conn;
*/
struct broadcast_callbacks {
/** Called when a packet has been received by the broadcast module. */
void (* recv)(struct broadcast_conn *ptr, rimeaddr_t *sender);
void (* recv)(struct broadcast_conn *ptr, const rimeaddr_t *sender);
};
struct broadcast_conn {

View file

@ -36,7 +36,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: collect.c,v 1.28 2009/05/30 19:54:05 nvt-se Exp $
* $Id: collect.c,v 1.29 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -227,7 +227,8 @@ update_rtmetric(struct collect_conn *tc)
}
/*---------------------------------------------------------------------------*/
static void
node_packet_received(struct runicast_conn *c, rimeaddr_t *from, uint8_t seqno)
node_packet_received(struct runicast_conn *c, const rimeaddr_t *from,
uint8_t seqno)
{
struct collect_conn *tc = (struct collect_conn *)
((char *)c - offsetof(struct collect_conn, runicast_conn));
@ -295,7 +296,8 @@ node_packet_received(struct runicast_conn *c, rimeaddr_t *from, uint8_t seqno)
}
/*---------------------------------------------------------------------------*/
static void
node_packet_sent(struct runicast_conn *c, rimeaddr_t *to, uint8_t transmissions)
node_packet_sent(struct runicast_conn *c, const rimeaddr_t *to,
uint8_t transmissions)
{
struct collect_conn *tc = (struct collect_conn *)
((char *)c - offsetof(struct collect_conn, runicast_conn));
@ -318,7 +320,8 @@ node_packet_sent(struct runicast_conn *c, rimeaddr_t *to, uint8_t transmissions)
}
/*---------------------------------------------------------------------------*/
static void
node_packet_timedout(struct runicast_conn *c, rimeaddr_t *to, uint8_t transmissions)
node_packet_timedout(struct runicast_conn *c, const rimeaddr_t *to,
uint8_t transmissions)
{
struct collect_conn *tc = (struct collect_conn *)
((char *)c - offsetof(struct collect_conn, runicast_conn));
@ -339,7 +342,8 @@ node_packet_timedout(struct runicast_conn *c, rimeaddr_t *to, uint8_t transmissi
/*---------------------------------------------------------------------------*/
#if !COLLECT_ANNOUNCEMENTS
static void
adv_received(struct neighbor_discovery_conn *c, rimeaddr_t *from, uint16_t rtmetric)
adv_received(struct neighbor_discovery_conn *c, const rimeaddr_t *from,
uint16_t rtmetric)
{
struct collect_conn *tc = (struct collect_conn *)
((char *)c - offsetof(struct collect_conn, neighbor_discovery_conn));
@ -360,7 +364,7 @@ adv_received(struct neighbor_discovery_conn *c, rimeaddr_t *from, uint16_t rtmet
}
#else
static void
received_announcement(struct announcement *a, rimeaddr_t *from,
received_announcement(struct announcement *a, const rimeaddr_t *from,
uint16_t id, uint16_t value)
{
struct collect_conn *tc = (struct collect_conn *)

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: ipolite.c,v 1.14 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: ipolite.c,v 1.15 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -67,7 +67,7 @@
/*---------------------------------------------------------------------------*/
static void
recv(struct broadcast_conn *broadcast, rimeaddr_t *from)
recv(struct broadcast_conn *broadcast, const rimeaddr_t *from)
{
struct ipolite_conn *c = (struct ipolite_conn *)broadcast;
if(c->q != NULL &&
@ -116,6 +116,7 @@ ipolite_open(struct ipolite_conn *c, uint16_t channel,
{
broadcast_open(&c->c, channel, &broadcast);
c->cb = cb;
PRINTF("ipolite open channel %d\n", channel);
}
/*---------------------------------------------------------------------------*/
void

View file

@ -81,7 +81,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: ipolite.h,v 1.8 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: ipolite.h,v 1.9 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -114,7 +114,7 @@ struct ipolite_callbacks {
/**
* Called when a packet is received on the connection.
*/
void (* recv)(struct ipolite_conn *c, rimeaddr_t *from);
void (* recv)(struct ipolite_conn *c, const rimeaddr_t *from);
/**
* Called when a packet is sent on the connection.

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: mesh.c,v 1.18 2009/09/09 21:10:21 adamdunkels Exp $
* $Id: mesh.c,v 1.19 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -99,7 +99,7 @@ data_packet_forward(struct multihop_conn *multihop,
}
/*---------------------------------------------------------------------------*/
static void
found_route(struct route_discovery_conn *rdc, rimeaddr_t *dest)
found_route(struct route_discovery_conn *rdc, const rimeaddr_t *dest)
{
struct mesh_conn *c = (struct mesh_conn *)
((char *)rdc - offsetof(struct mesh_conn, route_discovery_conn));
@ -138,6 +138,7 @@ void
mesh_open(struct mesh_conn *c, uint16_t channels,
const struct mesh_callbacks *callbacks)
{
route_init();
multihop_open(&c->multihop, channels, &data_callbacks);
route_discovery_open(&c->route_discovery_conn,
CLOCK_SECOND * 2,

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: multihop.c,v 1.6 2009/05/10 21:10:02 adamdunkels Exp $
* $Id: multihop.c,v 1.7 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -66,7 +66,7 @@ static const struct packetbuf_attrlist attributes[] =
/*---------------------------------------------------------------------------*/
void
data_packet_received(struct unicast_conn *uc, rimeaddr_t *from)
data_packet_received(struct unicast_conn *uc, const rimeaddr_t *from)
{
struct multihop_conn *c = (struct multihop_conn *)uc;
rimeaddr_t *nexthop;

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: neighbor-discovery.c,v 1.14 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: neighbor-discovery.c,v 1.15 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -103,7 +103,7 @@ send_adv(void *ptr)
}
/*---------------------------------------------------------------------------*/
static void
adv_packet_received(struct broadcast_conn *ibc, rimeaddr_t *from)
adv_packet_received(struct broadcast_conn *ibc, const rimeaddr_t *from)
{
struct neighbor_discovery_conn *c = (struct neighbor_discovery_conn *)ibc;
struct adv_msg *msg = packetbuf_dataptr();

View file

@ -47,7 +47,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: neighbor-discovery.h,v 1.8 2009/05/30 19:40:39 nvt-se Exp $
* $Id: neighbor-discovery.h,v 1.9 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -67,7 +67,7 @@ struct neighbor_discovery_conn;
struct neighbor_discovery_callbacks {
void (* recv)(struct neighbor_discovery_conn *c,
rimeaddr_t *from, uint16_t val);
const rimeaddr_t *from, uint16_t val);
void (* sent)(struct neighbor_discovery_conn *c);
};

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: neighbor.c,v 1.20 2009/10/22 13:11:20 zhitao Exp $
* $Id: neighbor.c,v 1.21 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -125,7 +125,7 @@ neighbor_init(void)
}
/*---------------------------------------------------------------------------*/
struct neighbor *
neighbor_find(rimeaddr_t *addr)
neighbor_find(const rimeaddr_t *addr)
{
struct neighbor *n;
for(n = list_head(neighbors_list); n != NULL; n = n->next) {
@ -180,7 +180,7 @@ neighbor_etx(struct neighbor *n)
}
/*---------------------------------------------------------------------------*/
void
neighbor_add(rimeaddr_t *addr, uint8_t nrtmetric, uint8_t netx)
neighbor_add(const rimeaddr_t *addr, uint8_t nrtmetric, uint8_t netx)
{
uint16_t rtmetric;
uint16_t etx;
@ -253,7 +253,7 @@ neighbor_add(rimeaddr_t *addr, uint8_t nrtmetric, uint8_t netx)
}
/*---------------------------------------------------------------------------*/
void
neighbor_remove(rimeaddr_t *addr)
neighbor_remove(const rimeaddr_t *addr)
{
struct neighbor *n;

View file

@ -38,7 +38,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: neighbor.h,v 1.11 2008/02/24 22:05:27 adamdunkels Exp $
* $Id: neighbor.h,v 1.12 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -68,12 +68,12 @@ struct neighbor {
void neighbor_init(void);
/*void neighbor_periodic(int max_time);*/
void neighbor_add(rimeaddr_t *addr, uint8_t rtmetric, uint8_t etx);
void neighbor_add(const rimeaddr_t *addr, uint8_t rtmetric, uint8_t etx);
void neighbor_update(struct neighbor *n, uint8_t rtmetric);
void neighbor_update_etx(struct neighbor *n, uint8_t etx);
void neighbor_timedout_etx(struct neighbor *n, uint8_t etx);
void neighbor_remove(rimeaddr_t *addr);
struct neighbor *neighbor_find(rimeaddr_t *addr);
void neighbor_remove(const rimeaddr_t *addr);
struct neighbor *neighbor_find(const rimeaddr_t *addr);
struct neighbor *neighbor_best(void);
void neighbor_set_lifetime(int seconds);

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: netflood.c,v 1.3 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: netflood.c,v 1.4 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -73,7 +73,7 @@ send(struct netflood_conn *c)
}
/*---------------------------------------------------------------------------*/
static void
recv_from_ipolite(struct ipolite_conn *ipolite, rimeaddr_t *from)
recv_from_ipolite(struct ipolite_conn *ipolite, const rimeaddr_t *from)
{
struct netflood_conn *c = (struct netflood_conn *)ipolite;
struct netflood_hdr *hdr = packetbuf_dataptr();

View file

@ -62,7 +62,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: netflood.h,v 1.4 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: netflood.h,v 1.5 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -88,8 +88,8 @@ struct netflood_conn;
IPOLITE_ATTRIBUTES
struct netflood_callbacks {
int (* recv)(struct netflood_conn *c, rimeaddr_t *from,
rimeaddr_t *originator, uint8_t seqno, uint8_t hops);
int (* recv)(struct netflood_conn *c, const rimeaddr_t *from,
const rimeaddr_t *originator, uint8_t seqno, uint8_t hops);
void (* sent)(struct netflood_conn *c);
void (* dropped)(struct netflood_conn *c);
};

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: polite-announcement.c,v 1.5 2009/05/08 08:52:55 adamdunkels Exp $
* $Id: polite-announcement.c,v 1.6 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -115,7 +115,7 @@ send_adv(clock_time_t interval)
}
/*---------------------------------------------------------------------------*/
static void
adv_packet_received(struct ipolite_conn *ipolite, rimeaddr_t *from)
adv_packet_received(struct ipolite_conn *ipolite, const rimeaddr_t *from)
{
struct announcement_msg *adata = packetbuf_dataptr();
int i;

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rmh.c,v 1.9 2009/03/21 20:53:06 nvt-se Exp $
* $Id: rmh.c,v 1.10 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -64,7 +64,7 @@ struct data_hdr {
/*---------------------------------------------------------------------------*/
static void
received(struct runicast_conn *uc, rimeaddr_t *from, uint8_t seqno)
received(struct runicast_conn *uc, const rimeaddr_t *from, uint8_t seqno)
{
struct rmh_conn *c = (struct rmh_conn *)uc;
struct data_hdr *msg = packetbuf_dataptr();
@ -96,13 +96,13 @@ received(struct runicast_conn *uc, rimeaddr_t *from, uint8_t seqno)
}
/*---------------------------------------------------------------------------*/
static void
sent(struct runicast_conn *c, rimeaddr_t *to, uint8_t retransmissions)
sent(struct runicast_conn *c, const rimeaddr_t *to, uint8_t retransmissions)
{
}
/*---------------------------------------------------------------------------*/
static void
timedout(struct runicast_conn *c, rimeaddr_t *to, uint8_t retransmissions)
timedout(struct runicast_conn *c, const rimeaddr_t *to, uint8_t retransmissions)
{
}

View file

@ -53,7 +53,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rmh.h,v 1.7 2009/03/08 21:43:25 adamdunkels Exp $
* $Id: rmh.h,v 1.8 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -80,9 +80,9 @@ struct rmh_conn;
struct rmh_callbacks {
void (* recv)(struct rmh_conn *ptr, rimeaddr_t *sender, uint8_t hops);
rimeaddr_t *(* forward)(struct rmh_conn *ptr,
rimeaddr_t *originator,
rimeaddr_t *dest,
rimeaddr_t *prevhop,
const rimeaddr_t *originator,
const rimeaddr_t *dest,
const rimeaddr_t *prevhop,
uint8_t hops);
};

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: route-discovery.c,v 1.18 2009/10/08 16:30:26 nvt-se Exp $
* $Id: route-discovery.c,v 1.19 2009/11/08 19:40:17 adamdunkels Exp $
*/
/**
@ -102,7 +102,7 @@ send_rreq(struct route_discovery_conn *c, const rimeaddr_t *dest)
}
/*---------------------------------------------------------------------------*/
static void
send_rrep(struct route_discovery_conn *c, rimeaddr_t *dest)
send_rrep(struct route_discovery_conn *c, const rimeaddr_t *dest)
{
struct rrep_hdr *rrepmsg;
struct route_entry *rt;
@ -132,7 +132,8 @@ send_rrep(struct route_discovery_conn *c, rimeaddr_t *dest)
}
/*---------------------------------------------------------------------------*/
static void
insert_route(rimeaddr_t *originator, rimeaddr_t *last_hop, uint8_t hops)
insert_route(const rimeaddr_t *originator, const rimeaddr_t *last_hop,
uint8_t hops)
{
PRINTF("%d.%d: Inserting %d.%d into routing table, next hop %d.%d, hop count %d\n",
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
@ -160,7 +161,7 @@ insert_route(rimeaddr_t *originator, rimeaddr_t *last_hop, uint8_t hops)
}
/*---------------------------------------------------------------------------*/
static void
rrep_packet_received(struct unicast_conn *uc, rimeaddr_t *from)
rrep_packet_received(struct unicast_conn *uc, const rimeaddr_t *from)
{
struct rrep_hdr *msg = packetbuf_dataptr();
struct route_entry *rt;
@ -205,8 +206,8 @@ rrep_packet_received(struct unicast_conn *uc, rimeaddr_t *from)
}
/*---------------------------------------------------------------------------*/
static int
rreq_packet_received(struct netflood_conn *nf, rimeaddr_t *from,
rimeaddr_t *originator, uint8_t seqno, uint8_t hops)
rreq_packet_received(struct netflood_conn *nf, const rimeaddr_t *from,
const rimeaddr_t *originator, uint8_t seqno, uint8_t hops)
{
struct route_msg *msg = packetbuf_dataptr();
struct route_discovery_conn *c = (struct route_discovery_conn *)

View file

@ -45,7 +45,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: route-discovery.h,v 1.9 2009/10/08 16:30:26 nvt-se Exp $
* $Id: route-discovery.h,v 1.10 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -64,7 +64,7 @@
struct route_discovery_conn;
struct route_discovery_callbacks {
void (* new_route)(struct route_discovery_conn *c, rimeaddr_t *to);
void (* new_route)(struct route_discovery_conn *c, const rimeaddr_t *to);
void (* timedout)(struct route_discovery_conn *c);
};

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rucb.c,v 1.10 2009/04/16 14:32:01 fros4943 Exp $
* $Id: rucb.c,v 1.11 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -68,7 +68,7 @@ read_data(struct rucb_conn *c)
}
/*---------------------------------------------------------------------------*/
static void
acked(struct runicast_conn *ruc, rimeaddr_t *to, uint8_t retransmissions)
acked(struct runicast_conn *ruc, const rimeaddr_t *to, uint8_t retransmissions)
{
struct rucb_conn *c = (struct rucb_conn *)ruc;
PRINTF("%d.%d: rucb acked\n",
@ -84,7 +84,7 @@ acked(struct runicast_conn *ruc, rimeaddr_t *to, uint8_t retransmissions)
}
/*---------------------------------------------------------------------------*/
static void
timedout(struct runicast_conn *ruc, rimeaddr_t *to, uint8_t retransmissions)
timedout(struct runicast_conn *ruc, const rimeaddr_t *to, uint8_t retransmissions)
{
struct rucb_conn *c = (struct rucb_conn *)ruc;
PRINTF("%d.%d: rucb timedout\n",
@ -95,7 +95,7 @@ timedout(struct runicast_conn *ruc, rimeaddr_t *to, uint8_t retransmissions)
}
/*---------------------------------------------------------------------------*/
static void
recv(struct runicast_conn *ruc, rimeaddr_t *from, uint8_t seqno)
recv(struct runicast_conn *ruc, const rimeaddr_t *from, uint8_t seqno)
{
struct rucb_conn *c = (struct rucb_conn *)ruc;
@ -155,7 +155,7 @@ rucb_close(struct rucb_conn *c)
}
/*---------------------------------------------------------------------------*/
int
rucb_send(struct rucb_conn *c, rimeaddr_t *receiver)
rucb_send(struct rucb_conn *c, const rimeaddr_t *receiver)
{
c->chunk = 0;
read_data(c);

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rucb.h,v 1.3 2008/07/03 21:52:25 adamdunkels Exp $
* $Id: rucb.h,v 1.4 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -73,7 +73,7 @@ void rucb_open(struct rucb_conn *c, uint16_t channel,
const struct rucb_callbacks *u);
void rucb_close(struct rucb_conn *c);
int rucb_send(struct rucb_conn *c, rimeaddr_t *receiver);
int rucb_send(struct rucb_conn *c, const rimeaddr_t *receiver);
#endif /* __RUCB_H__ */

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rudolph1.c,v 1.12 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: rudolph1.c,v 1.13 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -232,7 +232,7 @@ dropped_ipolite(struct ipolite_conn *ipolite)
}
/*---------------------------------------------------------------------------*/
static void
recv_ipolite(struct ipolite_conn *ipolite, rimeaddr_t *from)
recv_ipolite(struct ipolite_conn *ipolite, const rimeaddr_t *from)
{
struct rudolph1_conn *c = (struct rudolph1_conn *)
((char *)ipolite - offsetof(struct rudolph1_conn, ipolite));
@ -295,7 +295,8 @@ send_next_packet(void *ptr)
c->nacks = 0;
}
/*---------------------------------------------------------------------------*/
static const struct ipolite_callbacks ipolite = { recv_ipolite, sent_ipolite, dropped_ipolite };
static const struct ipolite_callbacks ipolite = { recv_ipolite, sent_ipolite,
dropped_ipolite };
static const struct trickle_callbacks trickle = { recv_trickle };
/*---------------------------------------------------------------------------*/
void

View file

@ -34,7 +34,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: runicast.c,v 1.6 2009/04/06 21:19:34 adamdunkels Exp $
* $Id: runicast.c,v 1.7 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -100,7 +100,7 @@ sent_by_stunicast(struct stunicast_conn *stunicast)
}
/*---------------------------------------------------------------------------*/
static void
recv_from_stunicast(struct stunicast_conn *stunicast, rimeaddr_t *from)
recv_from_stunicast(struct stunicast_conn *stunicast, const rimeaddr_t *from)
{
struct runicast_conn *c = (struct runicast_conn *)stunicast;
/* struct runicast_hdr *hdr = packetbuf_dataptr();*/
@ -182,7 +182,8 @@ recv_from_stunicast(struct stunicast_conn *stunicast, rimeaddr_t *from)
}
}
/*---------------------------------------------------------------------------*/
static const struct stunicast_callbacks runicast = {recv_from_stunicast, sent_by_stunicast};
static const struct stunicast_callbacks runicast = {recv_from_stunicast,
sent_by_stunicast};
/*---------------------------------------------------------------------------*/
void
runicast_open(struct runicast_conn *c, uint16_t channel,
@ -209,7 +210,8 @@ runicast_is_transmitting(struct runicast_conn *c)
}
/*---------------------------------------------------------------------------*/
int
runicast_send(struct runicast_conn *c, rimeaddr_t *receiver, uint8_t max_retransmissions)
runicast_send(struct runicast_conn *c, const rimeaddr_t *receiver,
uint8_t max_retransmissions)
{
if (runicast_is_transmitting(c)) {
PRINTF("%d.%d: runicast: already transmitting\n",

View file

@ -66,7 +66,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: runicast.h,v 1.5 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: runicast.h,v 1.6 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -87,9 +87,9 @@ struct runicast_conn;
{ PACKETBUF_ATTR_PACKET_ID, PACKETBUF_ATTR_BIT * 2 }, \
STUNICAST_ATTRIBUTES
struct runicast_callbacks {
void (* recv)(struct runicast_conn *c, rimeaddr_t *from, uint8_t seqno);
void (* sent)(struct runicast_conn *c, rimeaddr_t *to, uint8_t retransmissions);
void (* timedout)(struct runicast_conn *c, rimeaddr_t *to, uint8_t retransmissions);
void (* recv)(struct runicast_conn *c, const rimeaddr_t *from, uint8_t seqno);
void (* sent)(struct runicast_conn *c, const rimeaddr_t *to, uint8_t retransmissions);
void (* timedout)(struct runicast_conn *c, const rimeaddr_t *to, uint8_t retransmissions);
};
struct runicast_conn {
@ -105,7 +105,8 @@ void runicast_open(struct runicast_conn *c, uint16_t channel,
const struct runicast_callbacks *u);
void runicast_close(struct runicast_conn *c);
int runicast_send(struct runicast_conn *c, rimeaddr_t *receiver, uint8_t max_retransmissions);
int runicast_send(struct runicast_conn *c, const rimeaddr_t *receiver,
uint8_t max_retransmissions);
uint8_t runicast_is_transmitting(struct runicast_conn *c);

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: stbroadcast.c,v 1.2 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: stbroadcast.c,v 1.3 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -50,7 +50,7 @@
/*---------------------------------------------------------------------------*/
static void
recv_from_broadcast(struct broadcast_conn *broadcast, rimeaddr_t *sender)
recv_from_broadcast(struct broadcast_conn *broadcast, const rimeaddr_t *sender)
{
register struct stbroadcast_conn *c = (struct stbroadcast_conn *)broadcast;
/* DEBUGF(3, "stbroadcast: recv_from_broadcast from %d\n", from_id);*/

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: stunicast.c,v 1.2 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: stunicast.c,v 1.3 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -57,7 +57,7 @@
/*---------------------------------------------------------------------------*/
static void
recv_from_uc(struct unicast_conn *uc, rimeaddr_t *from)
recv_from_uc(struct unicast_conn *uc, const rimeaddr_t *from)
{
register struct stunicast_conn *c = (struct stunicast_conn *)uc;
PRINTF("%d.%d: stunicast: recv_from_uc from %d.%d\n",
@ -117,7 +117,7 @@ stunicast_set_timer(struct stunicast_conn *c, clock_time_t t)
}
/*---------------------------------------------------------------------------*/
int
stunicast_send_stubborn(struct stunicast_conn *c, rimeaddr_t *receiver,
stunicast_send_stubborn(struct stunicast_conn *c, const rimeaddr_t *receiver,
clock_time_t rxmittime)
{
if(c->buf != NULL) {
@ -143,7 +143,7 @@ stunicast_send_stubborn(struct stunicast_conn *c, rimeaddr_t *receiver,
}
/*---------------------------------------------------------------------------*/
int
stunicast_send(struct stunicast_conn *c, rimeaddr_t *receiver)
stunicast_send(struct stunicast_conn *c, const rimeaddr_t *receiver)
{
PRINTF("%d.%d: stunicast_send to %d.%d\n",
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],

View file

@ -60,7 +60,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: stunicast.h,v 1.3 2009/05/26 13:58:53 nvt-se Exp $
* $Id: stunicast.h,v 1.4 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -82,7 +82,7 @@ struct stunicast_conn;
#define STUNICAST_ATTRIBUTES UNICAST_ATTRIBUTES
struct stunicast_callbacks {
void (* recv)(struct stunicast_conn *c, rimeaddr_t *from);
void (* recv)(struct stunicast_conn *c, const rimeaddr_t *from);
void (* sent)(struct stunicast_conn *c);
};
@ -98,11 +98,11 @@ void stunicast_open(struct stunicast_conn *c, uint16_t channel,
const struct stunicast_callbacks *u);
void stunicast_close(struct stunicast_conn *c);
int stunicast_send_stubborn(struct stunicast_conn *c, rimeaddr_t *receiver,
int stunicast_send_stubborn(struct stunicast_conn *c, const rimeaddr_t *receiver,
clock_time_t rxmittime);
void stunicast_cancel(struct stunicast_conn *c);
int stunicast_send(struct stunicast_conn *c, rimeaddr_t *receiver);
int stunicast_send(struct stunicast_conn *c, const rimeaddr_t *receiver);
void stunicast_set_timer(struct stunicast_conn *c, clock_time_t t);

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: trickle.c,v 1.17 2009/04/06 21:20:35 adamdunkels Exp $
* $Id: trickle.c,v 1.18 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -133,7 +133,7 @@ run_trickle(struct trickle_conn *c)
}
/*---------------------------------------------------------------------------*/
static void
recv(struct broadcast_conn *bc, rimeaddr_t *from)
recv(struct broadcast_conn *bc, const rimeaddr_t *from)
{
struct trickle_conn *c = (struct trickle_conn *)bc;
uint16_t seqno = packetbuf_attr(PACKETBUF_ATTR_EPACKET_ID);

View file

@ -34,7 +34,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: unicast.c,v 1.2 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: unicast.c,v 1.3 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -64,7 +64,7 @@ static const struct packetbuf_attrlist attributes[] =
/*---------------------------------------------------------------------------*/
static void
recv_from_broadcast(struct broadcast_conn *broadcast, rimeaddr_t *from)
recv_from_broadcast(struct broadcast_conn *broadcast, const rimeaddr_t *from)
{
struct unicast_conn *c = (struct unicast_conn *)broadcast;

View file

@ -50,7 +50,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: unicast.h,v 1.4 2009/03/12 21:58:21 adamdunkels Exp $
* $Id: unicast.h,v 1.5 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
@ -71,7 +71,7 @@ struct unicast_conn;
BROADCAST_ATTRIBUTES
struct unicast_callbacks {
void (* recv)(struct unicast_conn *c, rimeaddr_t *from);
void (* recv)(struct unicast_conn *c, const rimeaddr_t *from);
};
struct unicast_conn {

View file

@ -32,7 +32,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rimeroute.c,v 1.2 2009/09/29 16:02:28 nvt-se Exp $
* $Id: rimeroute.c,v 1.3 2009/11/08 19:40:18 adamdunkels Exp $
*/
/**
* \file
@ -80,7 +80,7 @@ void uip_log(char *msg);
#define PACKET_TIMEOUT (CLOCK_SECOND * RIMEROUTE_CONF_DISCOVERY_TIMEOUT)
#endif /* RIMEROUTE_CONF_DISCOVERY_TIMEOUT */
static void found_route(struct route_discovery_conn *, rimeaddr_t *);
static void found_route(struct route_discovery_conn *, const rimeaddr_t *);
static void route_timed_out(struct route_discovery_conn *);
static int activate(void);
@ -123,7 +123,7 @@ PROCESS_THREAD(rimeroute_process, ev, data)
}
static void
found_route(struct route_discovery_conn *rdc, rimeaddr_t *dest)
found_route(struct route_discovery_conn *rdc, const rimeaddr_t *dest)
{
}

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: uip-over-mesh.c,v 1.14 2009/05/10 21:08:01 adamdunkels Exp $
* $Id: uip-over-mesh.c,v 1.15 2009/11/08 19:40:16 adamdunkels Exp $
*/
/**
@ -78,7 +78,7 @@ static uip_ipaddr_t netaddr, netmask;
/*---------------------------------------------------------------------------*/
static void
recv_data(struct unicast_conn *c, rimeaddr_t *from)
recv_data(struct unicast_conn *c, const rimeaddr_t *from)
{
struct route_entry *e;
rimeaddr_t source;
@ -112,7 +112,7 @@ send_data(rimeaddr_t *next)
}
/*---------------------------------------------------------------------------*/
static void
new_route(struct route_discovery_conn *c, rimeaddr_t *to)
new_route(struct route_discovery_conn *c, const rimeaddr_t *to)
{
struct route_entry *rt;