Source for file
examples.guifi_api.interface.php
Documentation is available at examples.guifi_api.interface.php
-
-
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
-
// Eduard Duran <eduard.duran at iglu.cat>.
-
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
-
// You can get copies of the licenses here:
-
// http://www.affero.org/oagpl.html
-
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "LICENSE.txt".
-
-
require ( 'guifi_api.php' );
-
-
-
* Configuration of authentication against guifi.net
-
-
-
-
-
-
-
-
$gapi = new guifiAPI( $username, $password );
-
-
$action = $_GET['action'];
-
-
-
-
-
-
-
$added = $gapi->addInterface( $device_id, $radiodev_counter );
-
-
echo "Interface created correctly!!<br />\n<br />\n";
-
echo "The identificator of the new interface is: interface_id = <strong>$added->interface_id</strong>";
-
-
-
echo "New IPv4 configuration:<br />";
-
-
foreach( $added->ipv4 as $ipv4 ) {
-
-
echo "ipv4_type = $ipv4->ipv4_type<br />";
-
echo "ipv4 = $ipv4->ipv4 <br />";
-
echo "netmask = $ipv4->netmask<br />";
-
-
-
-
-
-
echo "There was an error adding the interface.<br />\n";
-
echo $gapi->getErrorsStr();
-
-
-
-
-
-
$removed = $gapi->removeInterface( $interface_id );
-
-
echo "Interface <strong>$interface_id</strong> removed correctly.<br />\n<br />\n";
-
-
echo "There was an error deleting the interface.<br />\n";
-
echo $gapi->getErrorsStr();
-
-
-
-
-
|