-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNodeC.nc
More file actions
79 lines (56 loc) · 1.92 KB
/
NodeC.nc
File metadata and controls
79 lines (56 loc) · 1.92 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
* ANDES Lab - University of California, Merced
* This class provides the basic functions of a network node.
*
* @author UCM ANDES Lab
* @date 2013/09/03
*
*/
#include <Timer.h>
#include "includes/CommandMsg.h"
#include "includes/packet.h"
#include "includes/route.h"
#define NEIGHBORHOOD_SIZE 255
configuration NodeC{
}
implementation {
components MainC;
components Node;
components new AMReceiverC(AM_PACK) as GeneralReceive;
components NeighborDiscoveryC;
Node.NeighborDiscovery -> NeighborDiscoveryC;
NeighborDiscoveryC.RouteTableC -> RouteTableC; //not using RouteTable
NeighborDiscoveryC.RoutingTableC -> HashmapC;
components FloodingC;
Node.FSender -> FloodingC.FSender;
Node.RSender -> FloodingC.RSender;
// Node.FSender -> FloodingC.FSender;
components TransportC;
Node.Transport->TransportC;
TransportC.RoutingTableC -> HashmapC;
Node -> MainC.Boot;
Node.Receive -> GeneralReceive;
components ActiveMessageC;
Node.AMControl -> ActiveMessageC;
components new SimpleSendC(AM_PACK);
Node.Sender -> SimpleSendC;
components CommandHandlerC;
Node.CommandHandler -> CommandHandlerC;
components new HashmapC(Route, NEIGHBORHOOD_SIZE) as HashmapC;
Node.RoutingTable -> HashmapC;
components new ListC(Route, NEIGHBORHOOD_SIZE) as RouteTableC;
Node.RouteTable -> RouteTableC;
components new ListC(socket_t, 255) as acceptedSockets;
Node.acceptedSockets -> acceptedSockets;
components RoutingC;
Node.Routing -> RoutingC;
RoutingC.RouteTableC -> RouteTableC; //not using this -delete later
RoutingC.HashmapC -> HashmapC;
FloodingC.HashmapC -> HashmapC;
components new TimerMilliC() as clientTimer;
Node.clientTimer->clientTimer;
components new TimerMilliC() as serverTimer;
Node.serverTimer->serverTimer;
components new TimerMilliC() as timeWait;
Node.timeWait->timeWait;
}