Apps     Components     Interfaces     All Files     Source Tree     source: tos.interfaces.Intercept.nc

Interface: Intercept

Author: Philip Levis

Components providing this interface:
tos.lib.Route.MultiHopEngineM
tos.lib.Route.MultiHopRouter

Components requiring this interface:
tos.lib.Route.MultiHopLEPSM
tos.lib.TinyDB.NetworkMultiHopM

Events

Events - Details

intercept

result_t intercept(TOS_MsgPtr msg, void *payload, uint16_t payloadLen)

Signals that a message has been received, which is supposed to be forwarded to another destination. Allows protocol layers above the routing layer to perform data aggregation or make application-specific decisions on whether to forward.

Parameters:

msg - The complete buffer received.

payload - The payload portion of the packet for this protocol layer. If this layer has layers above it, it should signal receive() with payload incremented by the size of its header. Payload is a pointer into the msg structure.

payloadLen - The length of the payload buffer. If this layer has layers above it, it should signal receive() with payloadLen decreased by the size of its headers and footers.

Returns: SUCCESS indicates the packet should be forwarded, FAIL indicates that it should not be forwarded.