Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37910762
en ru br
Репозитории ALT
S:0.10-alt1
5.1: 0.9-alt1
4.1: 0.6.1-alt2.M41.3
4.0: 0.4.4-alt3
+updates:0.4.3-alt1
www.altlinux.org/Changes

Группа :: Система/Настройка/Прочее
Пакет: alterator-net-pppoe

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

alterator-net-pppoe-0.6.1/000075500000000000000000000000001111622063000154065ustar00rootroot00000000000000alterator-net-pppoe-0.6.1/Makefile000064400000000000000000000001751111622063000170510ustar00rootroot00000000000000NAME=net-pppoe

INSTALL=/usr/bin/install

all:
clean:
install: install-module

include /usr/share/alterator/build/module.mak
alterator-net-pppoe-0.6.1/applications/000075500000000000000000000000001111622063000200745ustar00rootroot00000000000000alterator-net-pppoe-0.6.1/applications/net-pppoe.desktop000064400000000000000000000003011111622063000233700ustar00rootroot00000000000000[Desktop Entry]
Type=Application
Categories=X-Alterator-Network
Icon=net-pppoe
Terminal=false
Name=PPPoE connections
X-Alterator-URI=/net-pppoe
X-Alterator-Help=net-pppoe
X-Alterator-Weight=20
alterator-net-pppoe-0.6.1/backend3/000075500000000000000000000000001111622063000170605ustar00rootroot00000000000000alterator-net-pppoe-0.6.1/backend3/net-pppoe000075500000000000000000000056621111622063000207260ustar00rootroot00000000000000#!/bin/sh -f

po_domain="alterator-net-pppoe"

. alterator-sh-functions
. alterator-net-functions

### shell file helpers

read_connection()
{
local name="/etc/net/ifaces/$1"

local info=
ifcheckup "$1" && info="`_ "connection established"`" || info="`_ "connection failed"`"
write_string_param info "$info"

write_string_param iface "$(read_iface_option "$name" HOST)"
write_string_param login "$(read_ppp_option "$name" user)"

write_bool_param 'mppe' "$(read_ppp_option1 "$name" 'require-mppe' 'nomppe')"
}

start_connection()
{
ifup "$1"
}


stop_connection()
{
ifdown "$1"
}

write_connection()
{
[ "$1" = "/" ] && return
local name="/etc/net/ifaces/$1"

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

[ -n "$in_iface" ] && write_iface_option "$name" HOST "$in_iface"

[ -n "$in_login" ] && write_ppp_option "$name" user "$in_login"
[ -n "$in_password" ] && write_ppp_option "$name" password "$(echo "$in_password"|sed -e 's/["]/\\\\&/g')"

test_bool "$in_mppe"
write_ppp_option1 "$name" 'require-mppe' 'nomppe' "$?"
}

new_connection()
{
local name="/etc/net/ifaces/$1"

mkdir -p -- "$name"

write_iface_option "$name" TYPE ppp
write_iface_option "$name" ONBOOT yes
write_iface_option "$name" PPPTYPE pppoe
write_iface_option "$name" PPPPERSIST on
write_iface_option "$name" PPPMAXFAIL 0

# https://bugzilla.altlinux.org/show_bug.cgi?id=15603
cat>"$name/pppoptions"<<EOF
defaultroute
mtu 1476
usepeerdns
EOF
chmod o-rw "$name/pppoptions" # deny others reading the password
}

delete_connection()
{
[ "$1" = "/" ] && return
local name="/etc/net/ifaces/$1"

ifdown "$1"
rm -rf "$name"
}

on_message()
{
case "$in_action" in
list)
echo '('
case "$in__objects" in
avail_connection)
list_ppp 'pppoe'|write_enum
;;
avail_iface)
list_eth|write_enum
;;
avail_state)
write_enum_item "ignore" "`_ "don't change"`" #'
write_enum_item "start" "`_ "start"`"
write_enum_item "stop" "`_ "stop"`"
write_enum_item "restart" "`_ "restart"`"
;;
esac
echo ')'
;;
read)
echo '('
local name="$in_name"
[ -n "$in_new" ] && name="$in_new_name"
[ -n "$name" ] || name="$(list_ppp 'pppoe'|head -n1)"

write_string_param new_name "$(next_ppp)"
write_string_param name "$name"
[ -n "$name" ] && read_connection "$name"
echo ')'
;;
write)
if [ -n "$in_new" ];then
[ -n "$in_new_name" ] && new_connection "$in_new_name"
write_nop
elif [ -n "$in_delete" ];then
[ -n "$in_name" ] && delete_connection "$in_name"
write_nop
elif [ -n "$in_commit" ];then
[ -n "$in_name" ] && write_connection "$in_name"
case "$in_status" in
start) start_connection "$in_name";;
stop) stop_connection "$in_name";;
restart)
stop_connection "$in_name"
start_connection "$in_name"
;;
esac
write_nop
else
write_nop
fi
;;
*)
echo '#f'
;;
esac
}

message_loop
alterator-net-pppoe-0.6.1/templates/000075500000000000000000000000001111622063000174045ustar00rootroot00000000000000alterator-net-pppoe-0.6.1/templates/net-pppoe/000075500000000000000000000000001111622063000213135ustar00rootroot00000000000000alterator-net-pppoe-0.6.1/templates/net-pppoe/index.html000064400000000000000000000034161111622063000233140ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<script src="/design/scripts/submit.js"/>
<script src="/design/scripts/select.js"/>
</head>
<body>
<form method="POST" id="ajax-select">
<table>
<tr>
<input type="hidden" name="new_name"/>
<input type="submit" name="new" value="New connection..." class="btn"/>
<br/>
<hr/>
</tr>
<tr>
<td>
<select name="name" enumref="/net-pppoe/avail_connection" size="10" style="width:100px"/>
<br/>
<input type="submit" name="select" value="Select" class="btn"/>
</td>
<td>
<table class="form-table">
<tr>
<td><span translate="_">Status:</span></td>
<td>
<span class="alterator-label" name="info"/>
<select name="status" enumref="/net-pppoe/avail_state"/>
</td>
</tr>
<tr>
<td><span translate="_">Interface:</span></td>
<td><select name="iface" enumref="/net-pppoe/avail_iface"/></td>
</tr>
<tr>
<td><span translate="_">Account:</span></td>
<td><input type="text" class="text" name="login"/></td>
</tr>
<tr>
<td><span translate="_">Password:</span></td>
<td><input type="password" class="text" name="password"/></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="checkbox" name="mppe"/>
<span translate="_">MPPE encryption</span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" name="commit" value="Apply" class="btn"/>
<input type="submit" name="reset" value="Reset" class="btn"/>
&nbsp;&nbsp;
<input type="submit" name="delete" value="Delete connection" class="btn"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
alterator-net-pppoe-0.6.1/ui/000075500000000000000000000000001111622063000160235ustar00rootroot00000000000000alterator-net-pppoe-0.6.1/ui/net-pppoe/000075500000000000000000000000001111622063000177325ustar00rootroot00000000000000alterator-net-pppoe-0.6.1/ui/net-pppoe/index.scm000064400000000000000000000053521111622063000215520ustar00rootroot00000000000000(document:surround "/std/base")
(document:insert "/std/functions")

;;; Functions
(define *new-name* (make-cell "ppp0"))

(define (read-iface . args)
(woo-catch/message
(lambda()
(iface enumref "/net-pppoe/avail_iface")
(status-value enumref "/net-pppoe/avail_state")
(connections enumref "/net-pppoe/avail_connection")
(let ((data (apply woo-read-first "/net-pppoe/" args)))

(and (positive? (connections count))
(connections value (woo-get-option data 'name)))

(password value "")
(cell-set! *new-name* (woo-get-option data 'new_name))
(status-label text (woo-get-option data 'info))
(iface value (woo-get-option data 'iface))
(login value (woo-get-option data 'login))
(mppe value (woo-get-option data 'mppe))))))

(define (write-iface)
(woo-catch/message
(lambda()
(woo-write "/net-pppoe"
'commit #t
'name (connections value)
'status (status-value value)
'iface (iface value)
'login (login value)
'password (password value)
'mppe (mppe value)))))

(define (new-iface)
(woo-catch/message
(lambda()
(woo-write "/net-pppoe" 'new #t 'new_name (cell-ref *new-name*))
(read-iface 'new #t 'new_name (cell-ref *new-name*)))))

(define (delete-iface)
(let ((name (connections value)))
(and (not-empty-string? name)
(woo-catch/message
(lambda()
(woo-write "/net-pppoe/" 'delete #t 'name (connections value))
(read-iface))))))

;;; UI

(gridbox
columns "100"

(document:id new-button (button text (_ "New connection...")
align "left"
(when clicked (new-iface))))
(separator)

(splitbox
columns "30;70"
(document:id connections (listbox (when selected (read-iface 'name (connections value)))))
(gridbox
columns "0;100"
;;
(label text (_ "Status:") align "right")
(hbox align "left"
(document:id status-label (label))
(document:id status-value (combobox)))
;;
(label text (_ "Interface:") align "right")
(document:id iface (combobox widget-name "iface"))
;;
(label text (_ "Account:") align "right")
(document:id login (edit))
;;
(label text (_ "Password:") align "right")
(document:id password (edit "" echo "stars"))
;;
(spacer)
(document:id mppe (checkbox text (_ "MPPE encryption")))
;;
(label colspan 2)
;;
(spacer)
(hbox
align "left"
(document:id apply-button (button text (_ "Apply") (when clicked (write-iface))))
(document:id reset-button (button text (_ "Reset") (when clicked (read-iface 'name (or (connections value) "")))))
(label text " ")
(document:id del-button (button text (_ "Delete connection") (when clicked (delete-iface))))))))

;;; Logic
(document:root (when loaded (read-iface)))
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin