its queue entry is pointed to by clientPtrs. */
fe_queue_entry_t clientEntries[CLIENT_COUNT];
- fe_queue_entry_t* clientPtrs[CLIENT_COUNT];
+ fe_queue_entry_t* ONE_NOK clientPtrs[CLIENT_COUNT];
/* The loopback message is for when a collection roots calls
Send.send. Since Send passes a pointer but Receive allows
See sendTask(). */
message_t loopbackMsg;
- message_t* loopbackMsgPtr;
+ message_t* ONE_NOK loopbackMsgPtr;
command error_t Init.init() {
int i;
* message in the pool, it returns the passed message and does not
* put it on the send queue.
*/
- message_t* forward(message_t* m) {
+ message_t* ONE forward(message_t* ONE m) {
if (call MessagePool.empty()) {
dbg("Route", "%s cannot forward, message pool empty.\n", __FUNCTION__);
// send a debug message to the uart
// Loop-detection code:
if (call CtpInfo.getEtx(&gradient) == SUCCESS) {
// We only check for loops if we know our own metric
- if (call CtpPacket.getEtx(m) < gradient) {
- // The incoming packet's metric (gradient) is less than our
- // own gradient. Trigger a route update and backoff.
+ if (call CtpPacket.getEtx(m) <= gradient) {
+ // If our etx metric is less than or equal to the etx value
+ // on the packet (etx of the previous hop node), then we believe
+ // we are in a loop.
+ // Trigger a route update and backoff.
call CtpInfo.triggerImmediateRouteUpdate();
startRetxmitTimer(LOOPY_WINDOW, LOOPY_OFFSET);
call CollectionDebug.logEventMsg(NET_C_FE_LOOP_DETECTED,
}
// NB: at this point, we have a resource acquistion problem.
- // Trigger an immediate route update, log the event, and drop the
+ // Log the event, and drop the
// packet on the floor.
- call CtpInfo.triggerImmediateRouteUpdate();
+
call CollectionDebug.logEvent(NET_C_FE_SEND_QUEUE_FULL);
return m;
}
call CollectionDebug.logEventMsg(NET_C_FE_RCV_MSG,
call CollectionPacket.getSequenceNumber(msg),
call CollectionPacket.getOrigin(msg),
- call AMPacket.destination(msg));
+ thl--);
if (len > call SubSend.maxPayloadLength()) {
return msg;
}
// Check for the pull bit (P) [TEP123] and act accordingly. This
// check is made for all packets, not just ones addressed to us.
- if (call CtpPacket.option(msg, CTP_OPT_PULL))
+ if (call CtpPacket.option(msg, CTP_OPT_PULL)) {
call CtpInfo.triggerRouteUpdate();
+ }
call CtpInfo.setNeighborCongested(proximalSrc, call CtpPacket.option(msg, CTP_OPT_ECN));
return signal Snoop.receive[call CtpPacket.getType(msg)]
default event bool
Intercept.forward[collection_id_t collectid](message_t* msg, void* payload,
- uint16_t len) {
+ uint8_t len) {
return TRUE;
}