Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37811221
en ru br
ALT Linux repos
S:5.2.5-alt1
5.0: 4.5-alt1
4.1: 3.1-alt5.M41.8
4.0: 0.9-alt1.M40.3

Group :: System/Configuration/Other
RPM: alterator-net-eth

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

alterator-net-eth-0.9/000075500000000000000000000000001105530370600147175ustar00rootroot00000000000000alterator-net-eth-0.9/Makefile000064400000000000000000000006521105530370600163620ustar00rootroot00000000000000NAME=net-eth
DESCRIPTION="IP interfaces"

INSTALL=/usr/bin/install

all:
clean: clean-po
install: install-backend install-ui install-po install-html

include /usr/share/alterator/build/po.mak
include /usr/share/alterator/build/ui2.mak
include /usr/share/alterator/build/backend.mak
include /usr/share/alterator/build/fbi.mak
include /usr/share/alterator/build/html-messages.mak

HTML_PO_TEMPLATE=ui/net-eth/html-messages.scm
alterator-net-eth-0.9/applications/000075500000000000000000000000001105530370600174055ustar00rootroot00000000000000alterator-net-eth-0.9/applications/net-eth.desktop000064400000000000000000000003771105530370600223530ustar00rootroot00000000000000[Desktop Entry]
Type=Application
Categories=X-Alterator-Network
Icon=net-eth
Terminal=false
Name=IP interfaces
Name[ru_RU]=IP-интерфейсы
Name[uk_UA]=IP-інтерфейси
X-Alterator-URI=/net-eth
X-Alterator-Weight=30
X-Alterator-Help=net-eth
alterator-net-eth-0.9/backend3/000075500000000000000000000000001105530370600163715ustar00rootroot00000000000000alterator-net-eth-0.9/backend3/net-eth000075500000000000000000000124411105530370600176650ustar00rootroot00000000000000#!/bin/sh

iftab_file="/etc/iftab"

_()
{
LANG=${in_language%%;*}.utf8 gettext "alterator-net-eth" "$1"
}

################### shell file helpers

PATH="/usr/lib/alterator-net-common:$PATH"

shell_add_or_subst()
{
local name="$1" && shift
local value="$1" && shift
local file="$1" && shift

[ -f "$file" ] || touch "$file"
if grep -qs "^$name" "$file"; then
/bin/sed -r -i "s,^$name.*,$name$value," -- "$file"
return 0
fi
printf %s\\n "$name$value" >> "$file"
}

shell_get()
{
local name="$1" && shift
local file="$1" && shift

[ -f "$file" ] &&
grep -qs "^$name=" "$file" &&
grep "^$name=" "$file"|sed "s,^$name=,,"
}

################### interface modificators

list_mask()
{
for i in `seq 32 -1 0`; do
printf '("%s" label "/%s (%s)")' "$i" "$i" "$(maskname "$i")"
done
}

list_iface()
{
iflist|
while read iface mac; do
printf '("%s" label "%s (%s)")' "$iface" "$iface" "$(ifaceinfo "$iface")"
done
}

list_hw_binding()
{
printf '("missing" label "%s")' "`_ "missing"`"
printf '("mac" label "%s")' "`_ "by MAC address"`"
printf '("businfo" label "%s")' "`_ "by bus location"`"
}

restart_iface()
{
ifdown "$1" && ifup "$1"
}

restart_all_ifaces() {
iflist|
while read iface mac; do
restart_iface "$iface"
done >&2
}

read_hw_binding()
{
local line="$(grep "^[[:space:]]*$1[[:space:]]" "$iftab_file")"

if [ -z "$line" ]; then
echo "missing"
else
if echo "$line" | fgrep -qsw mac; then
echo "mac"
elif echo "$line" | fgrep -qsw businfo; then
echo "businfo"
else
echo "missing"
fi
fi
}

read_iface()
{
local name="$1" && shift
echo "("

#collect general information
local info=
ifcheckup "$name" && info="`_ "interface is up"`" || info="`_ "interface is down"`"

if ! ifcheckwireless "$name"; then
ifcheckplug "$name"
case "$?" in
2) info="$info, `_ "plugged"`" ;;
3) info="$info, `_ "unplugged"`" ;;
esac
fi

printf 'info "%s" ' "$info"
printf 'wireless %s ' "$(ifcheckwireless "$name" && echo "#t" || echo "#f")"
printf 'hw_binding "%s" ' "$(read_hw_binding "$name")"

local addr= ip= mask= bootproto=
[ ! -s "/etc/net/ifaces/$name/ipv4address" ] ||
addr=$(grep '^[0-9]' "/etc/net/ifaces/$name/ipv4address" | head -n1 || echo "")

if [ -n "$addr" ]; then
ip="${addr%%/*}"
mask="${addr#$ip}"; mask="${mask#/}"

printf 'ip "%s" mask "%s"\n' "$ip" "${mask:-32}"
fi

[ ! -s "/etc/net/ifaces/$name/ipv4route" ] ||
printf 'default "%s"\n' \
$(grep '^default' "/etc/net/ifaces/$name/ipv4route" | sed -r 's,default[[:space:]]+via[[:space:]],,' || echo "")

bootproto="$(ifvar "$name" "BOOTPROTO")"
[ "$bootproto" = "dhcp" ] && echo "dhcp #t" || echo "dhcp #f"

echo ")"
}

write_hw_binding()
{
local name="$1";shift
local value="$1";shift

local mac="$(ifread "$name"|cut -f1)"
local businfo="$(ifread "$name"|cut -f2)"

if [ -s "$iftab_file" ]; then
sed -r \
-e "/^$name[[:space:]]/ d" \
-i "$iftab_file"

[ -z "$mac" ] ||
[ "$mac" = "00:00:00:00:00:00" ] ||
sed -r \
-e "/[[:space:]]mac[[:space:]]+$mac([[:space:]]|\$)/ d" \
-i "$iftab_file"

[ -z "$businfo" ] ||
sed -r \
-e "/[[:space:]]businfo[[:space:]]+$businfo([[:space:]]|\$)/ d" \
-i "$iftab_file"
fi

case "$value" in
none) ;;
mac)
[ -z "$mac" ] ||
[ "$mac" = "00:00:00:00:00:00" ] ||
printf "%s\tmac %s\n" "$name" "$mac" >>"$iftab_file"
;;
businfo)
[ -z "$businfo" ] ||
printf "%s\tbusinfo %s\n" "$name" "$businfo" >>"$iftab_file"
;;
esac
}

write_iface()
{
local name="$1" && shift
local ifacedir="/etc/net/ifaces/$name"
local options="$ifacedir/options"

[ -d "$ifacedir" ] || mkdir "$ifacedir"

[ -n "$in_mask" ] && [ -n "$in_ip" ] && \
printf '%s/%s\n' "$in_ip" "$in_mask" >"/etc/net/ifaces/$name/ipv4address"

[ -n "$in_default" ] && [ -s "/etc/net/ifaces/$name/ipv4address" ] && \
printf 'default via %s\n' "$in_default" >"/etc/net/ifaces/$name/ipv4route"

shell_add_or_subst "TYPE=" "eth" "$options"

[ -n "$in_dhcp" ] &&
shell_add_or_subst "BOOTPROTO=" \
$([ "$in_dhcp" = "#t" ] && echo "dhcp" || echo "static")\
"$options"

[ -n "$in_hw_binding" ] &&
write_hw_binding "$name" "$in_hw_binding"
}


. /usr/share/alterator/build/backend3.sh

#initial actions
ifup lo

on_message()
{
case "$in_action" in
constraints)
echo '('
printf 'info (label "%s")' "`_ "Interface state"`"
printf 'dhcp (exclude (#t ip) exclude (#t default) exclude (#t mask) default #f label "%s")' \
"`_ "Use DHCP"`"
printf 'ip (required #t ipv4-address #t label "%s")' \
"`_ "IP address"`"
printf 'default (ipv4-address #t label "%s")' \
"`_ "Default gateway"`"
printf 'mask (label "%s")' \
"`_ "NetMask"`"
printf 'hw_binding (label "%s")' \
"`_ "Hardware binding"`"
echo ')'
;;
list)
echo '('
case "${in__objects##*/}" in
avail_masks) list_mask ;;
avail_hw_bindings) list_hw_binding ;;
*) list_iface;;
esac
echo ')'
;;
read)
if [ "$in__objects" == "/" ];then
echo '()'
else
read_iface "${in__objects}"
fi
;;
write)
write_iface "${in__objects}"
[ "$in_restart" = "#f" ] || restart_iface "$in__objects"
echo '()'
;;
restart)
restart_all_ifaces
echo '()'
;;
*)
echo '#f'
;;
esac
}

message_loop
alterator-net-eth-0.9/backend3/template-net-eth000075500000000000000000000012521105530370600214740ustar00rootroot00000000000000#!/bin/sh

_()
{
LANG=${in_language%%;*}.utf8 gettext "alterator-net-eth" "$1"
}

#turn off auto expansion
set -f

. /usr/share/alterator/build/backend3.sh

on_message()
{
case "$in_action" in
#information for renderer
template)
if [ "$in__objects" = "/" ];then
echo '('
echo 'template "card-index" '
echo 'url "net-eth.html"'
echo 'help "net-eth.html"'
echo ')'
else
echo '#f'
fi
;;
info)
echo '('
printf ' title "%s"' "`_ "IP interfaces"`"
printf ' description "%s"' "`_ "IP interfaces administration"`"
printf ' group "%s"' "`_ "Network"`"
printf ' weight 89'
echo ')'
;;
*)
echo '#f'
esac
}


message_loop

alterator-net-eth-0.9/help/000075500000000000000000000000001105530370600156475ustar00rootroot00000000000000alterator-net-eth-0.9/help/ru_RU/000075500000000000000000000000001105530370600167035ustar00rootroot00000000000000alterator-net-eth-0.9/help/ru_RU/net-eth.html000064400000000000000000000037711105530370600211450ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>Help - ALT Linux Console</title>
<meta http-equiv="content-type" value="text/html;charset=utf-8"/>
</head>
<body>
<h2>IP-интерфейсы</h2>
<p><em>IP (Internet Protocol)</em>&nbsp;&mdash; основа стека протоколов
TCP/IP. &quot;IP-адрес&quot; и
&quot;Маска сети&quot;&nbsp;&mdash; обязательные параметры
каждого узла IP-сети. Первый параметр&nbsp;&mdash; уникальный идентификатор машины,
от второго напрямую зависит, к каким машинам локальной сети данная машина будет иметь доступ.
Если требуется выход во внешнюю сеть, то не забудьте про
параметр &quot;Шлюз по умолчанию&quot;.
</p>
<p>
В случае наличия <em>DHCP-сервера</em>, можно все
вышеперечисленные параметры получить автоматически&nbsp;&mdash; просто
включите &quot;Использовать DHCP&quot;.
</p>
<p>
Если в компьютере имеется несколько сетевых карт, то возможна ситуация, когда при очередной загрузке
ядро присвоит имена интерфейсов (eth0, eth1) в другом порядке. В результате интерфейсы получат не свои настройки.
Чтобы этого не происходило, вы можете
привязать интерфейс к имени по его аппаратному адресу (MAC) или по местоположению на системной шине.
</p>
</body>
</html>
alterator-net-eth-0.9/help/uk_UA/000075500000000000000000000000001105530370600166535ustar00rootroot00000000000000alterator-net-eth-0.9/help/uk_UA/net-eth.html000064400000000000000000000025451105530370600211130ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>Help - ALT Linux Console</title>
<meta http-equiv="content-type" value="text/html;charset=utf-8"/>
</head>
<body>
<h2>IP-інтерфейси</h2>
<p><em>IP (Internet Protocol)</em>&nbsp;&mdash; основа стеку
протоколів TCP/IP. &quot;IP address&quot; та
&quot;NetMask&quot;&nbsp;&mdash; обов'язкові
параметри кожного вузла IP-мережі. Перший параметр&nbsp;&mdash;
унікальний ідентифікатор комп'ютера, а від другого напряму
залежить, до яких комп'ютерів та ресурсів локальної мережі
даний комп'ютер буде мати доступ. Якщо необхідний вихід до
зовнішньої мережі, то не забудьте про параметр
&quot;Default gateway&quot;.
</p>
<p>
У випадку наявності <em>DHCP-сервера</em>, всі вищеперераховані
параметри можна отримати автоматично&nbsp;&mdash; просто
ввімкніть &quot;Use DHCP&quot;.
</p>
</body>
</html>
alterator-net-eth-0.9/html/000075500000000000000000000000001105530370600156635ustar00rootroot00000000000000alterator-net-eth-0.9/html/fbi/000075500000000000000000000000001105530370600164235ustar00rootroot00000000000000alterator-net-eth-0.9/html/fbi/net-eth.html000064400000000000000000000035021105530370600206550ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<!-- tcp connections module -->
<html>
<head>
<title>IP interfaces - ALT Linux Console</title>
<link type="text/css" rel="stylesheet" href="/fbi/styles/card-index.css"/>

<!-- ajax selector -->
<script src="/fbi/scripts/submit.js"/>
<script src="/fbi/scripts/card-index.js"/>
</head>
<body>
<h1><span translate="_">IP interfaces</span></h1>
<form method="POST" class="selector-chooser" id="ajax-selector">
<span translate="_">Interface</span>
<span class="selector" >
<select name="name"/>
<input type="submit" name="card-index-select" value="Select" class="btn"/>
</span>
</form>
<hr/>
<form method="POST" class="selector-data">
<span class="alterator-label" name="info"/>
<br/>
<br/>
<table>
<div class="selector-name">
</div>
<tbody>
<tr>
<td><label for="dhcp"/></td>
<td><input type="checkbox" name="dhcp"/></td>
</tr>
<tr>
<td><label for="ip"/></td>
<td><input type="text" name="ip" class="text"/></td>
</tr>
<tr>
<td><label for="mask"/></td>
<td><select name="mask" optionlist="avail_masks"></select></td>
</tr>
<tr>
<td><label for="default"/></td>
<td><input type="text" name="default" class="text"/></td>
</tr>
<tr>
<td><label for="hw_binding"/></td>
<td><select name="hw_binding" optionlist="avail_hw_bindings"/></td>
</tr>
</tbody>
</table>
<a href="/net-wifi/" class="alterator-ref2">
<span translate="_">Wireless settings</span>
</a>
<br/>
<br/>
<input type="submit" name="card-index-apply" value="Apply" class="btn"/>
&nbsp;
<input type="reset" name="card-index-reset" value="Reset" class="btn"/>
</form>
</body>
</html>
alterator-net-eth-0.9/po/000075500000000000000000000000001105530370600153355ustar00rootroot00000000000000alterator-net-eth-0.9/po/alterator-net-eth.pot000064400000000000000000000042671105530370600214310ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-01-14 12:34+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: ui/net-eth/html-messages.scm:1 backend3/template-net-eth:30
msgid "IP interfaces"
msgstr ""

#: ui/net-eth/html-messages.scm:2 ui/net-eth/index.scm:16
msgid "Interface"
msgstr ""

#: ui/net-eth/html-messages.scm:3
msgid "Select"
msgstr ""

#: ui/net-eth/html-messages.scm:4 ui/net-eth/index.scm:55
msgid "Wireless settings"
msgstr ""

#: ui/net-eth/html-messages.scm:5 ui/net-eth/index.scm:65
msgid "Reset"
msgstr ""

#: ui/net-eth/html-messages.scm:6 ui/net-eth/index.scm:64
msgid "Apply"
msgstr ""

#: ui/net-eth/html-messages.scm:7
msgid "apply current settings and restart interface"
msgstr ""

#: ui/net-eth/index.scm:28 backend3/net-eth:210
msgid "Use DHCP"
msgstr ""

#: ui/net-eth/index.scm:33 backend3/net-eth:212
msgid "IP address"
msgstr ""

#: ui/net-eth/index.scm:38
msgid "Netmask"
msgstr ""

#: ui/net-eth/index.scm:43 backend3/net-eth:214
msgid "Default gateway"
msgstr ""

#: ui/net-eth/index.scm:49 backend3/net-eth:218
msgid "Hardware binding"
msgstr ""

#: ui/net-eth/index.scm:66
msgid "Quit"
msgstr ""

#: backend3/net-eth:57
msgid "missing"
msgstr ""

#: backend3/net-eth:58
msgid "by MAC address"
msgstr ""

#: backend3/net-eth:59
msgid "by bus location"
msgstr ""

#: backend3/net-eth:98
msgid "interface is up"
msgstr ""

#: backend3/net-eth:98
msgid "interface is down"
msgstr ""

#: backend3/net-eth:103
msgid "plugged"
msgstr ""

#: backend3/net-eth:104
msgid "unplugged"
msgstr ""

#: backend3/net-eth:208
msgid "Interface state"
msgstr ""

#: backend3/net-eth:216
msgid "NetMask"
msgstr ""

#: backend3/template-net-eth:31
msgid "IP interfaces administration"
msgstr ""

#: backend3/template-net-eth:32
msgid "Network"
msgstr ""
alterator-net-eth-0.9/po/ru.po000064400000000000000000000055561105530370600163360ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-01-14 12:34+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ui/net-eth/html-messages.scm:1 backend3/template-net-eth:30
msgid "IP interfaces"
msgstr "IP-интерфейсы"

#: ui/net-eth/html-messages.scm:2 ui/net-eth/index.scm:16
msgid "Interface"
msgstr "Интерфейс"

#: ui/net-eth/html-messages.scm:3
msgid "Select"
msgstr "Выбрать"

#: ui/net-eth/html-messages.scm:4 ui/net-eth/index.scm:55
msgid "Wireless settings"
msgstr "Настройки для беспроводных интерфейсов"

#: ui/net-eth/html-messages.scm:5 ui/net-eth/index.scm:65
msgid "Reset"
msgstr "Cброс"

#: ui/net-eth/html-messages.scm:6 ui/net-eth/index.scm:64
msgid "Apply"
msgstr "Применить"

#: ui/net-eth/html-messages.scm:7
msgid "apply current settings and restart interface"
msgstr "применить текущие настройки и перезапустить интерфейс"

#: ui/net-eth/index.scm:28 backend3/net-eth:210
msgid "Use DHCP"
msgstr "Использовать DHCP"

#: ui/net-eth/index.scm:33 backend3/net-eth:212
msgid "IP address"
msgstr "IP-адрес"

#: ui/net-eth/index.scm:38
msgid "Netmask"
msgstr "Маска сети"

#: ui/net-eth/index.scm:43 backend3/net-eth:214
msgid "Default gateway"
msgstr "Шлюз по умолчанию"

#: ui/net-eth/index.scm:49 backend3/net-eth:218
msgid "Hardware binding"
msgstr "Привязка"

#: ui/net-eth/index.scm:66
msgid "Quit"
msgstr "Выход"

#: backend3/net-eth:57
msgid "missing"
msgstr "отсутствует"

#: backend3/net-eth:58
msgid "by MAC address"
msgstr "по аппаратному адресу (MAC)"

#: backend3/net-eth:59
msgid "by bus location"
msgstr "по расположению на шине"

#: backend3/net-eth:98
msgid "interface is up"
msgstr "интерфейс запущен"

#: backend3/net-eth:98
msgid "interface is down"
msgstr "интерфейс остановлен"

#: backend3/net-eth:103
msgid "plugged"
msgstr "подключен"

#: backend3/net-eth:104
msgid "unplugged"
msgstr "отключен"

#: backend3/net-eth:208
msgid "Interface state"
msgstr "Состояние интерфейса"

#: backend3/net-eth:216
msgid "NetMask"
msgstr "Маска сети"

#: backend3/template-net-eth:31
msgid "IP interfaces administration"
msgstr "Управление IP-интерфейсами"

#: backend3/template-net-eth:32
msgid "Network"
msgstr "Сеть"
alterator-net-eth-0.9/po/uk.po000064400000000000000000000055611105530370600163230ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-01-14 12:34+0300\n"
"PO-Revision-Date: 2008-08-27 19:57+0300\n"
"Last-Translator: Michael Shigorin <mike@altlinux.org>\n"
"Language-Team: Ukrainian <uk@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ui/net-eth/html-messages.scm:1 backend3/template-net-eth:30
msgid "IP interfaces"
msgstr "IP-інтерфейси"

#: ui/net-eth/html-messages.scm:2 ui/net-eth/index.scm:16
msgid "Interface"
msgstr "Інтерфейс"

#: ui/net-eth/html-messages.scm:3
msgid "Select"
msgstr "Вибрати"

#: ui/net-eth/html-messages.scm:4 ui/net-eth/index.scm:55
msgid "Wireless settings"
msgstr "Налаштування бездротових інтерфейсів"

#: ui/net-eth/html-messages.scm:5 ui/net-eth/index.scm:65
msgid "Reset"
msgstr "Скинути"

#: ui/net-eth/html-messages.scm:6 ui/net-eth/index.scm:64
msgid "Apply"
msgstr "Застосувати"

#: ui/net-eth/html-messages.scm:7
msgid "apply current settings and restart interface"
msgstr "застосувати поточні налаштування та рестартувати інтерфейс"

#: ui/net-eth/index.scm:28 backend3/net-eth:210
msgid "Use DHCP"
msgstr "Використовувати DHCP"

#: ui/net-eth/index.scm:33 backend3/net-eth:212
msgid "IP address"
msgstr "IP-адреса"

#: ui/net-eth/index.scm:38
msgid "Netmask"
msgstr "Маска мережі"

#: ui/net-eth/index.scm:43 backend3/net-eth:214
msgid "Default gateway"
msgstr "Типовий шлюз"

#: ui/net-eth/index.scm:49 backend3/net-eth:218
msgid "Hardware binding"
msgstr "Прив'язування"

#: ui/net-eth/index.scm:66
msgid "Quit"
msgstr "Вихід"

#: backend3/net-eth:57
msgid "missing"
msgstr "немає"

#: backend3/net-eth:58
msgid "by MAC address"
msgstr "за MAC-адресою"

#: backend3/net-eth:59
msgid "by bus location"
msgstr "за розміщенням на шині"

#: backend3/net-eth:98
msgid "interface is up"
msgstr "інтерфейс запущено"

#: backend3/net-eth:98
msgid "interface is down"
msgstr "інтерфейс зупинено"

#: backend3/net-eth:103
msgid "plugged"
msgstr "підключено"

#: backend3/net-eth:104
msgid "unplugged"
msgstr "відключено"

#: backend3/net-eth:208
msgid "Interface state"
msgstr "Стан інтерфейсу"

#: backend3/net-eth:216
msgid "NetMask"
msgstr "Маска мережі"

#: backend3/template-net-eth:31
msgid "IP interfaces administration"
msgstr "Керування IP-інтерфейсами"

#: backend3/template-net-eth:32
msgid "Network"
msgstr "Мережа"
alterator-net-eth-0.9/simple.layout000064400000000000000000000005431105530370600174510ustar00rootroot00000000000000(use-modules (alterator transport server-socket)
(alterator transport pipe-channel)
(alterator transport std-channel)

(alterator lookout)
(alterator context)
(alterator atlas))

(telegraph
(pipe-in "/usr/bin/qtbrowser")
;; (std-in)
(lookout)
(ensign))

(with-atlas (load-atlas "simple.smap")
(go))

alterator-net-eth-0.9/simple.smap000064400000000000000000000001111105530370600170630ustar00rootroot00000000000000(include "*.map")

(/ view /net-eth)
(/std/frame view /standalone/frame)
alterator-net-eth-0.9/ui/000075500000000000000000000000001105530370600153345ustar00rootroot00000000000000alterator-net-eth-0.9/ui/net-eth/000075500000000000000000000000001105530370600167005ustar00rootroot00000000000000alterator-net-eth-0.9/ui/net-eth/base-functions.scm000064400000000000000000000004301105530370600223210ustar00rootroot00000000000000(define (base-behaviour)
(ifaces (when selected (update-interface (current-interface))))
(c-button (when clicked (commit-interface "/net-eth" (current-interface))))
(r-button (when clicked (update-interface (current-interface))))
(q-button (when clicked (document:end))))
alterator-net-eth-0.9/ui/net-eth/common-functions.scm000064400000000000000000000043601105530370600227050ustar00rootroot00000000000000(define avail-ifaces (woo-list/name+label "/net-eth"))
(define avail-masks (woo-list/name+label "/net-eth/eth0/avail_masks"))
(define avail-hw-bindings (woo-list/name+label "/net-eth/eth0/avail_hw_bindings"))

(define (update-interface name)
(and (not-empty-string? name)
(let ((cmd (woo-read-first (string-append "/net-eth" "/" name))))
(iface-info text (string-append "<small>(" (woo-get-option cmd 'info) ")</small>"))
(iface-dhcp state (woo-get-option cmd 'dhcp #f) toggled)
(iface-ip text (woo-get-option cmd 'ip))
(iface-mask current (string-list-index (woo-get-option cmd 'mask "24") (map car avail-masks)))
(iface-hw-binding current (string-list-index (woo-get-option cmd 'hw_binding) (map car avail-hw-bindings)))
(w-button activity (woo-get-option cmd 'wireless))
(iface-gw text (woo-get-option cmd 'default)))))

(define (commit-interface path name . args)
(if (or (iface-dhcp state) (not-empty-string? (iface-ip text)))
(and (not-empty-string? name)
(woo-catch/message
(thunk
(apply
woo-write/constraints (string-append path "/" name)
'dhcp (iface-dhcp state)
'ip (iface-ip text)
'mask (current-mask)
'hw_binding (current-hw-binding)
'default (iface-gw text) args))))
#t))

(define (current-interface)
(and (number? (ifaces current))
(>= (ifaces current) 0)
(car (list-ref avail-ifaces (ifaces current)))))

(define (current-mask)
(car (list-ref avail-masks (iface-mask current))))

(define (current-hw-binding)
(car (list-ref avail-hw-bindings (iface-hw-binding current))))

(define (net-wifi name)
(and (not-empty-string? name)
(document:popup "/net-wifi/" 'interface name)))

(define (common-behaviour)
(w-button (when clicked (net-wifi (current-interface))))
(ifaces rows (map cdr avail-ifaces))
(and (positive? (ifaces count))
(begin (ifaces current 0)
(update-interface (current-interface))))
;;constraints
(iface-dhcp (when toggled
((widgets iface-ip
iface-gw
iface-mask)
activity (not (iface-dhcp state)))))
(iface-dhcp toggled))

alterator-net-eth-0.9/ui/net-eth/html-messages.scm000064400000000000000000000002241105530370600221530ustar00rootroot00000000000000(_ "IP interfaces")
(_ "Interface")
(_ "Select")
(_ "Wireless settings")
(_ "Reset")
(_ "Apply")
(_ "apply current settings and restart interface")
alterator-net-eth-0.9/ui/net-eth/index.scm000064400000000000000000000031021105530370600205070ustar00rootroot00000000000000(document:surround "/std/frame")
(document:insert "/std/functions")

(document:insert "/net-eth/common-functions")
(document:insert "/net-eth/base-functions")
(document:insert "/net-eth/install-functions")

(document:envelop with-translation _ "alterator-net-eth")

;;;;;;;;;;;;;;;;;;;;;;;;;

(gridbox
columns "20;20;40;20"
;;
(spacer)
(label (_ "Interface") align "right")
(document:id ifaces (combobox layout-policy 20 -1))
(spacer)

;;
(spacer)
(spacer)
(document:id iface-info (label ""))
(spacer)

;;
(spacer)
(document:id iface-dhcp (checkbox (_ "Use DHCP") widget-name "dhcp"))
(spacer)
(spacer)
;;
(spacer)
(label (_ "IP address") align "right")
(document:id iface-ip (edit "" widget-name "ip"))
(spacer)
;;
(spacer)
(label (_ "Netmask") align "right")
(document:id iface-mask (combobox "" rows (map cdr avail-masks) widget-name "mask"))
(spacer)
;;
(spacer)
(label (_ "Default gateway") align "right")
(document:id iface-gw (edit "" widget-name "default"))
(spacer)

;;
(spacer)
(label (_ "Hardware binding") align "right")
(document:id iface-hw-binding (combobox "" rows (map cdr avail-hw-bindings) widget-name "hw_binding"))

;;
(spacer)
(spacer)
(document:id w-button (button (_ "Wireless settings")))
(spacer)

)

;;;;;;;;;;;;;;;

(or (global 'frame:next)
(hbox align "center"
(document:id c-button (button (_ "Apply")))
(document:id r-button (button (_ "Reset")))
(document:id q-button (button (_ "Quit")))))

;;;;;;;;;;;;;;;;;;
(common-behaviour)

(if (global 'frame:next) (install-behaviour) (base-behaviour))
alterator-net-eth-0.9/ui/net-eth/install-functions.scm000064400000000000000000000020731105530370600230620ustar00rootroot00000000000000(define prev-current (make-cell 0))

(define (prev-interface)
(car (list-ref avail-ifaces (cell-ref prev-current))))

(define (commit-current-interface)
(and (commit-interface "/net-eth" (current-interface) 'restart #f)
(commit-interface "/autoinstall/net-eth" (current-interface) 'restart #f)))

(define (restart-interfaces)
(and (commit-current-interface)
(woo-catch/message
(thunk
(woo-try "restart" "/net-eth")
(woo-try "restart" "/autoinstall/net-eth")))))

(define (install-behaviour)
(ifaces (when selected
(and (commit-interface "/net-eth" (prev-interface) 'restart #f)
(commit-interface "/autoinstall/net-eth" (prev-interface) 'restart #f)
(update-interface (current-interface))
(cell-set! prev-current (ifaces current)))))
(and (global 'frame:auto-save)
(cell-set! (global 'frame:auto-save) commit-current-interface))
(frame:on-back (thunk (or (restart-interfaces) 'cancel)))
(frame:on-next (thunk (or (restart-interfaces) 'cancel))))


 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin