55
-> [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
dst host intern, //ip for us
dst net intern/24, //ip for internal net
-); // rest to gateway
//demux for the FromHost processing
arp_demux :: Classifier(12/0806 20/0001, // arp queries
12/0800); // IP packets
//packets input from the router
ip_input :: CheckIPHeader -> GetIPAddress(16) -> ip_demux;
// packets to or from the router
//to_host_encap :: KernelTun(me/24, HEADROOM 68, MTU 1432) -> ip_input;
to_host :: ToHost(grid0);
to_host_encap :: EtherEncap(0x0800, 1:1:1:1:1:1, 2:2:2:2:2:2) -> to_host;
Komentarze do niniejszej Instrukcji