File: Intercept.nc

package info (click to toggle)
tinyos 2.1.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 47,476 kB
  • ctags: 36,607
  • sloc: ansic: 63,646; cpp: 14,974; java: 10,358; python: 5,215; makefile: 1,724; sh: 902; asm: 597; xml: 392; perl: 74; awk: 46
file content (32 lines) | stat: -rw-r--r-- 987 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
 * Allows protocol layers above the routing layer to perform data
 * aggregation or make application-specific decisions on whether to
 * forward via the return value of the forward event.
 *
 * @author Philip Levis
 * @author Kyle Jamieson
 * @version $Id: Intercept.nc,v 1.6 2008-06-04 03:00:26 regehr Exp $
 * @see TEP 116: Packet Protocols, TEP 119: Collection
 */

#include <TinyError.h>
#include <message.h>

interface Intercept {
  /**
   * Signals that a message has been received, which is supposed to be
   * forwarded to another destination. 
   *
   * @param 'message_t* ONE msg' The complete message received.
   *
   * @param 'void* COUNT(len) payload' The payload portion of the packet for this
   * protocol layer.
   *
   * @param len The length of the payload buffer.
   *
   * @return TRUE indicates the packet should be forwarded, FALSE
   * indicates that it should not be forwarded.
   *
   */
  event bool forward(message_t* msg, void* payload, uint8_t len);
}