2 # /etc/planetlab/blacklist
4 # post: iptables-restore --noflush < /etc/planetlab/blacklist
6 # PlanetLab per-node outbound blacklist
8 # Aaron Klingaman <alk@cs.princeton.edu>
9 # Mark Huang <mlhuang@cs.princeton.edu>
10 # Copyright (C) 2004 The Trustees of Princeton University
18 // Get admin API handle
19 require_once 'plc_api.php';
22 $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
23 if (!empty($interfaces)) {
24 $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
31 // XXX Implement generic "networks" table
32 // $networks = $adm->GetNetworks();
34 foreach ($networks as $network) {
35 if ($network['blacklisted']) {
36 $dest = $network['ip'];
37 if ($network['netmask']) {
38 $dest .= "/" . $network['netmask'];
40 print "-A BLACKLIST -d $dest -j LOGDROP\n";