2 # /etc/planetlab/proxies
4 # post: service vnet restart
6 # Proxy (a.k.a. network telescope a.k.a. honeypot) interface configuration
8 # Aaron Klingaman <alk@cs.princeton.edu>
9 # Mark Huang <mlhuang@cs.princeton.edu>
10 # Copyright (C) 2004 The Trustees of Princeton University
14 // Get admin API handle
15 require_once 'plc_api.php';
18 $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
20 if (!empty($interfaces)) {
21 $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
31 $interfaces = $adm->GetInterfaces($node['interface_ids']);
33 foreach ($interfaces as $interface) {
34 // XXX PL2896: need interfaces.device
35 switch ($interface['method']) {
38 $types['taps'][$dev][0] = $interface['ip'] . "/" . $interface['gateway'];
42 $types['proxies'][$dev][] = $interface['ip'];
47 // taps="tap0 tap1 ..."
48 // tap0="1.2.3.4/5.6.7.8"
49 // tap1="9.10.11.12/13.14.15.16"
51 // proxies="proxy0 proxy1 ..."
52 // proxy0="1.2.3.4 5.6.7.8 ..."
53 // proxy1="9.10.11.12 13.14.15.16 ..."
56 foreach ($types as $type => $devs) {
57 print("$type=\"" . implode(" ", array_keys($devs)) . "\"\n");
58 foreach ($devs as $dev => $ips) {
59 print("$dev=\"" . implode(" ", $ips) . "\"\n");