Sisyphus repository
Last update: 2 december 2020 | SRPMs: 17751 | Visits: 19737743
en ru br
ALT Linux repos
S:0.10.5-alt1
5.0: 0.8-alt2
4.1: 0.6-alt3.M41.4
4.0: 0.5.10-alt1.M40.1
+updates:0.5.2-alt1

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

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

alterator-net-pptp-0.5.10/000075500000000000000000000000001105526441400153375ustar00rootroot00000000000000alterator-net-pptp-0.5.10/Makefile000064400000000000000000000006561105526441400170060ustar00rootroot00000000000000NAME=net-pptp
DESCRIPTION="PPTP connections"

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-pptp/html-messages.scm
alterator-net-pptp-0.5.10/applications/000075500000000000000000000000001105526441400200255ustar00rootroot00000000000000alterator-net-pptp-0.5.10/applications/net-pptp.desktop000064400000000000000000000004251105526441400231700ustar00rootroot00000000000000[Desktop Entry]
Encoding=UTF-8
Type=Application
Categories=X-Alterator-Network
Icon=net-pptp
Terminal=false
Name=PPTP connections
Name[ru_RU]=PPTP-соединения
Name[uk_UA]=PPTP-з'єднання
X-Alterator-URI=/net-pptp
X-Alterator-Help=net-pptp
X-Alterator-Weight=20
alterator-net-pptp-0.5.10/backend3/000075500000000000000000000000001105526441400170115ustar00rootroot00000000000000alterator-net-pptp-0.5.10/backend3/net-pptp000075500000000000000000000227101105526441400205100ustar00rootroot00000000000000#!/bin/sh -ef

PATH=/usr/lib/alterator-net-common:$PATH
retries=3

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

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
echo "$name$value" >> "$file"
}

shell_swap_or_add()
{
local del="$1" && shift
local add="$1" && shift
local file="$1" && shift

[ -f "$file" ] || touch "$file"
/bin/sed -i "/^$add$/d" "$file"
if grep -qs "^$del" "$file"; then
/bin/sed -i "s,^$del$,$add," -- "$file"
return 0
fi
echo "$add" >> "$file"
}

################### debug

debug()
{
[ -n "$DEBUG" ] && echo $* >&2
}

################### interface helpers

# sleep order is on purpose: dhcp runs in background
start_iface()
{
[ -n "$1" ] || return
debug -n "start_iface[$1]: "
for i in `seq 1 $retries`; do
ifcheckup "$1" && break
ifup "$1"
sleep 1
debug -n "$i "
done
}

# if it's up, ensure it's down first, then back up
stop_iface()
{
[ -n "$1" ] || return
debug -n "stop_iface[$1]: "
for i in `seq 1 $retries`; do
debug -n "$i "
ifcheckup "$1" || break
ifdown "$1"
sleep 1
done
}

# do our best so that $1 is working
# FIXME: this should become redundant when etcnet gets fixed
# (https://bugzilla.altlinux.org/show_bug.cgi?id=14021)
bring_up()
{
[ -n "$1" ] || return
debug "bring_up[$1]"

# ensure underlying iface is up
start_iface "$in_iface"

# workaround: etcnet might try to bring up ppp too early
# when underlying eth is configured via dhcp and is down
sleep 1

# try to wait until ppp0 might go down (otherwise
# additional static route might not appear)
stop_iface "$1"
start_iface "$1"
}

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

first_available()
{
local path="/etc/net/ifaces/ppp"
local i=1 # not to interfere with dialup ppp0
while true; do
[ -d "$path$i" ] || { echo "ppp$i" && break; }
i=$(($i + 1))
done
}

ppp0_if_there()
{
# FIXME: it's a kluge // mike on 20080422
# if ppp0 is dialer-initiated, not static iface (pptp/pppoe)
# then echo it too
ip li sh \
| grep -q ": ppp0: " \
&& [ ! -d /etc/net/ifaces/ppp0 ] \
&& echo '("ppp0")'
}

list_iface()
{
echo '('
for i in `find /etc/net/ifaces -type d -name 'ppp*'`
do
[ -f $i/options ] &&
grep -qs 'PPPTYPE=pptp' $i/options &&
echo "(\"`basename $i`\")"
done
echo ')'
}

list_eth()
{
echo '('
iflist|
while read name mac;do
printf '("%s")' "$name"
done
# FIXME: add ppp0 in case it's active: customer needs PPTP over PPP
ppp0_if_there
echo ')'
}

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

# mppe is off by default with pppd
local MPPE="#f"
grep -q '^require-mppe' "$name/pppoptions" && MPPE="#t"

# we prefer it to work by default, at least when already configured
# and for just created interfaces
local SAVE_GW="#t"
[ -x "$name/ifup-pre" -a -x "$name/ifdown-post" ] || SAVE_GW="#f"

# usually default route needs to be replaced
# /etc/ppp/options should hold "replacedeaultroute",
# $name/pppoptions should hold "defaultroute" then; see pppd(8)
local DEF_VIA_VPN="#t"
grep -q '^nodefaultroute' "$name/pppoptions" && DEF_VIA_VPN="#f"

local PERSIST="#f"
grep -q '^persist' "$name/pppoptions" && PERSIST="#t"

echo '('

local info=
ifcheckup "$1" && info="`_ "connection established"`" || info="`_ "connection down"`"
printf 'info "%s"' "$info"
printf 'def_via_vpn %s' "$DEF_VIA_VPN"
printf 'save_route %s' "$SAVE_GW"
printf 'mppe %s' "$MPPE"
printf 'persist %s' "$PERSIST"

( PPTP_SERVER=
REQUIRES=
. $name/options

printf 'server "%s"' "$PPTP_SERVER"
printf 'iface "%s"' "$REQUIRES"
printf 'login "%s"' "$(grep '^user' "$name/pppoptions"|sed -r 's,user[[:space:]]*,,')"
printf 'onboot %s' "$ONBOOT" # FIXME: "no" problem?

)

echo ')'
}

write_iface()
{
[ "$1" = "/" ] && return
local name="/etc/net/ifaces/$1"
local prev_login="$(grep '^user' "$name/pppoptions"|sed -r 's,user[[:space:]]*,,')"
[ "$in_onboot" = "#t" ] && in_onboot="yes" || in_onboot="no"
[ -d "$name" ] || mkdir "$name"
[ -f "$name/options" ] || touch "$name/options"
[ -f "$name/pppoptions" ] || touch "$name/pppoptions"
[ -n "$in_server" ] && shell_add_or_subst "PPTP_SERVER=" "$in_server" "$name/options"
# e.g. ppp0 might be a dynamic dial-up interface
[ -f "/etc/net/ifaces/$in_iface/options" ] && shell_add_or_subst "REQUIRES=" "$in_iface" "$name/options"
[ -n "$in_iface" ] && shell_add_or_subst "ONBOOT=" "$in_onboot" "$name/options"

if [ -n "$in_login" ]; then
sed -r "s,^user[[:space:]].*,user $in_login," -i "$name/pppoptions"
prev_login="$in_login"
fi
if [ -n "$in_password" ]; then
in_password=$(echo "$in_password"|sed -e 's/["]/\\\\&/g')
chmod o-rw "$name/pppoptions"
sed -r "s,^password[[:space:]].*,password $in_password," -i "$name/pppoptions"
fi

set_mppe
save_default_gw
replace_defroute
set_persist

[ "$in_onboot" = "yes" ] && bring_up "$1"
return 0
}

new_iface()
{
local name="/etc/net/ifaces/$1"
in_password=$(echo "$in_password"|sed -e 's/["]/\\\\&/g')
[ "$in_onboot" = "#t" ] && in_onboot="yes" || in_onboot="no"

[ -d "$name" ] || mkdir "$name"
[ -f "$name/options" ] || touch "$name/options"
[ -f "$name/pppoptions" ] || touch "$name/pppoptions"

# deny others reading the password
chmod o-rw "$name/pppoptions"
shell_add_or_subst "ONBOOT=" "$in_onboot" "$name/options"
shell_add_or_subst "PPPTYPE=" "pptp" "$name/options"
shell_add_or_subst "PPTP_SERVER=" "$in_server" "$name/options"
shell_add_or_subst "REQUIRES=" "$in_iface" "$name/options"

shell_add_or_subst "user " "$in_login" "$name/pppoptions"
shell_add_or_subst "password " "$in_password" "$name/pppoptions"

#shell_add_or_subst "defaultroute" "" "$name/pppoptions"

# vsu@ proposed that nodeflate, nobsdcomp be disabled
# by default after debugging a problem in community@
shell_add_or_subst "nodeflate" "" "$name/pppoptions"
shell_add_or_subst "nobsdcomp" "" "$name/pppoptions"
# ras.fastiv.net: ping would work, http wouldn't
shell_add_or_subst "novj" "" "$name/pppoptions"
shell_add_or_subst "novjccomp" "" "$name/pppoptions"
# ...and that mtu be clamped at 1460 or 1400
shell_add_or_subst "mtu " "1400" "$name/pppoptions"

# https://bugzilla.altlinux.org/show_bug.cgi?id=14116
shell_add_or_subst "usepeerdns" "" "$name/pppoptions"

set_mppe
save_default_gw
replace_defroute
set_persist

[ "$in_onboot" = "yes" ] && bring_up "$1"
return 0
}


delete_iface()
{
[ "$1" = "/" ] && return
local name="/etc/net/ifaces/$1"
local prev_login="$(grep '^user' "$name/pppoptions"|sed -r 's,user[[:space:]]*,,')"

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

set_mppe()
{
# no mppe by default
if [ "$in_mppe" = "#t" ]; then
shell_swap_or_add "nomppe" "require-mppe" "$name/pppoptions"
else
shell_swap_or_add "require-mppe" "nomppe" "$name/pppoptions"
fi
}

save_default_gw()
{
[ "$in_save_route" = "#f" ] && {
[ -x "$name/ifdown-post" ] && "$name/ifdown-post"
rm -f "$name/ifup-pre" "$name/ifdown-post"
return
}
DEF_GW="`/sbin/ip ro | awk '/^default via/ { print $3; exit; }'`"
[ -n "$DEF_GW" ] || return
[ "$DEF_GW" != "$in_server" ] || return
echo -e "#!/bin/sh
ip route add $in_server via $DEF_GW" > "$name/ifup-pre"
echo -e "#!/bin/sh
ip route del $in_server via $DEF_GW" > "$name/ifdown-post"
chmod +x "$name/ifup-pre" "$name/ifdown-post"
}

replace_defroute()
{
# replace by default
if [ "$in_def_via_vpn" = "#f" ]; then
shell_swap_or_add "defaultroute" "nodefaultroute" "$name/pppoptions"
else
shell_swap_or_add "nodefaultroute" "defaultroute" "$name/pppoptions"
fi
}

set_persist()
{
# nopersist by default
if [ "$in_persist" = "#t" ]; then
shell_swap_or_add "nopersist" "persist" "$name/pppoptions"
else
shell_swap_or_add "persist" "nopersist" "$name/pppoptions"
fi
}

start_connection()
{
debug "start_connection: [$1]"
[ -z "$1" -o "$1" = "/" ] && return
bring_up "$1"
debug "start_connection: $?"
}

stop_connection()
{
debug "stop_connection: [$1]"
[ -z "$1" -o "$1" = "/" ] && return
stop_iface "$1"
debug "stop_connection: $?"
}

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

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

on_message()
{
case "$in_action" in
##information
constraints)
local required="$([ "$in_orig_action" = "new" ] && echo "#t" || echo "#f")"
echo '('
printf 'server (required #t match ("^[[:alnum:].-]+$" "%s") label "%s")' \
"$(_ "invalid server name")" "$(_ "Server")"
printf 'iface (required #t label "%s")' \
"$(_ "Walk through interface")"
printf 'login (required #t label "%s")' \
"`_ "Login"`"
printf 'name (required %s match ("^ppp[0-9]+$" "%s") default "%s" label "%s")' \
"$required" \
"`_ "should be ppp[number]"`" \
"$(first_available)" \
"`_ "Connection"`"
printf 'password (required %s label "%s")' \
"$required" \
"`_ "Password"`"
echo ')'
;;
##actions
list)
if [ "$in__objects" = "/" ]; then
list_iface
else
list_eth
fi
;;
read)
if [ "$in__objects" = "/" ]; then
echo '()'
else
read_iface "$in__objects"
fi
;;
write)
case "$in_what" in
start)
start_connection "$in_name";;
stop)
stop_connection "$in_name";;
*)
write_iface "$in__objects";;
esac
echo '()'
;;
new)
if new_iface "$in_name"; then
echo '()'
else
printf '(error "%s")' "`_ "same login name already in use"`"
fi
;;
delete)
delete_iface "$in__objects"
echo '()'
;;
*)
echo '#f'
;;
esac
}

message_loop

alterator-net-pptp-0.5.10/backend3/template-net-pptp000075500000000000000000000005571105526441400223260ustar00rootroot00000000000000#!/bin/sh

#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-pptp.html"'
echo ')'
else
echo '#f'
fi
;;
*)
echo '#f'
esac
}


message_loop

alterator-net-pptp-0.5.10/help/000075500000000000000000000000001105526441400162675ustar00rootroot00000000000000alterator-net-pptp-0.5.10/help/ru_RU/000075500000000000000000000000001105526441400173235ustar00rootroot00000000000000alterator-net-pptp-0.5.10/help/ru_RU/net-pptp.html000064400000000000000000000022471105526441400217650ustar00rootroot00000000000000<!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>PPTP-соединения</h2>
<p><em>PPTP</em> (Point-to-point tunneling protocol)&nbsp;&mdash; протокол
для организации прямого соединения между двумя машинами в
сети. Для создания нового соединения необходимо указать адрес удалённого PPTP-сервера,
а также имя пользователя и пароль на этом сервере. Также
необходимо выбрать, через какой <em>IP-интерфейс</em> будет происходить
соединение &mdash; это требуется для корректной инициализации сетевой подсистемы.
</p>
<p>Имена для PPTP-соединений принято назначать в формате <em>ppp[номер]</em>.</p>
</body>
</html>
alterator-net-pptp-0.5.10/help/uk_UA/000075500000000000000000000000001105526441400172735ustar00rootroot00000000000000alterator-net-pptp-0.5.10/help/uk_UA/net-pptp.html000064400000000000000000000023311105526441400217270ustar00rootroot00000000000000<!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>PPTP-з'єднання</h2>
<p><em>PPTP</em> (Point-to-point tunneling
protocol)&nbsp;&mdash; протокол для організації прямого
з'єднання між двома комп'ютерами в мережі. Для створення
нового з'єднання необхідно вказати адресу віддаленого
PPTP-сервера, а також ім'я користувача та пароль на цьому
сервері. Також необхідно вибрати, через
який <em>IP-інтерфейс</em> буде виконуватися з'єднання
&mdash; це необхідно для коректної ініціалізації мережевої
підсистеми.
</p>
<p>Імена для PPTP-з'єднань прийнято призначати у форматі <em>ppp[номер]</em>.</p>
</body>
</html>
alterator-net-pptp-0.5.10/html/000075500000000000000000000000001105526441400163035ustar00rootroot00000000000000alterator-net-pptp-0.5.10/html/fbi/000075500000000000000000000000001105526441400170435ustar00rootroot00000000000000alterator-net-pptp-0.5.10/html/fbi/net-pptp.html000064400000000000000000000036631105526441400215100ustar00rootroot00000000000000<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<!--pptp connections module -->
<html>
<head>
<title>PPTP connections - 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="_">PPTP connections</span></h1>
<form method="POST" class="selector-chooser" id="ajax-selector">
<label for="name">name</label>
<span class="selector" >
<select name="name"/>
<input type="submit" name="card-index-select" value="Select" class="btn"/>
</span>
<span class="selector-actions">
<input type="submit" name="card-index-new" value="New connection" class="btn"/>
<input type="submit" name="card-index-delete" value="Delete connection" class="btn"/>
</span>
</form>
<hr/>
<form method="POST" class="selector-data">
<div class="selector-name">
<label for="name">name</label>
<input type="text" name="name" class="text"/>
</div>
<span class="alterator-label" name="info"/>
<br/>
<br/>
<table>
<tbody>
<tr>
<td><label for="server">server</label></td>
<td><input type="text" name="server" class="text"/></td>
</tr>
<tr>
<td><label for="login">login</label></td>
<td><input type="text" name="login" class="text"/></td>
</tr>
<tr>
<td><label for="password">password</label></td>
<td><input type="password" name="password" class="text"/></td>
</tr>
<tr>
<td><label for="iface">iface</label></td>
<td><select name="iface" optionlist="avail_ifaces"></select></td>
</tr>
</tbody>
</table>
<input type="submit" name="card-index-apply" value="Apply" class="btn"/>
<input type="reset" name="card-index-reset" value="Reset" class="btn"/>
</form>
</body>
</html>
alterator-net-pptp-0.5.10/po/000075500000000000000000000000001105526441400157555ustar00rootroot00000000000000alterator-net-pptp-0.5.10/po/alterator-net-pptp.pot000064400000000000000000000053741105526441400222540ustar00rootroot00000000000000# 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-03-04 16:59+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"

#. message from shell backend
#: ui/net-pptp/html-messages.scm:2 backend3/net-pptp:337
msgid "should be ppp[number]"
msgstr ""

#: ui/net-pptp/html-messages.scm:3 backend3/net-pptp:330
msgid "invalid server name"
msgstr ""

#: ui/net-pptp/html-messages.scm:4 ui/net-pptp/index.scm:42
#: backend3/net-pptp:330
msgid "Server"
msgstr ""

#: ui/net-pptp/html-messages.scm:5 ui/net-pptp/index.scm:57
#: backend3/net-pptp:332
msgid "Walk through interface"
msgstr ""

#: ui/net-pptp/html-messages.scm:6 ui/net-pptp/index.scm:47
#: backend3/net-pptp:334
msgid "Login"
msgstr ""

#: ui/net-pptp/html-messages.scm:7 ui/net-pptp/index.scm:11
#: backend3/net-pptp:339
msgid "Connection"
msgstr ""

#: ui/net-pptp/html-messages.scm:8 ui/net-pptp/index.scm:52
#: backend3/net-pptp:342
msgid "Password"
msgstr ""

#: ui/net-pptp/html-messages.scm:9
msgid "PPTP connections"
msgstr ""

#: ui/net-pptp/html-messages.scm:10
msgid "PPTP connections administration"
msgstr ""

#: ui/net-pptp/html-messages.scm:11
msgid "Select"
msgstr ""

#: ui/net-pptp/html-messages.scm:12
msgid "New connection"
msgstr ""

#: ui/net-pptp/html-messages.scm:13
msgid "Delete connection"
msgstr ""

#: ui/net-pptp/html-messages.scm:14 backend3/net-pptp:375
msgid "same login name already in use"
msgstr ""

#: ui/net-pptp/html-messages.scm:15
msgid "Network"
msgstr ""

#: ui/net-pptp/index.scm:19
msgid "Start"
msgstr ""

#: ui/net-pptp/index.scm:20
msgid "Stop"
msgstr ""

#: ui/net-pptp/index.scm:21
msgid "Delete"
msgstr ""

#: ui/net-pptp/index.scm:22
msgid "Create new"
msgstr ""

#: ui/net-pptp/index.scm:62
msgid "Default route via VPN"
msgstr ""

#: ui/net-pptp/index.scm:67
msgid "Save route to VPN gateway"
msgstr ""

#: ui/net-pptp/index.scm:72
msgid "MPPE encryption"
msgstr ""

#: ui/net-pptp/index.scm:77
msgid "Redial on hangup"
msgstr ""

#: ui/net-pptp/index.scm:82
msgid "Start at boot"
msgstr ""

#: ui/net-pptp/index.scm:88
msgid "Apply"
msgstr ""

#: ui/net-pptp/index.scm:89
msgid "Reset"
msgstr ""

#: ui/net-pptp/index.scm:90
msgid "Quit"
msgstr ""

#: ui/net-pptp/index.scm:225
msgid "<small>(connecting...)</small>"
msgstr ""

#: backend3/net-pptp:152
msgid "connection established"
msgstr ""

#: backend3/net-pptp:152
msgid "connection down"
msgstr ""
alterator-net-pptp-0.5.10/po/ru.po000064400000000000000000000070611105526441400167470ustar00rootroot00000000000000# 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-03-04 16:59+0300\n"
"PO-Revision-Date: 2008-01-15 20:34+0300\n"
"Last-Translator: Michael Shigorin <mike@altlinux.org>\n"
"Language-Team: Russian <ru@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. message from shell backend
#: ui/net-pptp/html-messages.scm:2 backend3/net-pptp:337
msgid "should be ppp[number]"
msgstr "должно быть ppp[номер]"

#: ui/net-pptp/html-messages.scm:3 backend3/net-pptp:330
msgid "invalid server name"
msgstr "неверное имя сервера"

#: ui/net-pptp/html-messages.scm:4 ui/net-pptp/index.scm:42
#: backend3/net-pptp:330
msgid "Server"
msgstr "Сервер"

#: ui/net-pptp/html-messages.scm:5 ui/net-pptp/index.scm:57
#: backend3/net-pptp:332
msgid "Walk through interface"
msgstr "Опорный интерфейс"

#: ui/net-pptp/html-messages.scm:6 ui/net-pptp/index.scm:47
#: backend3/net-pptp:334
msgid "Login"
msgstr "Логин"

#: ui/net-pptp/html-messages.scm:7 ui/net-pptp/index.scm:11
#: backend3/net-pptp:339
msgid "Connection"
msgstr "Соединение"

#: ui/net-pptp/html-messages.scm:8 ui/net-pptp/index.scm:52
#: backend3/net-pptp:342
msgid "Password"
msgstr "Пароль"

#: ui/net-pptp/html-messages.scm:9
msgid "PPTP connections"
msgstr "PPTP-соединения"

#: ui/net-pptp/html-messages.scm:10
msgid "PPTP connections administration"
msgstr "Управление PPTP-соединениями"

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

#: ui/net-pptp/html-messages.scm:12
msgid "New connection"
msgstr "Создать соединение"

#: ui/net-pptp/html-messages.scm:13
msgid "Delete connection"
msgstr "Удалить соединение"

#: ui/net-pptp/html-messages.scm:14 backend3/net-pptp:375
msgid "same login name already in use"
msgstr "этот логин уже используется"

#: ui/net-pptp/html-messages.scm:15
msgid "Network"
msgstr "Сеть"

#: ui/net-pptp/index.scm:19
msgid "Start"
msgstr "Старт"

#: ui/net-pptp/index.scm:20
msgid "Stop"
msgstr "Стоп"

#: ui/net-pptp/index.scm:21
msgid "Delete"
msgstr "Удалить"

#: ui/net-pptp/index.scm:22
msgid "Create new"
msgstr "Создать"

#: ui/net-pptp/index.scm:62
msgid "Default route via VPN"
msgstr "Маршрут по умолчанию через VPN"

#: ui/net-pptp/index.scm:67
msgid "Save route to VPN gateway"
msgstr "Сохранить маршрут к VPN-серверу"

#: ui/net-pptp/index.scm:72
msgid "MPPE encryption"
msgstr "Шифрование MPPE"

#: ui/net-pptp/index.scm:77
msgid "Redial on hangup"
msgstr "Перезвонить при обрыве"

#: ui/net-pptp/index.scm:82
msgid "Start at boot"
msgstr "Запускать при загрузке"

#: ui/net-pptp/index.scm:88
msgid "Apply"
msgstr "Применить"

#: ui/net-pptp/index.scm:89
msgid "Reset"
msgstr "Сброс"

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

#: ui/net-pptp/index.scm:225
msgid "<small>(connecting...)</small>"
msgstr "<small>(соединение устанавливается...)</small>"

#: backend3/net-pptp:152
msgid "connection established"
msgstr "соединение установлено"

#: backend3/net-pptp:152
msgid "connection down"
msgstr "нет соединения"
alterator-net-pptp-0.5.10/po/uk.po000064400000000000000000000070741105526441400167440ustar00rootroot00000000000000# 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-03-04 16:59+0300\n"
"PO-Revision-Date: 2008-01-15 20:34+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"

#. message from shell backend
#: ui/net-pptp/html-messages.scm:2 backend3/net-pptp:337
msgid "should be ppp[number]"
msgstr "має бути ppp[номер]"

#: ui/net-pptp/html-messages.scm:3 backend3/net-pptp:330
msgid "invalid server name"
msgstr "невірне ім'я сервера"

#: ui/net-pptp/html-messages.scm:4 ui/net-pptp/index.scm:42
#: backend3/net-pptp:330
msgid "Server"
msgstr "Сервер"

#: ui/net-pptp/html-messages.scm:5 ui/net-pptp/index.scm:57
#: backend3/net-pptp:332
msgid "Walk through interface"
msgstr "Базовий інтерфейс"

#: ui/net-pptp/html-messages.scm:6 ui/net-pptp/index.scm:47
#: backend3/net-pptp:334
msgid "Login"
msgstr "Логін"

#: ui/net-pptp/html-messages.scm:7 ui/net-pptp/index.scm:11
#: backend3/net-pptp:339
msgid "Connection"
msgstr "З'єднання"

#: ui/net-pptp/html-messages.scm:8 ui/net-pptp/index.scm:52
#: backend3/net-pptp:342
msgid "Password"
msgstr "Пароль"

#: ui/net-pptp/html-messages.scm:9
msgid "PPTP connections"
msgstr "PPTP-з'єднання"

#: ui/net-pptp/html-messages.scm:10
msgid "PPTP connections administration"
msgstr "Керування PPTP-з'єднаннями"

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

#: ui/net-pptp/html-messages.scm:12
msgid "New connection"
msgstr "Створити з'єднання"

#: ui/net-pptp/html-messages.scm:13
msgid "Delete connection"
msgstr "Видалити з'єднання"

#: ui/net-pptp/html-messages.scm:14 backend3/net-pptp:375
msgid "same login name already in use"
msgstr "даний логін вже використовується"

#: ui/net-pptp/html-messages.scm:15
msgid "Network"
msgstr "Мережа"

#: ui/net-pptp/index.scm:19
msgid "Start"
msgstr "Старт"

#: ui/net-pptp/index.scm:20
msgid "Stop"
msgstr "Стоп"

#: ui/net-pptp/index.scm:21
msgid "Delete"
msgstr "Видалити"

#: ui/net-pptp/index.scm:22
msgid "Create new"
msgstr "Створити"

#: ui/net-pptp/index.scm:62
msgid "Default route via VPN"
msgstr "Типовий маршрут через VPN"

#: ui/net-pptp/index.scm:67
msgid "Save route to VPN gateway"
msgstr "Зберегти маршрут до VPN-серверу"

#: ui/net-pptp/index.scm:72
msgid "MPPE encryption"
msgstr "Шифрування MPPE"

#: ui/net-pptp/index.scm:77
msgid "Redial on hangup"
msgstr "Передзвонити при роз'єднанні"

#: ui/net-pptp/index.scm:82
msgid "Start at boot"
msgstr "Запускати при завантаженні"

#: ui/net-pptp/index.scm:88
msgid "Apply"
msgstr "Застосувати"

#: ui/net-pptp/index.scm:89
msgid "Reset"
msgstr "Скинути"

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

#: ui/net-pptp/index.scm:225
msgid "<small>(connecting...)</small>"
msgstr "<small>(з'єднання встановлюється...)</small>"

#: backend3/net-pptp:152
msgid "connection established"
msgstr "з'єднання встановлене"

#: backend3/net-pptp:152
msgid "connection down"
msgstr "немає з'єднання"
alterator-net-pptp-0.5.10/simple.layout000064400000000000000000000004421105526441400200670ustar00rootroot00000000000000(use-modules (alterator transport server-socket)
(alterator transport pipe-channel)
(alterator transport std-channel))

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

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

alterator-net-pptp-0.5.10/simple.smap000064400000000000000000000000471105526441400175130ustar00rootroot00000000000000(include "*.map")

(/ view /net-pptp)

alterator-net-pptp-0.5.10/ui/000075500000000000000000000000001105526441400157545ustar00rootroot00000000000000alterator-net-pptp-0.5.10/ui/net-pptp/000075500000000000000000000000001105526441400175235ustar00rootroot00000000000000alterator-net-pptp-0.5.10/ui/net-pptp/html-messages.scm000064400000000000000000000005241105526441400230010ustar00rootroot00000000000000;; message from shell backend
(_ "should be ppp[number]")
(_ "invalid server name")
(_ "Server")
(_ "Walk through interface")
(_ "Login")
(_ "Connection")
(_ "Password")
(_ "PPTP connections")
(_ "PPTP connections administration")
(_ "Select")
(_ "New connection")
(_ "Delete connection")
(_ "same login name already in use")
(_ "Network")
alterator-net-pptp-0.5.10/ui/net-pptp/index.scm000064400000000000000000000173641105526441400213510ustar00rootroot00000000000000(document:surround "/std/base")
(document:insert "/std/functions")

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

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

(gridbox columns "10;50;50;10"
;;
(spacer)
(label (_ "Connection") align "right")
(hbox (document:id connections (combobox))
(document:id name (edit "" invisible widget-name "name")))
(spacer)


;;
(spacer)
(hbox (document:id start-button (button (_ "Start")))
(document:id stop-button (button (_ "Stop")))
(document:id del-button (button (_ "Delete"))))
(document:id new-button (button (_ "Create new")))
(spacer)


;;
(spacer)
(separator)
(separator)
(spacer)


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


;;
(spacer)
(label (bold (_ "Server")) align "right")
(document:id server (edit "" widget-name "server"))
(spacer)
;;
(spacer)
(label (bold (_ "Login")) align "right")
(document:id login (edit "" widget-name "login"))
(spacer)
;;
(spacer)
(label (bold (_ "Password")) align "right")
(document:id password (edit "" echo stars widget-name "password"))
(spacer)
;;
(spacer)
(label (bold (_ "Walk through interface")) align "right")
(document:id iface (combobox widget-name "iface"))
(spacer)
;;
(spacer)
(label (_ "Default route via VPN"))
(document:id def-via-vpn (checkbox "" widget-name "def-via-vpn"))
(spacer)
;;
(spacer)
(label (_ "Save route to VPN gateway"))
(document:id save-route (checkbox "" widget-name "save-route"))
(spacer)
;;
(spacer)
(label (_ "MPPE encryption") align "right")
(document:id mppe (checkbox "" widget-name "mppe"))
(spacer)
;;
(spacer)
(label (_ "Redial on hangup") align "right")
(document:id persist (checkbox "" widget-name "persist"))
(spacer)
;;
(spacer)
(label (_ "Start at boot") align "right")
(document:id onboot (checkbox "" widget-name "onboot"))
(spacer))

(hbox
align "center"
(document:id apply-button (button (_ "Apply")))
(document:id reset-button (button (_ "Reset")))
(document:id quit-button (button (_ "Quit") )))


;;;;;;;;;;;;;;;;;;;;;;
(define (go-new)
(cell-set! new-mode #t)
(name visibility #t)
(connections invisible)
; (format #t "go-new: editables-active~%")
(editables-active #t)
(update-constraints "new" "/net-pptp"))

(define (go-edit)
(cell-set! new-mode #f)
(name invisible)
(connections visibility #t)
; (format #t "go-edit: editables-active~%")
(editables-active #t)
(update-constraints "write" "/net-pptp"))

;;;;;;;;;;;;;;;;;;;;;;
(define gates (woo-list-names "/net-pptp/pppX/avail_ifaces"))
(define new-mode (make-cell #f))

(define (editables-active act)
; (format #t "editables-active: ~S~%" act)
((widgets connections server login password iface
def-via-vpn save-route mppe persist onboot
start-button stop-button del-button apply-button reset-button)
activity act))

(define (update-connection name)
(let ((data (woo-read-first (string-append "/net-pptp/" name))))
(info text (string-append "<small>(" (woo-get-option data 'info) ")</small>" ))
(server text (woo-get-option data 'server))
(def-via-vpn state (woo-get-option data 'def_via_vpn))
(save-route state (woo-get-option data 'save_route))
(persist state (woo-get-option data 'persist))
(onboot state (woo-get-option data 'onboot))
(mppe state (woo-get-option data 'mppe))
(login text (woo-get-option data 'login))
(password text "")
(iface current (or (string-list-index (woo-get-option data 'iface) gates) 0))))

(define (call-update-connection)
(format #t "call-update-connection~%")
; (format #t "call-update-connection: editables-active~%")
(editables-active (> (connections count) 0))
(and (> (connections count) 0)
(connections current 0 selected)))

; tell backend to modify existing connection
(define (write-connection name)
(woo-catch/message
(thunk
(let ((pwd (password text)))
(apply woo-write/constraints (string-append "/net-pptp/" name)
'server (server text)
'def_via_vpn (def-via-vpn state)
'save_route (save-route state)
'persist (persist state)
'onboot (onboot state)
'mppe (mppe state)
'iface (iface text)
'login (login text)
(if (not-empty-string? pwd) (list 'password pwd) '()))))))

; tell backend to create new connection
(define (new-connection name)
(and
(woo-catch/message
(thunk
(woo-new/constraints "/net-pptp/"
'name name
'server (server text)
'def_via_vpn (def-via-vpn state)
'save_route (save-route state)
'persist (persist state)
'onboot (onboot state)
'mppe (mppe state)
'iface (iface text)
'login (login text)
'password (password text))
(connections append-row name
current (connections count))
#t))
(go-edit)))

(define (delete-connection name)
(woo-delete (string-append "/net-pptp/" name))
;(format #t "delete-connections=~S,~S~%" (connections current) (connections text))
(connections remove (connections current))
;(format #t "delete-connections=~S,~S~%" (connections current) (connections text))
)

(define (get-number x)
(string->number (substring x 3 (string-length x))))

(define (first-available)
(cond-plistq
'name
(process-defaults (read-constraints "new" "/net-pptp" '()) '())
""))

(define (clear-connection)
;;clear fields
((widgets name server login password info)
text "")
(def-via-vpn state #t)
(save-route state #t)
(persist state #f)
(onboot state #f)
(mppe state #f)
(iface current 0)
(name text (first-available)))

; 'what is "start"/"stop"; 'action is already taken :)
(define (do-connection what name)
;(format #t "do-connection: what: ~S, name: ~S~%" what name)
(woo-write (string-append "/net-pptp/" name)
'name name
'what what
'iface (iface text))
(update-connection name))

;;;;;;;;;;;;;;;;;;;;;;;
(connections (when selected
(update-connection (connections text))))

; http://wiki.sisyphus.ru/admin/etcnet#vpn
(def-via-vpn (when toggled
(if (def-via-vpn state)
(save-route state #t))))

(apply-button (when clicked
(info text (_ "<small>(connecting...)</small>"))
(if (cell-ref new-mode)
(new-connection (name text))
(write-connection (connections text)))
(update-connection (connections text))))

(quit-button (when clicked
(document:end)))

(reset-button (when clicked
(if (cell-ref new-mode)
(clear-connection)
(and (>= (connections current) 0)
(connections selected)))))

(start-button (when clicked
(if (cell-ref new-mode)
(apply-button clicked)
(do-connection "start" (connections text)))))

(stop-button (when clicked
(do-connection "stop" (connections text))))

(new-button (when clicked
(go-new)
(clear-connection)
(editables-active #t)))

(del-button (when clicked
(if (cell-ref new-mode)
(go-edit)
(delete-connection (connections text)))
(clear-connection)
(call-update-connection)))

;;;;;;;;;;;;;;;;;;;;;;;
(iface rows gates current 0)
(connections rows (woo-list-names "/net-pptp"))
(call-update-connection)

(document:root
(when loaded
(update-constraints "write" "/net-pptp")))
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin