63
-> [2] prio;
prio
-> dev_counter :: Counter
-> t :: PullTee
-> ToDevice($dev);
t [1] -> SetTimestamp -> Discard;
};
elementclass FromGridDev {
// push, no input
// `Grid' packets on first output
// `LinkStat' packets on second output
$dev, $mac |
FromDevice($dev, PROMISC false)
-> t :: Tee
-> HostEtherFilter($mac, DROP_OWN true)
-> cl :: Classifier(12/7fff, 12/7ffe, 12/7ffd, -);
cl [0] // `Grid' packets
-> ck :: CheckGridHeader
-> [0] output;
cl [1] // `LinkStat 1' packets
-> [1] output;
cl [2] // `LinkStat 2' packets
-> [1] output;
cl [3] // everything else
-> [2] output;
t [1] -> Discard;
ck [1] -> Print('Bad Grid header received', TIMESTAMP true, NBYTES 166) -> Discard;
};
// handles IP packets with no extra encapsulation
ip_demux :: IPClassifier(dst host me, // ip for us
dst net me/24); // ip for Grid network
//input demux from router
arp_demux :: Classifier(12/0806 20/0001, // arp queries
12/0800); // IP packets
//packets input from the router (grid dev)
ip_input :: CheckIPHeader -> GetIPAddress(16) -> ip_demux;
// packets to or from the router its self
//the router classifier may not be necessary
to_host :: ToHost(grid0);
//to_host_noGrid :: ToHost(extern0);
to_host_encap :: EtherEncap(0x0800, 1:1:1:1:1:1, 2:2:2:2:2:2)->to_host;
from_host :: FromHost(grid0, me/24)->arp_demux->ARPResponder(0.0.0/0 1:1:1:1:1:1) ->
to_host;
from_host_noGrid :: FromHost(extern0, extern/24)->arp_demux;
Comentarios a estos manuales