[Click] Accessing element handlers from within a click script
david johnson
david.lloyd.johnson at gmail.com
Fri Aug 7 08:15:40 EDT 2009
Hi
I've got the following example code in which I'm continuously scanning
for beacons and storing the results in bs.scan. I then want to send the
results of the scan to other nodes in the network when I get a certain
request message.
To do this I need to access the BeaconScanner handler "scan". I'm new to
click and maybe I'm breaking some fundamental rule in a click config
script but is it possible to pass an element handler as a parameter to
another element.
I need to do it at this point in the code:
25 -> send_scan_results(### pass bs.scan handler to element ###)
Thanks
David
=========================================
1 control :: ControlSocket("TCP", 7777);
2
3 rates :: AvailableRates(DEFAULT 2 4 11 22);
4
5 FromDevice(ath0, PROMISC true)
6 -> RadiotapDecap()
7 -> c1 :: Counter
8 -> wifi_cl :: Classifier(0/00%0c, /mgt
9 0/08%0c, /data);
10
11 wifi_cl [0] -> Classifier(0/80%f0)
12 -> c2 :: Counter
13 -> bs :: BeaconScanner()
14 -> Discard;
15
16 wifi_cl [1]
17 -> WifiDecap()
18 -> cognitive :: -> Classifier(//some String 1,
19 // Some String 2,
20 // Some String 3,
21 );
22
23 // Respond to Get beacons stored in node
24 cognitive [0]
25 -> send_scan_results(### pass bs.scan handler to element ###)
26 -> q;
27
28
29 q :: Queue(10)
30 -> wep_encap :: WepEncap(ACTIVE false)
31 -> set_rate :: SetTXRate(2)
32 -> rate :: ProbeTXRate(OFFSET 4,
33 THRESHOLD 0,
34 WINDOW 10000,
35 RT rates)
36 -> SetTXPower(63)
37 -> extra_encap :: ExtraEncap()
38 -> to_dev :: ToDevice (ath0);
More information about the click
mailing list