[BlueOnyx:05913] Re: eth0 vs seth0 and adding new sites

Dennis daodennis at gmail.com
Tue Nov 23 20:29:06 -05 2010


On Tue, Nov 23, 2010 at 4:57 PM, Dennis <daodennis at gmail.com> wrote:

>
> In case this helps anyone:
>
> I ended up just manually changing these files in /usr/sausalito/
>
> I didn't put into patch format since this takes away the ^eth[n]$
> functionality anyway.
>
> ./schemas/base/network/network.schema:
> Changed:  data="(^eth[0-9]+(:[0-9]+)?$)|(^venet[0-9]+(:[0-9]+)?$)"/>
>          data="(^[se]th[0-9]+(:[0-9]+)?$)|(^venet[0-9]+(:[0-9]+)?$)"/>
>
>
> ./ui/web/base/network/network_details.php
> Changed the following lines that
>  $list = $factory->getScrollList("amNetStats", array(' ', 'seth0', 'seth1'));
>        $eth0_obj = $cce->getObject('Network', array('device' => 'venet0'));
>        $eth1_obj = $cce->getObject('Network', array('device' => 'venet1'));
>        $seth0_obj = $cce->getObject('Network', array('device' => 'seth0'));
>        $seth1_obj = $cce->getObject('Network', array('device' => 'seth1'));
> if ($seth0_obj['enabled']) {
>                $eth0 = `grep venet0 /proc/net/dev`;
>                $eth0 = `grep seth0 /proc/net/dev`;
>  $seth0 = chop(ltrim($seth0));
>  $seth0 = split("[^[:alnum:]]+", $seth0);
>  $seth0['recv_bytes'] = $seth0[1];
>  $seth0['recv_packets'] = $seth0[2];
>  $seth0['sent_bytes'] = $seth0[9];
>  $seth0['sent_packets'] = $seth0[10];
>  $seth0['errors'] = $seth0[3] + $seth0[11];
>  $seth0['collisions'] = $seth0[14];
>  $seth0['recv_bytes'] = $seth0['recv_packets'] = $seth0['sent_bytes']  =
>    $seth0['sent_packets'] = $seth0['errors'] = $seth0['collisions'] =
> $i18n->interpolate('stats_disabled');
> if ($seth1_obj['enabled']) {
>  $seth1 = `grep seth1 /proc/net/dev`;
>  $seth1 = chop(ltrim($seth1));
>  $seth1 = split("[^[:alnum:]]+", $seth1);
>  $seth1['recv_bytes'] = $seth1[1];
>  $seth1['recv_packets'] = $seth1[2];
>  $seth1['sent_bytes'] = $seth1[9];
>  $seth1['sent_packets'] = $seth1[10];
>  $seth1['errors'] = $seth1[3] + $seth1[11];
>  $seth1['collisions'] = $seth1[14];
>  $seth1['recv_bytes'] = $seth1['recv_packets'] = $seth1['sent_bytes']  =
>    $seth1['sent_packets'] = $seth1['errors'] = $seth1['collisions'] =
> $i18n->get('stats_disabled');
>
>
>
>
> ./ui/web/base/network/ethernet.php
>
> if ($dev['seth0']) {
>    $ipaddr = $dev['seth0']['ipaddr'];
>    $netmask = $dev['seth0']['netmask'];
>    $device = $dev['seth0']['device'];
>    $mac = $dev['seth0']['mac'];
>    $enabled = $dev['seth0']['enabled'];
>    $bootproto = $dev['seth0']['bootproto'];
>    // Netmask is not optional for the admin iface and for seth0
> if ($dev['seth1']) {
>    $ipaddr = $dev['seth1']['ipaddr'];
>    $netmask = $dev['seth1']['netmask'];
>    $device = $dev['seth1']['device'];
>    $mac = $dev['seth1']['mac'];
>    $enabled = $dev['seth1']['enabled'];
>    $bootproto = $dev['seth1']['bootproto'];
> if ($dev['seth2']) {
>    $ipaddr = $dev['seth2']['ipaddr'];
>    $netmask = $dev['seth2']['netmask'];
>    $device = $dev['seth2']['device'];
>    $mac = $dev['seth2']['mac'];
>    $enabled = $dev['seth2']['enabled'];
>    $bootproto = $dev['seth2']['bootproto'];
> if ($dev['seth3']) {
>    $ipaddr = $dev['seth3']['ipaddr'];
>    $netmask = $dev['seth3']['netmask'];
>    $device = $dev['seth3']['device'];
>    $mac = $dev['seth3']['mac'];
>    $enabled = $dev['seth3']['enabled'];
>    $bootproto = $dev['seth3']['bootproto'];
> $block->addFormField($factory->getTextField('adminIf', 'seth0', ''));
>
>
> ./ui/web/base/wizard/onepageHandler.php
>
> $devices = array('seth0', 'seth1');
>                // first migrate any aliases to seth0 (possibly do this better)
>                        $new_device = find_free_device($cceClient, 'seth0');
>
>
> ./ui/web/base/wizard/onepageHandler.php
> $adminIf = "seth1";
>    $devices = array('seth0', 'seth1');
>                // first migrate any aliases to seth0 (possibly do this better)
>                        $new_device = find_free_device($cceClient, 'seth0');
>
>
>
> ./ui/web/base/wizard/onepage.php
>
>
>                if ($device != 'seth0') {
>                // IP is optional, if it isn't the admin iface or seth0
>                if (!$is_admin_if && ($device != 'seth0'))
>                if ($device != 'seth0') {
>                // IP not optional for the admin interface and for seth0
>                if (!$is_admin_if && ($device != 'seth0'))
>        // use special help text for seth0 and eth1 to keep the qube happy
>        if ($device == 'seth0')
>        if ($device != 'seth0') {
>        // Netmask is not optional for the admin iface and for seth0
>        if (!$is_admin_if && ($device != 'seth0'))
>
>
> ./ui/web/base/wizard/networkHandler.php
>
> $seth0 = $cceClient->getObject("Network", array("device" => "seth0"));
>        $seth0 = $cceClient->getObject("Network", array("device" => "venet0"));
>                                        array("device" => "seth1"));
>                                "ipaddr" => $seth0["ipaddr"],
>
>
>
>
> ./handlers/base/system/System.pm
>
>  $errors += $cce->validate('seth0_ipaddr', $re_dotquad );
>  $errors += $cce->validate('seth0_netmask', $re_dotquad );
>  $errors += $cce->validate('seth0_up', qr/.*/ );
>  $errors += $cce->validate('seth1_ipaddr', $re_dotquad );
>  $errors += $cce->validate('seth1_netmask', $re_dotquad );
>  $errors += $cce->validate('seth1_up', qr/.*/ );
>
>
> Thanks,
>
> Dennis O.
>

A few more the last one probably being the most important:

./handlers/base/vsite/Vsite.pm: $DEFAULT_INTERFACE = 'seth0';


./handlers/base/vsite/network_destroy.pl:
$DEFAULT_INTERFACE = 'eth0';



./handlers/base/power/wakemode.pl:my @kernel_args = ($kernel_wakeutil,
'-s', 'eth0', 'wol');



 ./ui/web/base/system/system.php


$seth0 = $cceClient->getObject("Network", array("device" => "seth0"));
$seth1 = $cceClient->getObject("Network", array("device" => "seth1"));
if($seth0["mac"] != "") {
    $factory->getMacAddress("mac0Field", $seth0["mac"], "r"),




More information about the Blueonyx mailing list