branches/luci-0.8: remove bitrot

This commit is contained in:
Jo-Philipp Wich
2008-12-23 21:57:11 +00:00
parent 4081526ba7
commit 293173f1a8
206 changed files with 18184 additions and 258 deletions

View File

@@ -1,4 +0,0 @@
#!/bin/sh
[ -n "${IPKG_INSTROOT}" ] || {
( . /etc/uci-defaults/luci-community-augsburg ) && rm -f /etc/uci-defaults/luci-community-augsburg
}

View File

@@ -1,16 +0,0 @@
#!/bin/sh
uci batch <<-EOF
set freifunk.community.name='Freifunk Augsburg'
set freifunk.community.homepage=http://augsburg.freifunk.net
set freifunk.community.essid=augsburg.freifunk.net
set freifunk.community.bssid=02:CA:FF:EE:BA:BE
set freifunk.community.channel=1
set freifunk.community.net=191.161.0.0
set freifunk.community.mask=255.255.0.0
set freifunk.community.dns='88.198.178.18 141.54.1.1 212.204.49.83 208.67.220.220 208.67.222.222'
set luci.main.mediaurlbase=/luci-static/fledermaus
set luci.main.lang=de
commit freifunk
commit luci
EOF

View File

@@ -1,4 +0,0 @@
#!/bin/sh
[ -n "${IPKG_INSTROOT}" ] || {
( . /etc/uci-defaults/luci-community-berlin ) && rm -f /etc/uci-defaults/luci-community-berlin
}

View File

@@ -1,16 +0,0 @@
#!/bin/sh
uci batch <<-EOF
set freifunk.community.name='Freifunk Berlin'
set freifunk.community.homepage=http://berlin.freifunk.net
set freifunk.community.essid=olsr.freifunk.net
set freifunk.community.bssid=02:CA:FF:EE:BA:BE
set freifunk.community.channel=10
set freifunk.community.net=104.0.0.0
set freifunk.community.mask=255.0.0.0
set freifunk.community.dns='88.198.178.18 141.54.1.1 212.204.49.83 208.67.220.220 208.67.222.222'
set luci.main.mediaurlbase=/luci-static/fledermaus
set luci.main.lang=de
commit freifunk
commit luci
EOF

View File

@@ -1,4 +0,0 @@
#!/bin/sh
[ -n "${IPKG_INSTROOT}" ] || {
( . /etc/uci-defaults/luci-community-halle ) && rm -f /etc/uci-defaults/luci-community-halle
}

View File

@@ -1,19 +0,0 @@
#!/bin/sh
uci batch <<-EOF
set freifunk.community.name='Freifunk Halle'
set freifunk.community.homepage=http://halle.freifunk.net
set freifunk.community.essid=halle.freifunk.net
set freifunk.community.bssid=02:CA:FF:EE:BA:BE
set freifunk.community.realm=pool.freifunk-halle.net
set freifunk.community.channel=1
set freifunk.community.net=104.0.0.0
set freifunk.community.mask=255.0.0.0
set freifunk.community.dhcp=10.0.0.0
set freifunk.community.dhcpmask=255.255.255.0
set freifunk.community.dns='88.198.178.18 141.54.1.1 212.204.49.83 208.67.220.220 208.67.222.222'
set luci.main.mediaurlbase=/luci-static/fledermaus
set luci.main.lang=de
commit freifunk
commit luci
EOF

View File

@@ -1,4 +0,0 @@
#!/bin/sh
[ -n "${IPKG_INSTROOT}" ] || {
( . /etc/uci-defaults/luci-community-hannover ) && rm -f /etc/uci-defaults/luci-community-hannover
}

View File

@@ -1,16 +0,0 @@
#!/bin/sh
uci batch <<-EOF
set freifunk.community.name='Freifunk Hannover'
set freifunk.community.homepage=http://www.freifunk-hannover.de
set freifunk.community.essid=hannover.freifunk.net
set freifunk.community.bssid=CA:FF:EE:CA:FF:EE
set freifunk.community.realm=db.freifunk-hannover.de
set freifunk.community.channel=1
set freifunk.community.net=10.2.0.0
set freifunk.community.mask=255.255.0.0
set luci.main.mediaurlbase=/luci-static/fledermaus
set luci.main.lang=de
commit freifunk
commit luci
EOF

View File

@@ -1,4 +0,0 @@
#!/bin/sh
[ -n "${IPKG_INSTROOT}" ] || {
( . /etc/uci-defaults/luci-community-leipzig ) && rm -f /etc/uci-defaults/luci-community-leipzig
}

View File

@@ -1,19 +0,0 @@
#!/bin/sh
uci batch <<-EOF
set freifunk.community.name='Freifunk Leipzig'
set freifunk.community.homepage=http://leipzig.freifunk.net
set freifunk.community.essid=leipzig.freifunk.net
set freifunk.community.bssid=02:CA:FF:EE:BA:BE
set freifunk.community.realm=db.leipzig.freifunk.net
set freifunk.community.channel=1
set freifunk.community.net=104.0.0.0
set freifunk.community.mask=255.0.0.0
set freifunk.community.dhcp=10.0.0.0
set freifunk.community.dhcpmask=255.255.255.0
set freifunk.community.dns='88.198.178.18 141.54.1.1 212.204.49.83 208.67.220.220 208.67.222.222'
set luci.main.mediaurlbase=/luci-static/fledermaus
set luci.main.lang=de
commit freifunk
commit luci
EOF

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0; URL=/cgi-bin/luci/freifunk/olsr" />
</head>
<body style="background-color: black">
<a style="color: white; text-decoration: none" href="/cgi-bin/luci/freifunk/olsr">LuCI - Lua Configuration Interface</a>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0; URL=/cgi-bin/luci/freifunk/olsr" />
</head>
<body style="background-color: black">
<a style="color: white; text-decoration: none" href="/cgi-bin/luci/freifunk/olsr">LuCI - Lua Configuration Interface</a>
</body>
</html>

View File

@@ -0,0 +1,4 @@
#!/bin/sh
[ -n "${IPKG_INSTROOT}" ] || {
( . /etc/uci-defaults/luci-freifunk-community ) && rm -f /etc/uci-defaults/luci-freifunk-community
}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
uci batch <<-EOF
set luci.main.mediaurlbase=/luci-static/fledermaus
set luci.main.lang=de
commit luci
EOF

View File

@@ -0,0 +1,42 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk.lua 3618 2008-10-23 02:25:26Z jow $
]]--
module("luci.controller.asterisk", package.seeall)
function index()
entry({"admin", "services", "asterisk"}, cbi("asterisk"), "Asterisk", 80).i18n = "asterisk"
entry({"admin", "services", "asterisk", "voice"}, cbi("asterisk-voice"), "Voice Functions", 1)
entry({"admin", "services", "asterisk", "meetme"}, cbi("asterisk-meetme"), "Meetme Conferences", 2)
entry({"admin", "services", "asterisk", "iax-conns"}, cbi("asterisk-iax-connections"), "IAX Connections", 3)
entry({"admin", "services", "asterisk", "sip-conns"}, cbi("asterisk-sip-connections"), "SIP Connections", 4)
entry({"admin", "services", "asterisk", "dialplans"}, cbi("asterisk-dialplans"), "Dial Plans", 5)
entry({"admin", "services", "asterisk", "mod"}, cbi("asterisk-mod-app"), "Modules", 4)
entry({"admin", "services", "asterisk", "mod", "app"}, cbi("asterisk-mod-app"), "Applications", 1)
entry({"admin", "services", "asterisk", "mod", "cdr"}, cbi("asterisk-mod-cdr"), "Call Detail Records", 2)
entry({"admin", "services", "asterisk", "mod", "chan"}, cbi("asterisk-mod-chan"), "Channels", 3)
entry({"admin", "services", "asterisk", "mod", "codec"}, cbi("asterisk-mod-codec"), "Codecs", 4)
entry({"admin", "services", "asterisk", "mod", "format"}, cbi("asterisk-mod-format"), "Format", 5)
entry({"admin", "services", "asterisk", "mod", "func"}, cbi("asterisk-mod-func"), "Functions", 6)
entry({"admin", "services", "asterisk", "mod", "pbx"}, cbi("asterisk-mod-pbx"), "PBX", 7)
entry({"admin", "services", "asterisk", "mod", "res"}, cbi("asterisk-mod-res"), "Resources", 8)
entry({"admin", "services", "asterisk", "mod", "res", "feature"},
cbi("asterisk-mod-res-feature"), "Feature Module Configuration", 9 )
end

View File

@@ -0,0 +1,251 @@
asterisk_asterisk = 'Asterisk General Options'
asterisk_asterisk_agidir = 'AGI directory'
asterisk_asterisk_cacherecordfiles = 'Cache recorded sound files during recording'
asterisk_asterisk_debug = 'Debug Level'
asterisk_asterisk_dontwarn = 'Disable some warnings'
asterisk_asterisk_dumpcore = 'Dump core on crash'
asterisk_asterisk_highpriority = 'High Priority'
asterisk_asterisk_initcrypto = 'Initialise Crypto'
asterisk_asterisk_internaltiming = 'Use Internal Timing'
asterisk_asterisk_logdir = 'Log directory'
asterisk_asterisk_maxcalls = 'Maximum number of calls allowed'
asterisk_asterisk_maxload = 'Maximum load to stop accepting new calls'
asterisk_asterisk_nocolor = 'Disable console colors'
asterisk_asterisk_recordcachedir = 'Sound files Cache directory'
asterisk_asterisk_rungroup = 'The Group to run as'
asterisk_asterisk_runuser = 'The User to run as'
asterisk_asterisk_spooldir = 'Voicemail Spool directory'
asterisk_asterisk_systemname = 'Prefix UniquID with system name'
asterisk_asterisk_transcodeviasln = 'Build transcode paths via SLINEAR, not directly'
asterisk_asterisk_transmitsilenceduringrecord = 'Transmit SLINEAR silence while recording a channel'
asterisk_asterisk_verbose = 'Verbose Level'
asterisk_asterisk_zone = 'Time Zone'
asterisk_dialplan = 'Section dialplan'
asterisk_dialplan_include = 'include'
asterisk_dialplanexten = 'Dialplan Extension'
asterisk_dialplangeneral = 'Dialplan General Options'
asterisk_dialplangeneral_allowtransfer = 'Allow transfer'
asterisk_dialplangeneral_canreinvite = 'Reinvite/redirect media connections'
asterisk_dialplangeneral_clearglobalvars = 'Clear global vars'
asterisk_dialplangoto = 'Dialplan Goto'
asterisk_dialplanmeetme = 'Dialplan Conference'
asterisk_dialplansaytime = 'Dialplan Time'
asterisk_dialplanvoice = 'Dialplan Voicemail'
asterisk_dialzone = 'Dial Zones for Dialplan'
asterisk_dialzone_addprefix = 'Prefix to add matching dialplans'
asterisk_dialzone_international = 'Match International prefix'
asterisk_dialzone_localprefix = 'Prefix (0) to add/remove to/from international numbers'
asterisk_dialzone_localzone = 'localzone'
asterisk_dialzone_match = 'Match plan'
asterisk_dialzone_uses = 'Connection to use'
asterisk_featuremap = 'Feature Key maps'
asterisk_featuremap_atxfer = 'Attended transfer key'
asterisk_featuremap_blindxfer = 'Blind transfer key'
asterisk_featuremap_disconnect = 'Key to Disconnect call'
asterisk_featuremap_parkcall = 'Key to Park call'
asterisk_featurepark = 'Parking Feature'
asterisk_featurepark_adsipark = 'ADSI Park'
asterisk_featurepark_atxfernoanswertimeout = 'Attended transfer timeout (sec)'
asterisk_featurepark_automon = 'One touch record key'
asterisk_featurepark_context = 'Name of call context for parking'
asterisk_featurepark_courtesytone = 'Sound file to play to parked caller'
asterisk_featurepark_featuredigittimeout = 'Max time (ms) between digits for feature activation'
asterisk_featurepark_findslot = 'Method to Find Parking slot'
asterisk_featurepark_parkedmusicclass = 'parkedmusicclass'
asterisk_featurepark_parkedplay = 'Play courtesy tone to'
asterisk_featurepark_parkenabled = 'Enable Parking'
asterisk_featurepark_parkext = 'Extension to dial to park'
asterisk_featurepark_parkingtime = 'Parking time (secs)'
asterisk_featurepark_parkpos = 'Range of extensions for call parking'
asterisk_featurepark_pickupexten = 'Pickup extension'
asterisk_featurepark_transferdigittimeout = 'Seconds to wait bewteen digits when transferring'
asterisk_featurepark_xferfailsound = 'sound when attended transfer is complete'
asterisk_featurepark_xfersound = 'Sound when attended transfer fails'
asterisk_hardwarereboot = 'Reload Hardware Config'
asterisk_hardwarereboot_method = 'Reboot Method'
asterisk_hardwarereboot_param = 'Parameter'
asterisk_iax = 'SIP Connection'
asterisk_iax_alwaysinternational = 'Always Dial International'
asterisk_iax_context = 'context'
asterisk_iax_countrycode = 'Country Code for connection'
asterisk_iax_extension = 'Add as Extension'
asterisk_iax_host = 'Host name (or blank)'
asterisk_iax_internationalprefix = 'International Dial Prefix'
asterisk_iax_prefix = 'Dial Prefix (for external line)'
asterisk_iax_secret = 'Secret'
asterisk_iax_timeout = 'Dial Timeout (sec)'
asterisk_iax_type = 'Option type'
asterisk_iax_username = 'User name'
asterisk_iaxgeneral = 'IAX General Options'
asterisk_iaxgeneral_allow = 'Allow Codecs'
asterisk_iaxgeneral_canreinvite = 'Reinvite/redirect media connections'
asterisk_iaxgeneral_static = 'Static'
asterisk_iaxgeneral_writeprotect = 'Write Protect'
asterisk_meetme = 'Meetme Conference'
asterisk_meetme_adminpin = 'Admin PIN'
asterisk_meetme_pin = 'Meeting PIN'
asterisk_meetmegeneral = 'Meetme Conference General Options'
asterisk_meetmegeneral_audiobuffers = 'Number of 20ms audio buffers to be used'
asterisk_module = 'Modules'
asterisk_module_appalarmreceiver = 'Alarm Receiver Application'
asterisk_module_appauthenticate = 'Authentication Application'
asterisk_module_appcdr = 'Make sure asterisk doesnt save CDR'
asterisk_module_appchanisavail = 'Check if channel is available'
asterisk_module_appchanspy = 'Listen in on any channel'
asterisk_module_appcontrolplayback = 'Control Playback Application'
asterisk_module_appcut = 'Cuts up variables'
asterisk_module_appdb = 'Database access functions'
asterisk_module_appdial = 'Dialing Application'
asterisk_module_appdictate = 'Virtual Dictation Machine Application'
asterisk_module_appdirectedpickup = 'Directed Call Pickup Support'
asterisk_module_appdirectory = 'Extension Directory'
asterisk_module_appdisa = 'DISA (Direct Inward System Access) Application'
asterisk_module_appdumpchan = 'Dump channel variables Application'
asterisk_module_appecho = 'Simple Echo Application'
asterisk_module_appenumlookup = 'ENUM Lookup'
asterisk_module_appeval = 'Reevaluates strings'
asterisk_module_appexec = 'Executes applications'
asterisk_module_appexternalivr = 'External IVR application interface'
asterisk_module_appforkcdr = 'Fork The CDR into 2 seperate entities'
asterisk_module_appgetcpeid = 'Get ADSI CPE ID'
asterisk_module_appgroupcount = 'Group Management Routines'
asterisk_module_appices = 'Encode and Stream via icecast and ices'
asterisk_module_appimage = 'Image Transmission Application'
asterisk_module_applookupblacklist = 'Look up Caller*ID name/number from black'
asterisk_module_applookupcidname = 'Look up CallerID Name from local databas'
asterisk_module_appmacro = 'Extension Macros'
asterisk_module_appmath = 'A simple math Application'
asterisk_module_appmd5 = 'MD5 checksum Application'
asterisk_module_appmilliwatt = 'Digital Milliwatt (mu-law) Test Application'
asterisk_module_appmixmonitor = 'Record a call and mix the audio during the recording'
asterisk_module_appparkandannounce = 'Call Parking and Announce Application'
asterisk_module_appplayback = 'Trivial Playback Application'
asterisk_module_appprivacy = 'Require phone number to be entered'
asterisk_module_appqueue = 'True Call Queueing'
asterisk_module_apprandom = 'Random goto'
asterisk_module_appread = 'Read Variable Application'
asterisk_module_appreadfile = 'Read in a file'
asterisk_module_apprealtime = 'Realtime Data Lookup/Rewrite'
asterisk_module_apprecord = 'Trivial Record Application'
asterisk_module_appsayunixtime = 'Say time'
asterisk_module_appsenddtmf = 'Send DTMF digits Application'
asterisk_module_appsendtext = 'Send Text Applications'
asterisk_module_appsetcallerid = 'Set CallerID Application'
asterisk_module_appsetcdruserfield = 'CDR user field apps'
asterisk_module_appsetcidname = 'load =&gt; .so ; Set CallerID Name'
asterisk_module_appsetcidnum = 'load =&gt; .so ; Set CallerID Number'
asterisk_module_appsetrdnis = 'Set RDNIS Number'
asterisk_module_appsettransfercapability = 'Set ISDN Transfer Capability'
asterisk_module_appsms = 'SMS/PSTN handler'
asterisk_module_appsofthangup = 'Hangs up the requested channel'
asterisk_module_appstack = 'Stack Routines'
asterisk_module_appsystem = 'Generic System() application'
asterisk_module_apptalkdetect = 'Playback with Talk Detection'
asterisk_module_apptest = 'Interface Test Application'
asterisk_module_apptransfer = 'Transfer'
asterisk_module_apptxtcidname = 'TXTCIDName'
asterisk_module_appurl = 'Send URL Applications'
asterisk_module_appuserevent = 'Custom User Event Application'
asterisk_module_appverbose = 'Send verbose output'
asterisk_module_appvoicemail = 'Voicemail'
asterisk_module_appwaitforring = 'Waits until first ring after time'
asterisk_module_appwaitforsilence = 'Wait For Silence Application'
asterisk_module_appwhile = 'While Loops and Conditional Execution'
asterisk_module_cdrcsv = 'Comma Separated Values CDR Backend'
asterisk_module_cdrcustom = 'Customizable Comma Separated Values CDR Backend'
asterisk_module_cdrmanager = 'Asterisk Call Manager CDR Backend'
asterisk_module_cdrmysql = 'MySQL CDR Backend'
asterisk_module_cdrpgsql = 'PostgreSQL CDR Backend'
asterisk_module_cdrsqlite = 'SQLite CDR Backend'
asterisk_module_chanagent = 'Agent Proxy Channel'
asterisk_module_chanalsa = 'Channel driver for GTalk'
asterisk_module_changtalk = 'Channel driver for GTalk'
asterisk_module_chaniax2 = 'Option chan_iax2'
asterisk_module_chanlocal = 'Local Proxy Channel'
asterisk_module_chansip = 'Session Initiation Protocol (SIP)'
asterisk_module_codecadpcm = 'Adaptive Differential PCM Coder/Decoder'
asterisk_module_codecalaw = 'A-law Coder/Decoder'
asterisk_module_codecamu = 'A-law and Mulaw direct Coder/Decoder'
asterisk_module_codecg726 = 'ITU G.726-32kbps G726 Transcoder'
asterisk_module_codecgsm = 'GSM/PCM16 (signed linear) Codec Translation'
asterisk_module_codecspeex = 'Speex/PCM16 (signed linear) Codec Translator'
asterisk_module_codeculaw = 'Mu-law Coder/Decoder'
asterisk_module_formatau = 'Sun Microsystems AU format (signed linear)'
asterisk_module_formatg723 = 'G.723.1 Simple Timestamp File Format'
asterisk_module_formatg726 = 'Raw G.726 (16/24/32/40kbps) data'
asterisk_module_formatg729 = 'Raw G729 data'
asterisk_module_formatgsm = 'Raw GSM data'
asterisk_module_formath263 = 'Raw h263 data'
asterisk_module_formatjpeg = 'JPEG (Joint Picture Experts Group) Image'
asterisk_module_formatpcm = 'Raw uLaw 8khz Audio support (PCM)'
asterisk_module_formatpcmalaw = 'load =&gt; .so ; Raw aLaw 8khz PCM Audio support'
asterisk_module_formatsln = 'Raw Signed Linear Audio support (SLN)'
asterisk_module_formatvox = 'Dialogic VOX (ADPCM) File Format'
asterisk_module_formatwav = 'Microsoft WAV format (8000hz Signed Line'
asterisk_module_formatwavgsm = 'Microsoft WAV format (Proprietary GSM)'
asterisk_module_funccallerid = 'Caller ID related dialplan functions'
asterisk_module_funcenum = 'ENUM Functions'
asterisk_module_funcuri = 'URI encoding / decoding functions'
asterisk_module_pbxael = 'Asterisk Extension Language Compiler'
asterisk_module_pbxconfig = 'Text Extension Configuration'
asterisk_module_pbxfunctions = 'load =&gt; .so ; Builtin dialplan functions'
asterisk_module_pbxloopback = 'Loopback Switch'
asterisk_module_pbxrealtime = 'Realtime Switch'
asterisk_module_pbxspool = 'Outgoing Spool Support'
asterisk_module_pbxwilcalu = 'Wil Cal U (Auto Dialer)'
asterisk_module_resconfigmysql = 'MySQL Config Resource'
asterisk_module_resconfigodbc = 'ODBC Config Resource'
asterisk_module_resconfigpgsql = 'PGSQL Module'
asterisk_module_rescrypto = 'Cryptographic Digital Signatures'
asterisk_module_resfeatures = 'Call Parking Resource'
asterisk_module_resindications = 'Indications Configuration'
asterisk_module_resmonitor = 'Call Monitoring Resource'
asterisk_module_resmusiconhold = 'Music On Hold Resource'
asterisk_module_resodbc = 'ODBC Resource'
asterisk_module_ressmdi = 'SMDI Module'
asterisk_module_ressnmp = 'SNMP Module'
asterisk_moh = 'Music On Hold'
asterisk_moh_application = 'Application'
asterisk_moh_directory = 'Directory of Music'
asterisk_moh_mode = 'Option mode'
asterisk_moh_random = 'Random Play'
asterisk_sip = 'SIP Connection'
asterisk_sip_alwaysinternational = 'Always Dial International'
asterisk_sip_canreinvite = 'Reinvite/redirect media connections'
asterisk_sip_context = 'context'
asterisk_sip_countrycode = 'Country Code for connection'
asterisk_sip_dtmfmode = 'DTMF mode'
asterisk_sip_extension = 'Add as Extension'
asterisk_sip_fromdomain = 'Primary domain identity for From: headers'
asterisk_sip_fromuser = 'From user (required by many SIP providers)'
asterisk_sip_host = 'Host name (or blank)'
asterisk_sip_incoming = 'Ring on incoming dialplan contexts'
asterisk_sip_insecure = 'Allow Insecure for'
asterisk_sip_internationalprefix = 'International Dial Prefix'
asterisk_sip_mailbox = 'Mailbox for MWI'
asterisk_sip_nat = 'NAT between phone and Asterisk'
asterisk_sip_pedantic = 'Check tags in headers'
asterisk_sip_port = 'SIP Port'
asterisk_sip_prefix = 'Dial Prefix (for external line)'
asterisk_sip_qualify = 'Reply Timeout (ms) for down connection'
asterisk_sip_register = 'Register connection'
asterisk_sip_secret = 'Secret'
asterisk_sip_selfmailbox = 'Dial own extension for mailbox'
asterisk_sip_timeout = 'Dial Timeout (sec)'
asterisk_sip_type = 'Client Type'
asterisk_sip_username = 'Username'
asterisk_sipgeneral = 'Section sipgeneral'
asterisk_sipgeneral_allow = 'Allow codecs'
asterisk_sipgeneral_port = 'SIP Port'
asterisk_sipgeneral_realm = 'SIP realm'
asterisk_voicegeneral = 'Voicemail general options'
asterisk_voicegeneral_serveremail = 'From Email address of server'
asterisk_voicemail = 'Voice Mail boxes'
asterisk_voicemail_attach = 'Email contains attachment'
asterisk_voicemail_email = 'Email'
asterisk_voicemail_name = 'Display Name'
asterisk_voicemail_password = 'Password'
asterisk_voicemail_zone = 'zone'
asterisk_voicezone = 'Voice Zone settings'
asterisk_voicezone_message = 'Message Format'
asterisk_voicezone_zone = 'Time Zone'

View File

@@ -0,0 +1,257 @@
<?xml version="1.0" encoding="utf-8"?>
<i18n:msgs xmlns:i18n="http://luci.freifunk-halle.net/2008/i18n#" xmlns="http://www.w3.org/1999/xhtml">
<i18n:msg xml:id="asterisk_asterisk">Asterisk General Options</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_agidir">AGI directory</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_cacherecordfiles">Cache recorded sound files during recording</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_debug">Debug Level</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_dontwarn">Disable some warnings</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_dumpcore">Dump core on crash</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_highpriority">High Priority</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_initcrypto">Initialise Crypto</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_internaltiming">Use Internal Timing</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_logdir">Log directory</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_maxcalls">Maximum number of calls allowed</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_maxload">Maximum load to stop accepting new calls</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_nocolor">Disable console colors</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_recordcachedir">Sound files Cache directory</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_rungroup">The Group to run as</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_runuser">The User to run as</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_spooldir">Voicemail Spool directory</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_systemname">Prefix UniquID with system name</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_transcodeviasln">Build transcode paths via SLINEAR, not directly</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_transmitsilenceduringrecord">Transmit SLINEAR silence while recording a channel</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_verbose">Verbose Level</i18n:msg>
<i18n:msg xml:id="asterisk_asterisk_zone">Time Zone</i18n:msg>
<i18n:msg xml:id="asterisk_dialplan">Section dialplan</i18n:msg>
<i18n:msg xml:id="asterisk_dialplan_include">include</i18n:msg>
<i18n:msg xml:id="asterisk_dialplanexten">Dialplan Extension</i18n:msg>
<i18n:msg xml:id="asterisk_dialplangeneral">Dialplan General Options</i18n:msg>
<i18n:msg xml:id="asterisk_dialplangeneral_allowtransfer">Allow transfer</i18n:msg>
<i18n:msg xml:id="asterisk_dialplangeneral_canreinvite">Reinvite/redirect media connections</i18n:msg>
<i18n:msg xml:id="asterisk_dialplangeneral_clearglobalvars">Clear global vars</i18n:msg>
<i18n:msg xml:id="asterisk_dialplangoto">Dialplan Goto</i18n:msg>
<i18n:msg xml:id="asterisk_dialplanmeetme">Dialplan Conference</i18n:msg>
<i18n:msg xml:id="asterisk_dialplansaytime">Dialplan Time</i18n:msg>
<i18n:msg xml:id="asterisk_dialplanvoice">Dialplan Voicemail</i18n:msg>
<i18n:msg xml:id="asterisk_dialzone">Dial Zones for Dialplan</i18n:msg>
<i18n:msg xml:id="asterisk_dialzone_addprefix">Prefix to add matching dialplans</i18n:msg>
<i18n:msg xml:id="asterisk_dialzone_international">Match International prefix</i18n:msg>
<i18n:msg xml:id="asterisk_dialzone_localprefix">Prefix (0) to add/remove to/from international numbers</i18n:msg>
<i18n:msg xml:id="asterisk_dialzone_localzone">localzone</i18n:msg>
<i18n:msg xml:id="asterisk_dialzone_match">Match plan</i18n:msg>
<i18n:msg xml:id="asterisk_dialzone_uses">Connection to use</i18n:msg>
<i18n:msg xml:id="asterisk_featuremap">Feature Key maps</i18n:msg>
<i18n:msg xml:id="asterisk_featuremap_atxfer">Attended transfer key</i18n:msg>
<i18n:msg xml:id="asterisk_featuremap_blindxfer">Blind transfer key</i18n:msg>
<i18n:msg xml:id="asterisk_featuremap_disconnect">Key to Disconnect call</i18n:msg>
<i18n:msg xml:id="asterisk_featuremap_parkcall">Key to Park call</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark">Parking Feature</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_adsipark">ADSI Park</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_atxfernoanswertimeout">Attended transfer timeout (sec)</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_automon">One touch record key</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_context">Name of call context for parking</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_courtesytone">Sound file to play to parked caller</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_featuredigittimeout">Max time (ms) between digits for feature activation</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_findslot">Method to Find Parking slot</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_parkedmusicclass">parkedmusicclass</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_parkedplay">Play courtesy tone to</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_parkenabled">Enable Parking</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_parkext">Extension to dial to park</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_parkingtime">Parking time (secs)</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_parkpos">Range of extensions for call parking</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_pickupexten">Pickup extension</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_transferdigittimeout">Seconds to wait bewteen digits when transferring</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_xferfailsound">sound when attended transfer is complete</i18n:msg>
<i18n:msg xml:id="asterisk_featurepark_xfersound">Sound when attended transfer fails</i18n:msg>
<i18n:msg xml:id="asterisk_hardwarereboot">Reload Hardware Config</i18n:msg>
<i18n:msg xml:id="asterisk_hardwarereboot_method">Reboot Method</i18n:msg>
<i18n:msg xml:id="asterisk_hardwarereboot_param">Parameter</i18n:msg>
<i18n:msg xml:id="asterisk_iax">SIP Connection</i18n:msg>
<i18n:msg xml:id="asterisk_iax_alwaysinternational">Always Dial International</i18n:msg>
<i18n:msg xml:id="asterisk_iax_context">context</i18n:msg>
<i18n:msg xml:id="asterisk_iax_countrycode">Country Code for connection</i18n:msg>
<i18n:msg xml:id="asterisk_iax_extension">Add as Extension</i18n:msg>
<i18n:msg xml:id="asterisk_iax_host">Host name (or blank)</i18n:msg>
<i18n:msg xml:id="asterisk_iax_internationalprefix">International Dial Prefix</i18n:msg>
<i18n:msg xml:id="asterisk_iax_prefix">Dial Prefix (for external line)</i18n:msg>
<i18n:msg xml:id="asterisk_iax_secret">Secret</i18n:msg>
<i18n:msg xml:id="asterisk_iax_timeout">Dial Timeout (sec)</i18n:msg>
<i18n:msg xml:id="asterisk_iax_type">Option type</i18n:msg>
<i18n:msg xml:id="asterisk_iax_username">User name</i18n:msg>
<i18n:msg xml:id="asterisk_iaxgeneral">IAX General Options</i18n:msg>
<i18n:msg xml:id="asterisk_iaxgeneral_allow">Allow Codecs</i18n:msg>
<i18n:msg xml:id="asterisk_iaxgeneral_canreinvite">Reinvite/redirect media connections</i18n:msg>
<i18n:msg xml:id="asterisk_iaxgeneral_static">Static</i18n:msg>
<i18n:msg xml:id="asterisk_iaxgeneral_writeprotect">Write Protect</i18n:msg>
<i18n:msg xml:id="asterisk_meetme">Meetme Conference</i18n:msg>
<i18n:msg xml:id="asterisk_meetme_adminpin">Admin PIN</i18n:msg>
<i18n:msg xml:id="asterisk_meetme_pin">Meeting PIN</i18n:msg>
<i18n:msg xml:id="asterisk_meetmegeneral">Meetme Conference General Options</i18n:msg>
<i18n:msg xml:id="asterisk_meetmegeneral_audiobuffers">Number of 20ms audio buffers to be used</i18n:msg>
<i18n:msg xml:id="asterisk_module">Modules</i18n:msg>
<i18n:msg xml:id="asterisk_module_appalarmreceiver">Alarm Receiver Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appauthenticate">Authentication Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appcdr">Make sure asterisk doesnt save CDR</i18n:msg>
<i18n:msg xml:id="asterisk_module_appchanisavail">Check if channel is available</i18n:msg>
<i18n:msg xml:id="asterisk_module_appchanspy">Listen in on any channel</i18n:msg>
<i18n:msg xml:id="asterisk_module_appcontrolplayback">Control Playback Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appcut">Cuts up variables</i18n:msg>
<i18n:msg xml:id="asterisk_module_appdb">Database access functions</i18n:msg>
<i18n:msg xml:id="asterisk_module_appdial">Dialing Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appdictate">Virtual Dictation Machine Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appdirectedpickup">Directed Call Pickup Support</i18n:msg>
<i18n:msg xml:id="asterisk_module_appdirectory">Extension Directory</i18n:msg>
<i18n:msg xml:id="asterisk_module_appdisa">DISA (Direct Inward System Access) Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appdumpchan">Dump channel variables Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appecho">Simple Echo Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appenumlookup">ENUM Lookup</i18n:msg>
<i18n:msg xml:id="asterisk_module_appeval">Reevaluates strings</i18n:msg>
<i18n:msg xml:id="asterisk_module_appexec">Executes applications</i18n:msg>
<i18n:msg xml:id="asterisk_module_appexternalivr">External IVR application interface</i18n:msg>
<i18n:msg xml:id="asterisk_module_appforkcdr">Fork The CDR into 2 seperate entities</i18n:msg>
<i18n:msg xml:id="asterisk_module_appgetcpeid">Get ADSI CPE ID</i18n:msg>
<i18n:msg xml:id="asterisk_module_appgroupcount">Group Management Routines</i18n:msg>
<i18n:msg xml:id="asterisk_module_appices">Encode and Stream via icecast and ices</i18n:msg>
<i18n:msg xml:id="asterisk_module_appimage">Image Transmission Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_applookupblacklist">Look up Caller*ID name/number from black</i18n:msg>
<i18n:msg xml:id="asterisk_module_applookupcidname">Look up CallerID Name from local databas</i18n:msg>
<i18n:msg xml:id="asterisk_module_appmacro">Extension Macros</i18n:msg>
<i18n:msg xml:id="asterisk_module_appmath">A simple math Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appmd5">MD5 checksum Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appmilliwatt">Digital Milliwatt (mu-law) Test Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appmixmonitor">Record a call and mix the audio during the recording</i18n:msg>
<i18n:msg xml:id="asterisk_module_appparkandannounce">Call Parking and Announce Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appplayback">Trivial Playback Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appprivacy">Require phone number to be entered</i18n:msg>
<i18n:msg xml:id="asterisk_module_appqueue">True Call Queueing</i18n:msg>
<i18n:msg xml:id="asterisk_module_apprandom">Random goto</i18n:msg>
<i18n:msg xml:id="asterisk_module_appread">Read Variable Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appreadfile">Read in a file</i18n:msg>
<i18n:msg xml:id="asterisk_module_apprealtime">Realtime Data Lookup/Rewrite</i18n:msg>
<i18n:msg xml:id="asterisk_module_apprecord">Trivial Record Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsayunixtime">Say time</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsenddtmf">Send DTMF digits Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsendtext">Send Text Applications</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsetcallerid">Set CallerID Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsetcdruserfield">CDR user field apps</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsetcidname">load => .so ; Set CallerID Name</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsetcidnum">load => .so ; Set CallerID Number</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsetrdnis">Set RDNIS Number</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsettransfercapability">Set ISDN Transfer Capability</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsms">SMS/PSTN handler</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsofthangup">Hangs up the requested channel</i18n:msg>
<i18n:msg xml:id="asterisk_module_appstack">Stack Routines</i18n:msg>
<i18n:msg xml:id="asterisk_module_appsystem">Generic System() application</i18n:msg>
<i18n:msg xml:id="asterisk_module_apptalkdetect">Playback with Talk Detection</i18n:msg>
<i18n:msg xml:id="asterisk_module_apptest">Interface Test Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_apptransfer">Transfer</i18n:msg>
<i18n:msg xml:id="asterisk_module_apptxtcidname">TXTCIDName</i18n:msg>
<i18n:msg xml:id="asterisk_module_appurl">Send URL Applications</i18n:msg>
<i18n:msg xml:id="asterisk_module_appuserevent">Custom User Event Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appverbose">Send verbose output</i18n:msg>
<i18n:msg xml:id="asterisk_module_appvoicemail">Voicemail</i18n:msg>
<i18n:msg xml:id="asterisk_module_appwaitforring">Waits until first ring after time</i18n:msg>
<i18n:msg xml:id="asterisk_module_appwaitforsilence">Wait For Silence Application</i18n:msg>
<i18n:msg xml:id="asterisk_module_appwhile">While Loops and Conditional Execution</i18n:msg>
<i18n:msg xml:id="asterisk_module_cdrcsv">Comma Separated Values CDR Backend</i18n:msg>
<i18n:msg xml:id="asterisk_module_cdrcustom">Customizable Comma Separated Values CDR Backend</i18n:msg>
<i18n:msg xml:id="asterisk_module_cdrmanager">Asterisk Call Manager CDR Backend</i18n:msg>
<i18n:msg xml:id="asterisk_module_cdrmysql">MySQL CDR Backend</i18n:msg>
<i18n:msg xml:id="asterisk_module_cdrpgsql">PostgreSQL CDR Backend</i18n:msg>
<i18n:msg xml:id="asterisk_module_cdrsqlite">SQLite CDR Backend</i18n:msg>
<i18n:msg xml:id="asterisk_module_chanagent">Agent Proxy Channel</i18n:msg>
<i18n:msg xml:id="asterisk_module_chanalsa">Channel driver for GTalk</i18n:msg>
<i18n:msg xml:id="asterisk_module_changtalk">Channel driver for GTalk</i18n:msg>
<i18n:msg xml:id="asterisk_module_chaniax2">Option chan_iax2</i18n:msg>
<i18n:msg xml:id="asterisk_module_chanlocal">Local Proxy Channel</i18n:msg>
<i18n:msg xml:id="asterisk_module_chansip">Session Initiation Protocol (SIP)</i18n:msg>
<i18n:msg xml:id="asterisk_module_codecadpcm">Adaptive Differential PCM Coder/Decoder</i18n:msg>
<i18n:msg xml:id="asterisk_module_codecalaw">A-law Coder/Decoder</i18n:msg>
<i18n:msg xml:id="asterisk_module_codecamu">A-law and Mulaw direct Coder/Decoder</i18n:msg>
<i18n:msg xml:id="asterisk_module_codecg726">ITU G.726-32kbps G726 Transcoder</i18n:msg>
<i18n:msg xml:id="asterisk_module_codecgsm">GSM/PCM16 (signed linear) Codec Translation</i18n:msg>
<i18n:msg xml:id="asterisk_module_codecspeex">Speex/PCM16 (signed linear) Codec Translator</i18n:msg>
<i18n:msg xml:id="asterisk_module_codeculaw">Mu-law Coder/Decoder</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatau">Sun Microsystems AU format (signed linear)</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatg723">G.723.1 Simple Timestamp File Format</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatg726">Raw G.726 (16/24/32/40kbps) data</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatg729">Raw G729 data</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatgsm">Raw GSM data</i18n:msg>
<i18n:msg xml:id="asterisk_module_formath263">Raw h263 data</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatjpeg">JPEG (Joint Picture Experts Group) Image</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatpcm">Raw uLaw 8khz Audio support (PCM)</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatpcmalaw">load => .so ; Raw aLaw 8khz PCM Audio support</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatsln">Raw Signed Linear Audio support (SLN)</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatvox">Dialogic VOX (ADPCM) File Format</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatwav">Microsoft WAV format (8000hz Signed Line</i18n:msg>
<i18n:msg xml:id="asterisk_module_formatwavgsm">Microsoft WAV format (Proprietary GSM)</i18n:msg>
<i18n:msg xml:id="asterisk_module_funccallerid">Caller ID related dialplan functions</i18n:msg>
<i18n:msg xml:id="asterisk_module_funcenum">ENUM Functions</i18n:msg>
<i18n:msg xml:id="asterisk_module_funcuri">URI encoding / decoding functions</i18n:msg>
<i18n:msg xml:id="asterisk_module_pbxael">Asterisk Extension Language Compiler</i18n:msg>
<i18n:msg xml:id="asterisk_module_pbxconfig">Text Extension Configuration</i18n:msg>
<i18n:msg xml:id="asterisk_module_pbxfunctions">load => .so ; Builtin dialplan functions</i18n:msg>
<i18n:msg xml:id="asterisk_module_pbxloopback">Loopback Switch</i18n:msg>
<i18n:msg xml:id="asterisk_module_pbxrealtime">Realtime Switch</i18n:msg>
<i18n:msg xml:id="asterisk_module_pbxspool">Outgoing Spool Support</i18n:msg>
<i18n:msg xml:id="asterisk_module_pbxwilcalu">Wil Cal U (Auto Dialer)</i18n:msg>
<i18n:msg xml:id="asterisk_module_resconfigmysql">MySQL Config Resource</i18n:msg>
<i18n:msg xml:id="asterisk_module_resconfigodbc">ODBC Config Resource</i18n:msg>
<i18n:msg xml:id="asterisk_module_resconfigpgsql">PGSQL Module</i18n:msg>
<i18n:msg xml:id="asterisk_module_rescrypto">Cryptographic Digital Signatures</i18n:msg>
<i18n:msg xml:id="asterisk_module_resfeatures">Call Parking Resource</i18n:msg>
<i18n:msg xml:id="asterisk_module_resindications">Indications Configuration</i18n:msg>
<i18n:msg xml:id="asterisk_module_resmonitor">Call Monitoring Resource</i18n:msg>
<i18n:msg xml:id="asterisk_module_resmusiconhold">Music On Hold Resource</i18n:msg>
<i18n:msg xml:id="asterisk_module_resodbc">ODBC Resource</i18n:msg>
<i18n:msg xml:id="asterisk_module_ressmdi">SMDI Module</i18n:msg>
<i18n:msg xml:id="asterisk_module_ressnmp">SNMP Module</i18n:msg>
<i18n:msg xml:id="asterisk_moh">Music On Hold</i18n:msg>
<i18n:msg xml:id="asterisk_moh_application">Application</i18n:msg>
<i18n:msg xml:id="asterisk_moh_directory">Directory of Music</i18n:msg>
<i18n:msg xml:id="asterisk_moh_mode">Option mode</i18n:msg>
<i18n:msg xml:id="asterisk_moh_random">Random Play</i18n:msg>
<i18n:msg xml:id="asterisk_sip">SIP Connection</i18n:msg>
<i18n:msg xml:id="asterisk_sip_alwaysinternational">Always Dial International</i18n:msg>
<i18n:msg xml:id="asterisk_sip_canreinvite">Reinvite/redirect media connections</i18n:msg>
<i18n:msg xml:id="asterisk_sip_context">context</i18n:msg>
<i18n:msg xml:id="asterisk_sip_countrycode">Country Code for connection</i18n:msg>
<i18n:msg xml:id="asterisk_sip_dtmfmode">DTMF mode</i18n:msg>
<i18n:msg xml:id="asterisk_sip_extension">Add as Extension</i18n:msg>
<i18n:msg xml:id="asterisk_sip_fromdomain">Primary domain identity for From: headers</i18n:msg>
<i18n:msg xml:id="asterisk_sip_fromuser">From user (required by many SIP providers)</i18n:msg>
<i18n:msg xml:id="asterisk_sip_host">Host name (or blank)</i18n:msg>
<i18n:msg xml:id="asterisk_sip_incoming">Ring on incoming dialplan contexts</i18n:msg>
<i18n:msg xml:id="asterisk_sip_insecure">Allow Insecure for</i18n:msg>
<i18n:msg xml:id="asterisk_sip_internationalprefix">International Dial Prefix</i18n:msg>
<i18n:msg xml:id="asterisk_sip_mailbox">Mailbox for MWI</i18n:msg>
<i18n:msg xml:id="asterisk_sip_nat">NAT between phone and Asterisk</i18n:msg>
<i18n:msg xml:id="asterisk_sip_pedantic">Check tags in headers</i18n:msg>
<i18n:msg xml:id="asterisk_sip_port">SIP Port</i18n:msg>
<i18n:msg xml:id="asterisk_sip_prefix">Dial Prefix (for external line)</i18n:msg>
<i18n:msg xml:id="asterisk_sip_qualify">Reply Timeout (ms) for down connection</i18n:msg>
<i18n:msg xml:id="asterisk_sip_register">Register connection</i18n:msg>
<i18n:msg xml:id="asterisk_sip_secret">Secret</i18n:msg>
<i18n:msg xml:id="asterisk_sip_selfmailbox">Dial own extension for mailbox</i18n:msg>
<i18n:msg xml:id="asterisk_sip_timeout">Dial Timeout (sec)</i18n:msg>
<i18n:msg xml:id="asterisk_sip_type">Client Type</i18n:msg>
<i18n:msg xml:id="asterisk_sip_username">Username</i18n:msg>
<i18n:msg xml:id="asterisk_sipgeneral">Section sipgeneral</i18n:msg>
<i18n:msg xml:id="asterisk_sipgeneral_allow">Allow codecs</i18n:msg>
<i18n:msg xml:id="asterisk_sipgeneral_port">SIP Port</i18n:msg>
<i18n:msg xml:id="asterisk_sipgeneral_realm">SIP realm</i18n:msg>
<i18n:msg xml:id="asterisk_voicegeneral">Voicemail general options</i18n:msg>
<i18n:msg xml:id="asterisk_voicegeneral_serveremail">From Email address of server</i18n:msg>
<i18n:msg xml:id="asterisk_voicemail">Voice Mail boxes</i18n:msg>
<i18n:msg xml:id="asterisk_voicemail_attach">Email contains attachment</i18n:msg>
<i18n:msg xml:id="asterisk_voicemail_email">Email</i18n:msg>
<i18n:msg xml:id="asterisk_voicemail_name">Display Name</i18n:msg>
<i18n:msg xml:id="asterisk_voicemail_password">Password</i18n:msg>
<i18n:msg xml:id="asterisk_voicemail_zone">zone</i18n:msg>
<i18n:msg xml:id="asterisk_voicezone">Voice Zone settings</i18n:msg>
<i18n:msg xml:id="asterisk_voicezone_message">Message Format</i18n:msg>
<i18n:msg xml:id="asterisk_voicezone_zone">Time Zone</i18n:msg>
</i18n:msgs>

View File

@@ -0,0 +1,102 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-dialplans.lua 3620 2008-10-23 15:42:12Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
dialplan = cbimap:section(TypedSection, "dialplan", "Section dialplan", "")
dialplan.addremove = true
dialplan.dynamic = true
include = dialplan:option(MultiValue, "include", "Include zones and plans", "")
cbimap.uci:foreach( "asterisk", "dialplan", function(s) include:value(s['.name']) end )
cbimap.uci:foreach( "asterisk", "dialzone", function(s) include:value(s['.name']) end )
dialplanexten = cbimap:section(TypedSection, "dialplanexten", "Dialplan Extension", "")
dialplanexten.anonymous = true
dialplanexten.addremove = true
dialplanexten.dynamic = true
dialplangeneral = cbimap:section(TypedSection, "dialplangeneral", "Dialplan General Options", "")
dialplangeneral.anonymous = true
dialplangeneral.addremove = true
allowtransfer = dialplangeneral:option(Flag, "allowtransfer", "Allow transfer", "")
allowtransfer.rmempty = true
canreinvite = dialplangeneral:option(ListValue, "canreinvite", "Reinvite/redirect media connections", "")
canreinvite:value("yes", "Yes")
canreinvite:value("nonat", "Yes when not behind NAT")
canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection")
canreinvite:value("no", "No")
canreinvite.rmempty = true
clearglobalvars = dialplangeneral:option(Flag, "clearglobalvars", "Clear global vars", "")
clearglobalvars.rmempty = true
dialplangoto = cbimap:section(TypedSection, "dialplangoto", "Dialplan Goto", "")
dialplangoto.anonymous = true
dialplangoto.addremove = true
dialplangoto.dynamic = true
dialplanmeetme = cbimap:section(TypedSection, "dialplanmeetme", "Dialplan Conference", "")
dialplanmeetme.anonymous = true
dialplanmeetme.addremove = true
dialplanmeetme.dynamic = true
dialplansaytime = cbimap:section(TypedSection, "dialplansaytime", "Dialplan Time", "")
dialplansaytime.anonymous = true
dialplansaytime.addremove = true
dialplansaytime.dynamic = true
dialplanvoice = cbimap:section(TypedSection, "dialplanvoice", "Dialplan Voicemail", "")
dialplanvoice.anonymous = true
dialplanvoice.addremove = true
dialplanvoice.dynamic = true
dialzone = cbimap:section(TypedSection, "dialzone", "Dial Zones for Dialplan", "")
dialzone.addremove = true
dialzone.template = "cbi/tblsection"
addprefix = dialzone:option(Value, "addprefix", "Prefix to add matching dialplans", "")
addprefix.rmempty = true
--international = dialzone:option(DynamicList, "international", "Match International prefix", "")
international = dialzone:option(Value, "international", "Match International prefix", "")
international.rmempty = true
localprefix = dialzone:option(Value, "localprefix", "Prefix (0) to add/remove to/from intl. numbers", "")
localprefix.rmempty = true
localzone = dialzone:option(Value, "localzone", "Dialzone for intl. numbers matched as local", "")
localzone.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
cbimap.uci:foreach( "asterisk", "dialplan", function(s) localzone:value(s['.name']) end )
cbimap.uci:foreach( "asterisk", "dialzone", function(s) localzone:value(s['.name']) end )
match = dialzone:option(Value, "match", "Match plan", "")
match.rmempty = true
uses = dialzone:option(ListValue, "uses", "Connection to use", "")
uses.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "sip-conns" )
cbimap.uci:foreach( "asterisk", "sip", function(s) uses:value('SIP/'..s['.name']) end )
cbimap.uci:foreach( "asterisk", "iax", function(s) uses:value('IAX/'..s['.name']) end )
return cbimap

View File

@@ -0,0 +1,60 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-iax-connections.lua 3620 2008-10-23 15:42:12Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
iax = cbimap:section(TypedSection, "iax", "IAX Connection", "")
iax.addremove = true
alwaysinternational = iax:option(Flag, "alwaysinternational", "Always Dial International", "")
alwaysinternational.optional = true
context = iax:option(ListValue, "context", "Context to use", "")
context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )
countrycode = iax:option(Value, "countrycode", "Country Code for connection", "")
countrycode.optional = true
extension = iax:option(Value, "extension", "Add as Extension", "")
extension.optional = true
host = iax:option(Value, "host", "Host name (or blank)", "")
host.optional = true
internationalprefix = iax:option(Value, "internationalprefix", "International Dial Prefix", "")
internationalprefix.optional = true
prefix = iax:option(Value, "prefix", "Dial Prefix (for external line)", "")
prefix.optional = true
secret = iax:option(Value, "secret", "Secret", "")
secret.optional = true
timeout = iax:option(Value, "timeout", "Dial Timeout (sec)", "")
timeout.optional = true
type = iax:option(ListValue, "type", "Option type", "")
type:value("friend", "Friend (outbound/inbound)")
type:value("user", "User (inbound - authenticate by \"from\")")
type:value("peer", "Peer (outbound - match by host)")
type.optional = true
username = iax:option(Value, "username", "User name", "")
username.optional = true
return cbimap

View File

@@ -0,0 +1,33 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-meetme.lua 3620 2008-10-23 15:42:12Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
meetmegeneral = cbimap:section(TypedSection, "meetmegeneral", "Meetme Conference General Options", "")
audiobuffers = meetmegeneral:option(Value, "audiobuffers", "Number of 20ms audio buffers to be used", "")
meetme = cbimap:section(TypedSection, "meetme", "Meetme Conference", "")
meetme.addremove = true
adminpin = meetme:option(Value, "adminpin", "Admin PIN", "")
adminpin.password = true
pin = meetme:option(Value, "pin", "Meeting PIN", "")
pin.password = true
return cbimap

View File

@@ -0,0 +1,391 @@
cbimap = Map("asterisk", "asterisk", "")
module = cbimap:section(TypedSection, "module", "Modules", "")
module.anonymous = true
app_alarmreceiver = module:option(ListValue, "app_alarmreceiver", "Alarm Receiver Application", "")
app_alarmreceiver:value("yes", "Load")
app_alarmreceiver:value("no", "Do Not Load")
app_alarmreceiver:value("auto", "Load as Required")
app_alarmreceiver.rmempty = true
app_authenticate = module:option(ListValue, "app_authenticate", "Authentication Application", "")
app_authenticate:value("yes", "Load")
app_authenticate:value("no", "Do Not Load")
app_authenticate:value("auto", "Load as Required")
app_authenticate.rmempty = true
app_cdr = module:option(ListValue, "app_cdr", "Make sure asterisk doesnt save CDR", "")
app_cdr:value("yes", "Load")
app_cdr:value("no", "Do Not Load")
app_cdr:value("auto", "Load as Required")
app_cdr.rmempty = true
app_chanisavail = module:option(ListValue, "app_chanisavail", "Check if channel is available", "")
app_chanisavail:value("yes", "Load")
app_chanisavail:value("no", "Do Not Load")
app_chanisavail:value("auto", "Load as Required")
app_chanisavail.rmempty = true
app_chanspy = module:option(ListValue, "app_chanspy", "Listen in on any channel", "")
app_chanspy:value("yes", "Load")
app_chanspy:value("no", "Do Not Load")
app_chanspy:value("auto", "Load as Required")
app_chanspy.rmempty = true
app_controlplayback = module:option(ListValue, "app_controlplayback", "Control Playback Application", "")
app_controlplayback:value("yes", "Load")
app_controlplayback:value("no", "Do Not Load")
app_controlplayback:value("auto", "Load as Required")
app_controlplayback.rmempty = true
app_cut = module:option(ListValue, "app_cut", "Cuts up variables", "")
app_cut:value("yes", "Load")
app_cut:value("no", "Do Not Load")
app_cut:value("auto", "Load as Required")
app_cut.rmempty = true
app_db = module:option(ListValue, "app_db", "Database access functions", "")
app_db:value("yes", "Load")
app_db:value("no", "Do Not Load")
app_db:value("auto", "Load as Required")
app_db.rmempty = true
app_dial = module:option(ListValue, "app_dial", "Dialing Application", "")
app_dial:value("yes", "Load")
app_dial:value("no", "Do Not Load")
app_dial:value("auto", "Load as Required")
app_dial.rmempty = true
app_dictate = module:option(ListValue, "app_dictate", "Virtual Dictation Machine Application", "")
app_dictate:value("yes", "Load")
app_dictate:value("no", "Do Not Load")
app_dictate:value("auto", "Load as Required")
app_dictate.rmempty = true
app_directed_pickup = module:option(ListValue, "app_directed_pickup", "Directed Call Pickup Support", "")
app_directed_pickup:value("yes", "Load")
app_directed_pickup:value("no", "Do Not Load")
app_directed_pickup:value("auto", "Load as Required")
app_directed_pickup.rmempty = true
app_directory = module:option(ListValue, "app_directory", "Extension Directory", "")
app_directory:value("yes", "Load")
app_directory:value("no", "Do Not Load")
app_directory:value("auto", "Load as Required")
app_directory.rmempty = true
app_disa = module:option(ListValue, "app_disa", "DISA (Direct Inward System Access) Application", "")
app_disa:value("yes", "Load")
app_disa:value("no", "Do Not Load")
app_disa:value("auto", "Load as Required")
app_disa.rmempty = true
app_dumpchan = module:option(ListValue, "app_dumpchan", "Dump channel variables Application", "")
app_dumpchan:value("yes", "Load")
app_dumpchan:value("no", "Do Not Load")
app_dumpchan:value("auto", "Load as Required")
app_dumpchan.rmempty = true
app_echo = module:option(ListValue, "app_echo", "Simple Echo Application", "")
app_echo:value("yes", "Load")
app_echo:value("no", "Do Not Load")
app_echo:value("auto", "Load as Required")
app_echo.rmempty = true
app_enumlookup = module:option(ListValue, "app_enumlookup", "ENUM Lookup", "")
app_enumlookup:value("yes", "Load")
app_enumlookup:value("no", "Do Not Load")
app_enumlookup:value("auto", "Load as Required")
app_enumlookup.rmempty = true
app_eval = module:option(ListValue, "app_eval", "Reevaluates strings", "")
app_eval:value("yes", "Load")
app_eval:value("no", "Do Not Load")
app_eval:value("auto", "Load as Required")
app_eval.rmempty = true
app_exec = module:option(ListValue, "app_exec", "Executes applications", "")
app_exec:value("yes", "Load")
app_exec:value("no", "Do Not Load")
app_exec:value("auto", "Load as Required")
app_exec.rmempty = true
app_externalivr = module:option(ListValue, "app_externalivr", "External IVR application interface", "")
app_externalivr:value("yes", "Load")
app_externalivr:value("no", "Do Not Load")
app_externalivr:value("auto", "Load as Required")
app_externalivr.rmempty = true
app_forkcdr = module:option(ListValue, "app_forkcdr", "Fork The CDR into 2 seperate entities", "")
app_forkcdr:value("yes", "Load")
app_forkcdr:value("no", "Do Not Load")
app_forkcdr:value("auto", "Load as Required")
app_forkcdr.rmempty = true
app_getcpeid = module:option(ListValue, "app_getcpeid", "Get ADSI CPE ID", "")
app_getcpeid:value("yes", "Load")
app_getcpeid:value("no", "Do Not Load")
app_getcpeid:value("auto", "Load as Required")
app_getcpeid.rmempty = true
app_groupcount = module:option(ListValue, "app_groupcount", "Group Management Routines", "")
app_groupcount:value("yes", "Load")
app_groupcount:value("no", "Do Not Load")
app_groupcount:value("auto", "Load as Required")
app_groupcount.rmempty = true
app_ices = module:option(ListValue, "app_ices", "Encode and Stream via icecast and ices", "")
app_ices:value("yes", "Load")
app_ices:value("no", "Do Not Load")
app_ices:value("auto", "Load as Required")
app_ices.rmempty = true
app_image = module:option(ListValue, "app_image", "Image Transmission Application", "")
app_image:value("yes", "Load")
app_image:value("no", "Do Not Load")
app_image:value("auto", "Load as Required")
app_image.rmempty = true
app_lookupblacklist = module:option(ListValue, "app_lookupblacklist", "Look up Caller*ID name/number from black", "")
app_lookupblacklist:value("yes", "Load")
app_lookupblacklist:value("no", "Do Not Load")
app_lookupblacklist:value("auto", "Load as Required")
app_lookupblacklist.rmempty = true
app_lookupcidname = module:option(ListValue, "app_lookupcidname", "Look up CallerID Name from local databas", "")
app_lookupcidname:value("yes", "Load")
app_lookupcidname:value("no", "Do Not Load")
app_lookupcidname:value("auto", "Load as Required")
app_lookupcidname.rmempty = true
app_macro = module:option(ListValue, "app_macro", "Extension Macros", "")
app_macro:value("yes", "Load")
app_macro:value("no", "Do Not Load")
app_macro:value("auto", "Load as Required")
app_macro.rmempty = true
app_math = module:option(ListValue, "app_math", "A simple math Application", "")
app_math:value("yes", "Load")
app_math:value("no", "Do Not Load")
app_math:value("auto", "Load as Required")
app_math.rmempty = true
app_md5 = module:option(ListValue, "app_md5", "MD5 checksum Application", "")
app_md5:value("yes", "Load")
app_md5:value("no", "Do Not Load")
app_md5:value("auto", "Load as Required")
app_md5.rmempty = true
app_milliwatt = module:option(ListValue, "app_milliwatt", "Digital Milliwatt (mu-law) Test Application", "")
app_milliwatt:value("yes", "Load")
app_milliwatt:value("no", "Do Not Load")
app_milliwatt:value("auto", "Load as Required")
app_milliwatt.rmempty = true
app_mixmonitor = module:option(ListValue, "app_mixmonitor", "Record a call and mix the audio during the recording", "")
app_mixmonitor:value("yes", "Load")
app_mixmonitor:value("no", "Do Not Load")
app_mixmonitor:value("auto", "Load as Required")
app_mixmonitor.rmempty = true
app_parkandannounce = module:option(ListValue, "app_parkandannounce", "Call Parking and Announce Application", "")
app_parkandannounce:value("yes", "Load")
app_parkandannounce:value("no", "Do Not Load")
app_parkandannounce:value("auto", "Load as Required")
app_parkandannounce.rmempty = true
app_playback = module:option(ListValue, "app_playback", "Trivial Playback Application", "")
app_playback:value("yes", "Load")
app_playback:value("no", "Do Not Load")
app_playback:value("auto", "Load as Required")
app_playback.rmempty = true
app_privacy = module:option(ListValue, "app_privacy", "Require phone number to be entered", "")
app_privacy:value("yes", "Load")
app_privacy:value("no", "Do Not Load")
app_privacy:value("auto", "Load as Required")
app_privacy.rmempty = true
app_queue = module:option(ListValue, "app_queue", "True Call Queueing", "")
app_queue:value("yes", "Load")
app_queue:value("no", "Do Not Load")
app_queue:value("auto", "Load as Required")
app_queue.rmempty = true
app_random = module:option(ListValue, "app_random", "Random goto", "")
app_random:value("yes", "Load")
app_random:value("no", "Do Not Load")
app_random:value("auto", "Load as Required")
app_random.rmempty = true
app_read = module:option(ListValue, "app_read", "Read Variable Application", "")
app_read:value("yes", "Load")
app_read:value("no", "Do Not Load")
app_read:value("auto", "Load as Required")
app_read.rmempty = true
app_readfile = module:option(ListValue, "app_readfile", "Read in a file", "")
app_readfile:value("yes", "Load")
app_readfile:value("no", "Do Not Load")
app_readfile:value("auto", "Load as Required")
app_readfile.rmempty = true
app_realtime = module:option(ListValue, "app_realtime", "Realtime Data Lookup/Rewrite", "")
app_realtime:value("yes", "Load")
app_realtime:value("no", "Do Not Load")
app_realtime:value("auto", "Load as Required")
app_realtime.rmempty = true
app_record = module:option(ListValue, "app_record", "Trivial Record Application", "")
app_record:value("yes", "Load")
app_record:value("no", "Do Not Load")
app_record:value("auto", "Load as Required")
app_record.rmempty = true
app_sayunixtime = module:option(ListValue, "app_sayunixtime", "Say time", "")
app_sayunixtime:value("yes", "Load")
app_sayunixtime:value("no", "Do Not Load")
app_sayunixtime:value("auto", "Load as Required")
app_sayunixtime.rmempty = true
app_senddtmf = module:option(ListValue, "app_senddtmf", "Send DTMF digits Application", "")
app_senddtmf:value("yes", "Load")
app_senddtmf:value("no", "Do Not Load")
app_senddtmf:value("auto", "Load as Required")
app_senddtmf.rmempty = true
app_sendtext = module:option(ListValue, "app_sendtext", "Send Text Applications", "")
app_sendtext:value("yes", "Load")
app_sendtext:value("no", "Do Not Load")
app_sendtext:value("auto", "Load as Required")
app_sendtext.rmempty = true
app_setcallerid = module:option(ListValue, "app_setcallerid", "Set CallerID Application", "")
app_setcallerid:value("yes", "Load")
app_setcallerid:value("no", "Do Not Load")
app_setcallerid:value("auto", "Load as Required")
app_setcallerid.rmempty = true
app_setcdruserfield = module:option(ListValue, "app_setcdruserfield", "CDR user field apps", "")
app_setcdruserfield:value("yes", "Load")
app_setcdruserfield:value("no", "Do Not Load")
app_setcdruserfield:value("auto", "Load as Required")
app_setcdruserfield.rmempty = true
app_setcidname = module:option(ListValue, "app_setcidname", "load => .so ; Set CallerID Name", "")
app_setcidname:value("yes", "Load")
app_setcidname:value("no", "Do Not Load")
app_setcidname:value("auto", "Load as Required")
app_setcidname.rmempty = true
app_setcidnum = module:option(ListValue, "app_setcidnum", "load => .so ; Set CallerID Number", "")
app_setcidnum:value("yes", "Load")
app_setcidnum:value("no", "Do Not Load")
app_setcidnum:value("auto", "Load as Required")
app_setcidnum.rmempty = true
app_setrdnis = module:option(ListValue, "app_setrdnis", "Set RDNIS Number", "")
app_setrdnis:value("yes", "Load")
app_setrdnis:value("no", "Do Not Load")
app_setrdnis:value("auto", "Load as Required")
app_setrdnis.rmempty = true
app_settransfercapability = module:option(ListValue, "app_settransfercapability", "Set ISDN Transfer Capability", "")
app_settransfercapability:value("yes", "Load")
app_settransfercapability:value("no", "Do Not Load")
app_settransfercapability:value("auto", "Load as Required")
app_settransfercapability.rmempty = true
app_sms = module:option(ListValue, "app_sms", "SMS/PSTN handler", "")
app_sms:value("yes", "Load")
app_sms:value("no", "Do Not Load")
app_sms:value("auto", "Load as Required")
app_sms.rmempty = true
app_softhangup = module:option(ListValue, "app_softhangup", "Hangs up the requested channel", "")
app_softhangup:value("yes", "Load")
app_softhangup:value("no", "Do Not Load")
app_softhangup:value("auto", "Load as Required")
app_softhangup.rmempty = true
app_stack = module:option(ListValue, "app_stack", "Stack Routines", "")
app_stack:value("yes", "Load")
app_stack:value("no", "Do Not Load")
app_stack:value("auto", "Load as Required")
app_stack.rmempty = true
app_system = module:option(ListValue, "app_system", "Generic System() application", "")
app_system:value("yes", "Load")
app_system:value("no", "Do Not Load")
app_system:value("auto", "Load as Required")
app_system.rmempty = true
app_talkdetect = module:option(ListValue, "app_talkdetect", "Playback with Talk Detection", "")
app_talkdetect:value("yes", "Load")
app_talkdetect:value("no", "Do Not Load")
app_talkdetect:value("auto", "Load as Required")
app_talkdetect.rmempty = true
app_test = module:option(ListValue, "app_test", "Interface Test Application", "")
app_test:value("yes", "Load")
app_test:value("no", "Do Not Load")
app_test:value("auto", "Load as Required")
app_test.rmempty = true
app_transfer = module:option(ListValue, "app_transfer", "Transfer", "")
app_transfer:value("yes", "Load")
app_transfer:value("no", "Do Not Load")
app_transfer:value("auto", "Load as Required")
app_transfer.rmempty = true
app_txtcidname = module:option(ListValue, "app_txtcidname", "TXTCIDName", "")
app_txtcidname:value("yes", "Load")
app_txtcidname:value("no", "Do Not Load")
app_txtcidname:value("auto", "Load as Required")
app_txtcidname.rmempty = true
app_url = module:option(ListValue, "app_url", "Send URL Applications", "")
app_url:value("yes", "Load")
app_url:value("no", "Do Not Load")
app_url:value("auto", "Load as Required")
app_url.rmempty = true
app_userevent = module:option(ListValue, "app_userevent", "Custom User Event Application", "")
app_userevent:value("yes", "Load")
app_userevent:value("no", "Do Not Load")
app_userevent:value("auto", "Load as Required")
app_userevent.rmempty = true
app_verbose = module:option(ListValue, "app_verbose", "Send verbose output", "")
app_verbose:value("yes", "Load")
app_verbose:value("no", "Do Not Load")
app_verbose:value("auto", "Load as Required")
app_verbose.rmempty = true
app_voicemail = module:option(ListValue, "app_voicemail", "Voicemail", "")
app_voicemail:value("yes", "Load")
app_voicemail:value("no", "Do Not Load")
app_voicemail:value("auto", "Load as Required")
app_voicemail.rmempty = true
app_waitforring = module:option(ListValue, "app_waitforring", "Waits until first ring after time", "")
app_waitforring:value("yes", "Load")
app_waitforring:value("no", "Do Not Load")
app_waitforring:value("auto", "Load as Required")
app_waitforring.rmempty = true
app_waitforsilence = module:option(ListValue, "app_waitforsilence", "Wait For Silence Application", "")
app_waitforsilence:value("yes", "Load")
app_waitforsilence:value("no", "Do Not Load")
app_waitforsilence:value("auto", "Load as Required")
app_waitforsilence.rmempty = true
app_while = module:option(ListValue, "app_while", "While Loops and Conditional Execution", "")
app_while:value("yes", "Load")
app_while:value("no", "Do Not Load")
app_while:value("auto", "Load as Required")
app_while.rmempty = true
return cbimap

View File

@@ -0,0 +1,58 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-mod-cdr.lua 3618 2008-10-23 02:25:26Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
module = cbimap:section(TypedSection, "module", "Modules", "")
module.anonymous = true
cdr_csv = module:option(ListValue, "cdr_csv", "Comma Separated Values CDR Backend", "")
cdr_csv:value("yes", "Load")
cdr_csv:value("no", "Do Not Load")
cdr_csv:value("auto", "Load as Required")
cdr_csv.rmempty = true
cdr_custom = module:option(ListValue, "cdr_custom", "Customizable Comma Separated Values CDR Backend", "")
cdr_custom:value("yes", "Load")
cdr_custom:value("no", "Do Not Load")
cdr_custom:value("auto", "Load as Required")
cdr_custom.rmempty = true
cdr_manager = module:option(ListValue, "cdr_manager", "Asterisk Call Manager CDR Backend", "")
cdr_manager:value("yes", "Load")
cdr_manager:value("no", "Do Not Load")
cdr_manager:value("auto", "Load as Required")
cdr_manager.rmempty = true
cdr_mysql = module:option(ListValue, "cdr_mysql", "MySQL CDR Backend", "")
cdr_mysql:value("yes", "Load")
cdr_mysql:value("no", "Do Not Load")
cdr_mysql:value("auto", "Load as Required")
cdr_mysql.rmempty = true
cdr_pgsql = module:option(ListValue, "cdr_pgsql", "PostgreSQL CDR Backend", "")
cdr_pgsql:value("yes", "Load")
cdr_pgsql:value("no", "Do Not Load")
cdr_pgsql:value("auto", "Load as Required")
cdr_pgsql.rmempty = true
cdr_sqlite = module:option(ListValue, "cdr_sqlite", "SQLite CDR Backend", "")
cdr_sqlite:value("yes", "Load")
cdr_sqlite:value("no", "Do Not Load")
cdr_sqlite:value("auto", "Load as Required")
cdr_sqlite.rmempty = true
return cbimap

View File

@@ -0,0 +1,56 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-mod-chan.lua 3618 2008-10-23 02:25:26Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
module = cbimap:section(TypedSection, "module", "Modules", "")
module.anonymous = true
chan_agent = module:option(ListValue, "chan_agent", "Agent Proxy Channel", "")
chan_agent:value("yes", "Load")
chan_agent:value("no", "Do Not Load")
chan_agent:value("auto", "Load as Required")
chan_agent.rmempty = true
chan_alsa = module:option(ListValue, "chan_alsa", "Channel driver for GTalk", "")
chan_alsa:value("yes", "Load")
chan_alsa:value("no", "Do Not Load")
chan_alsa:value("auto", "Load as Required")
chan_alsa.rmempty = true
chan_gtalk = module:option(ListValue, "chan_gtalk", "Channel driver for GTalk", "")
chan_gtalk:value("yes", "Load")
chan_gtalk:value("no", "Do Not Load")
chan_gtalk:value("auto", "Load as Required")
chan_gtalk.rmempty = true
chan_iax2 = module:option(Flag, "chan_iax2", "Option chan_iax2", "")
chan_iax2.rmempty = true
chan_local = module:option(ListValue, "chan_local", "Local Proxy Channel", "")
chan_local:value("yes", "Load")
chan_local:value("no", "Do Not Load")
chan_local:value("auto", "Load as Required")
chan_local.rmempty = true
chan_sip = module:option(ListValue, "chan_sip", "Session Initiation Protocol (SIP)", "")
chan_sip:value("yes", "Load")
chan_sip:value("no", "Do Not Load")
chan_sip:value("auto", "Load as Required")
chan_sip.rmempty = true
return cbimap

View File

@@ -0,0 +1,64 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-mod-codec.lua 3618 2008-10-23 02:25:26Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
module = cbimap:section(TypedSection, "module", "Modules", "")
module.anonymous = true
codec_a_mu = module:option(ListValue, "codec_a_mu", "A-law and Mulaw direct Coder/Decoder", "")
codec_a_mu:value("yes", "Load")
codec_a_mu:value("no", "Do Not Load")
codec_a_mu:value("auto", "Load as Required")
codec_a_mu.rmempty = true
codec_adpcm = module:option(ListValue, "codec_adpcm", "Adaptive Differential PCM Coder/Decoder", "")
codec_adpcm:value("yes", "Load")
codec_adpcm:value("no", "Do Not Load")
codec_adpcm:value("auto", "Load as Required")
codec_adpcm.rmempty = true
codec_alaw = module:option(ListValue, "codec_alaw", "A-law Coder/Decoder", "")
codec_alaw:value("yes", "Load")
codec_alaw:value("no", "Do Not Load")
codec_alaw:value("auto", "Load as Required")
codec_alaw.rmempty = true
codec_g726 = module:option(ListValue, "codec_g726", "ITU G.726-32kbps G726 Transcoder", "")
codec_g726:value("yes", "Load")
codec_g726:value("no", "Do Not Load")
codec_g726:value("auto", "Load as Required")
codec_g726.rmempty = true
codec_gsm = module:option(ListValue, "codec_gsm", "GSM/PCM16 (signed linear) Codec Translation", "")
codec_gsm:value("yes", "Load")
codec_gsm:value("no", "Do Not Load")
codec_gsm:value("auto", "Load as Required")
codec_gsm.rmempty = true
codec_speex = module:option(ListValue, "codec_speex", "Speex/PCM16 (signed linear) Codec Translator", "")
codec_speex:value("yes", "Load")
codec_speex:value("no", "Do Not Load")
codec_speex:value("auto", "Load as Required")
codec_speex.rmempty = true
codec_ulaw = module:option(ListValue, "codec_ulaw", "Mu-law Coder/Decoder", "")
codec_ulaw:value("yes", "Load")
codec_ulaw:value("no", "Do Not Load")
codec_ulaw:value("auto", "Load as Required")
codec_ulaw.rmempty = true
return cbimap

View File

@@ -0,0 +1,100 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-mod-format.lua 3618 2008-10-23 02:25:26Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
module = cbimap:section(TypedSection, "module", "Modules", "")
module.anonymous = true
format_au = module:option(ListValue, "format_au", "Sun Microsystems AU format (signed linear)", "")
format_au:value("yes", "Load")
format_au:value("no", "Do Not Load")
format_au:value("auto", "Load as Required")
format_au.rmempty = true
format_g723 = module:option(ListValue, "format_g723", "G.723.1 Simple Timestamp File Format", "")
format_g723:value("yes", "Load")
format_g723:value("no", "Do Not Load")
format_g723:value("auto", "Load as Required")
format_g723.rmempty = true
format_g726 = module:option(ListValue, "format_g726", "Raw G.726 (16/24/32/40kbps) data", "")
format_g726:value("yes", "Load")
format_g726:value("no", "Do Not Load")
format_g726:value("auto", "Load as Required")
format_g726.rmempty = true
format_g729 = module:option(ListValue, "format_g729", "Raw G729 data", "")
format_g729:value("yes", "Load")
format_g729:value("no", "Do Not Load")
format_g729:value("auto", "Load as Required")
format_g729.rmempty = true
format_gsm = module:option(ListValue, "format_gsm", "Raw GSM data", "")
format_gsm:value("yes", "Load")
format_gsm:value("no", "Do Not Load")
format_gsm:value("auto", "Load as Required")
format_gsm.rmempty = true
format_h263 = module:option(ListValue, "format_h263", "Raw h263 data", "")
format_h263:value("yes", "Load")
format_h263:value("no", "Do Not Load")
format_h263:value("auto", "Load as Required")
format_h263.rmempty = true
format_jpeg = module:option(ListValue, "format_jpeg", "JPEG (Joint Picture Experts Group) Image", "")
format_jpeg:value("yes", "Load")
format_jpeg:value("no", "Do Not Load")
format_jpeg:value("auto", "Load as Required")
format_jpeg.rmempty = true
format_pcm = module:option(ListValue, "format_pcm", "Raw uLaw 8khz Audio support (PCM)", "")
format_pcm:value("yes", "Load")
format_pcm:value("no", "Do Not Load")
format_pcm:value("auto", "Load as Required")
format_pcm.rmempty = true
format_pcm_alaw = module:option(ListValue, "format_pcm_alaw", "load => .so ; Raw aLaw 8khz PCM Audio support", "")
format_pcm_alaw:value("yes", "Load")
format_pcm_alaw:value("no", "Do Not Load")
format_pcm_alaw:value("auto", "Load as Required")
format_pcm_alaw.rmempty = true
format_sln = module:option(ListValue, "format_sln", "Raw Signed Linear Audio support (SLN)", "")
format_sln:value("yes", "Load")
format_sln:value("no", "Do Not Load")
format_sln:value("auto", "Load as Required")
format_sln.rmempty = true
format_vox = module:option(ListValue, "format_vox", "Dialogic VOX (ADPCM) File Format", "")
format_vox:value("yes", "Load")
format_vox:value("no", "Do Not Load")
format_vox:value("auto", "Load as Required")
format_vox.rmempty = true
format_wav = module:option(ListValue, "format_wav", "Microsoft WAV format (8000hz Signed Line", "")
format_wav:value("yes", "Load")
format_wav:value("no", "Do Not Load")
format_wav:value("auto", "Load as Required")
format_wav.rmempty = true
format_wav_gsm = module:option(ListValue, "format_wav_gsm", "Microsoft WAV format (Proprietary GSM)", "")
format_wav_gsm:value("yes", "Load")
format_wav_gsm:value("no", "Do Not Load")
format_wav_gsm:value("auto", "Load as Required")
format_wav_gsm.rmempty = true
return cbimap

View File

@@ -0,0 +1,40 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-mod-func.lua 3618 2008-10-23 02:25:26Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
module = cbimap:section(TypedSection, "module", "Modules", "")
module.anonymous = true
func_callerid = module:option(ListValue, "func_callerid", "Caller ID related dialplan functions", "")
func_callerid:value("yes", "Load")
func_callerid:value("no", "Do Not Load")
func_callerid:value("auto", "Load as Required")
func_callerid.rmempty = true
func_enum = module:option(ListValue, "func_enum", "ENUM Functions", "")
func_enum:value("yes", "Load")
func_enum:value("no", "Do Not Load")
func_enum:value("auto", "Load as Required")
func_enum.rmempty = true
func_uri = module:option(ListValue, "func_uri", "URI encoding / decoding functions", "")
func_uri:value("yes", "Load")
func_uri:value("no", "Do Not Load")
func_uri:value("auto", "Load as Required")
func_uri.rmempty = true
return cbimap

View File

@@ -0,0 +1,64 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-mod-pbx.lua 3618 2008-10-23 02:25:26Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
module = cbimap:section(TypedSection, "module", "Modules", "")
module.anonymous = true
pbx_ael = module:option(ListValue, "pbx_ael", "Asterisk Extension Language Compiler", "")
pbx_ael:value("yes", "Load")
pbx_ael:value("no", "Do Not Load")
pbx_ael:value("auto", "Load as Required")
pbx_ael.rmempty = true
pbx_config = module:option(ListValue, "pbx_config", "Text Extension Configuration", "")
pbx_config:value("yes", "Load")
pbx_config:value("no", "Do Not Load")
pbx_config:value("auto", "Load as Required")
pbx_config.rmempty = true
pbx_functions = module:option(ListValue, "pbx_functions", "load => .so ; Builtin dialplan functions", "")
pbx_functions:value("yes", "Load")
pbx_functions:value("no", "Do Not Load")
pbx_functions:value("auto", "Load as Required")
pbx_functions.rmempty = true
pbx_loopback = module:option(ListValue, "pbx_loopback", "Loopback Switch", "")
pbx_loopback:value("yes", "Load")
pbx_loopback:value("no", "Do Not Load")
pbx_loopback:value("auto", "Load as Required")
pbx_loopback.rmempty = true
pbx_realtime = module:option(ListValue, "pbx_realtime", "Realtime Switch", "")
pbx_realtime:value("yes", "Load")
pbx_realtime:value("no", "Do Not Load")
pbx_realtime:value("auto", "Load as Required")
pbx_realtime.rmempty = true
pbx_spool = module:option(ListValue, "pbx_spool", "Outgoing Spool Support", "")
pbx_spool:value("yes", "Load")
pbx_spool:value("no", "Do Not Load")
pbx_spool:value("auto", "Load as Required")
pbx_spool.rmempty = true
pbx_wilcalu = module:option(ListValue, "pbx_wilcalu", "Wil Cal U (Auto Dialer)", "")
pbx_wilcalu:value("yes", "Load")
pbx_wilcalu:value("no", "Do Not Load")
pbx_wilcalu:value("auto", "Load as Required")
pbx_wilcalu.rmempty = true
return cbimap

View File

@@ -0,0 +1,111 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-mod-res-feature.lua 3620 2008-10-23 15:42:12Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
featuremap = cbimap:section(TypedSection, "featuremap", "Feature Key maps", "")
featuremap.anonymous = true
featuremap.addremove = true
atxfer = featuremap:option(Value, "atxfer", "Attended transfer key", "")
atxfer.rmempty = true
blindxfer = featuremap:option(Value, "blindxfer", "Blind transfer key", "")
blindxfer.rmempty = true
disconnect = featuremap:option(Value, "disconnect", "Key to Disconnect call", "")
disconnect.rmempty = true
parkcall = featuremap:option(Value, "parkcall", "Key to Park call", "")
parkcall.rmempty = true
featurepark = cbimap:section(TypedSection, "featurepark", "Parking Feature", "")
featurepark.anonymous = true
parkenabled = featurepark:option(Flag, "parkenabled", "Enable Parking", "")
adsipark = featurepark:option(Flag, "adsipark", "ADSI Park", "")
adsipark.rmempty = true
adsipark:depends({ parkenabled = "1" })
atxfernoanswertimeout = featurepark:option(Value, "atxfernoanswertimeout", "Attended transfer timeout (sec)", "")
atxfernoanswertimeout.rmempty = true
atxfernoanswertimeout:depends({ parkenabled = "1" })
automon = featurepark:option(Value, "automon", "One touch record key", "")
automon.rmempty = true
automon:depends({ parkenabled = "1" })
context = featurepark:option(Value, "context", "Name of call context for parking", "")
context.rmempty = true
context:depends({ parkenabled = "1" })
courtesytone = featurepark:option(Value, "courtesytone", "Sound file to play to parked caller", "")
courtesytone.rmempty = true
courtesytone:depends({ parkenabled = "1" })
featuredigittimeout = featurepark:option(Value, "featuredigittimeout", "Max time (ms) between digits for feature activation", "")
featuredigittimeout.rmempty = true
featuredigittimeout:depends({ parkenabled = "1" })
findslot = featurepark:option(ListValue, "findslot", "Method to Find Parking slot", "")
findslot:value("first", "First available slot")
findslot:value("next", "Next free parking space")
findslot.rmempty = true
findslot:depends({ parkenabled = "1" })
parkedmusicclass = featurepark:option(ListValue, "parkedmusicclass", "Music on Hold class for the parked channel", "")
parkedmusicclass.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk" )
parkedmusicclass:depends({ parkenabled = "1" })
cbimap.uci:foreach( "asterisk", "moh", function(s) parkedmusicclass:value(s['.name']) end )
parkedplay = featurepark:option(ListValue, "parkedplay", "Play courtesy tone to", "")
parkedplay:value("caller", "Caller")
parkedplay:value("parked", "Parked user")
parkedplay:value("both", "Both")
parkedplay.rmempty = true
parkedplay:depends({ parkenabled = "1" })
parkext = featurepark:option(Value, "parkext", "Extension to dial to park", "")
parkext.rmempty = true
parkext:depends({ parkenabled = "1" })
parkingtime = featurepark:option(Value, "parkingtime", "Parking time (secs)", "")
parkingtime.rmempty = true
parkingtime:depends({ parkenabled = "1" })
parkpos = featurepark:option(Value, "parkpos", "Range of extensions for call parking", "")
parkpos.rmempty = true
parkpos:depends({ parkenabled = "1" })
pickupexten = featurepark:option(Value, "pickupexten", "Pickup extension", "")
pickupexten.rmempty = true
pickupexten:depends({ parkenabled = "1" })
transferdigittimeout = featurepark:option(Value, "transferdigittimeout", "Seconds to wait bewteen digits when transferring", "")
transferdigittimeout.rmempty = true
transferdigittimeout:depends({ parkenabled = "1" })
xferfailsound = featurepark:option(Value, "xferfailsound", "sound when attended transfer is complete", "")
xferfailsound.rmempty = true
xferfailsound:depends({ parkenabled = "1" })
xfersound = featurepark:option(Value, "xfersound", "Sound when attended transfer fails", "")
xfersound.rmempty = true
xfersound:depends({ parkenabled = "1" })
return cbimap

View File

@@ -0,0 +1,88 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-mod-res.lua 3618 2008-10-23 02:25:26Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
module = cbimap:section(TypedSection, "module", "Modules", "")
module.anonymous = true
res_config_mysql = module:option(ListValue, "res_config_mysql", "MySQL Config Resource", "")
res_config_mysql:value("yes", "Load")
res_config_mysql:value("no", "Do Not Load")
res_config_mysql:value("auto", "Load as Required")
res_config_mysql.rmempty = true
res_config_odbc = module:option(ListValue, "res_config_odbc", "ODBC Config Resource", "")
res_config_odbc:value("yes", "Load")
res_config_odbc:value("no", "Do Not Load")
res_config_odbc:value("auto", "Load as Required")
res_config_odbc.rmempty = true
res_config_pgsql = module:option(ListValue, "res_config_pgsql", "PGSQL Module", "")
res_config_pgsql:value("yes", "Load")
res_config_pgsql:value("no", "Do Not Load")
res_config_pgsql:value("auto", "Load as Required")
res_config_pgsql.rmempty = true
res_crypto = module:option(ListValue, "res_crypto", "Cryptographic Digital Signatures", "")
res_crypto:value("yes", "Load")
res_crypto:value("no", "Do Not Load")
res_crypto:value("auto", "Load as Required")
res_crypto.rmempty = true
res_features = module:option(ListValue, "res_features", "Call Parking Resource", "")
res_features:value("yes", "Load")
res_features:value("no", "Do Not Load")
res_features:value("auto", "Load as Required")
res_features.rmempty = true
res_indications = module:option(ListValue, "res_indications", "Indications Configuration", "")
res_indications:value("yes", "Load")
res_indications:value("no", "Do Not Load")
res_indications:value("auto", "Load as Required")
res_indications.rmempty = true
res_monitor = module:option(ListValue, "res_monitor", "Call Monitoring Resource", "")
res_monitor:value("yes", "Load")
res_monitor:value("no", "Do Not Load")
res_monitor:value("auto", "Load as Required")
res_monitor.rmempty = true
res_musiconhold = module:option(ListValue, "res_musiconhold", "Music On Hold Resource", "")
res_musiconhold:value("yes", "Load")
res_musiconhold:value("no", "Do Not Load")
res_musiconhold:value("auto", "Load as Required")
res_musiconhold.rmempty = true
res_odbc = module:option(ListValue, "res_odbc", "ODBC Resource", "")
res_odbc:value("yes", "Load")
res_odbc:value("no", "Do Not Load")
res_odbc:value("auto", "Load as Required")
res_odbc.rmempty = true
res_smdi = module:option(ListValue, "res_smdi", "SMDI Module", "")
res_smdi:value("yes", "Load")
res_smdi:value("no", "Do Not Load")
res_smdi:value("auto", "Load as Required")
res_smdi.rmempty = true
res_snmp = module:option(ListValue, "res_snmp", "SNMP Module", "")
res_snmp:value("yes", "Load")
res_snmp:value("no", "Do Not Load")
res_snmp:value("auto", "Load as Required")
res_snmp.rmempty = true
return cbimap

View File

@@ -0,0 +1,109 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-sip-connections.lua 3620 2008-10-23 15:42:12Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
sip = cbimap:section(TypedSection, "sip", "SIP Connection", "")
sip.addremove = true
alwaysinternational = sip:option(Flag, "alwaysinternational", "Always Dial International", "")
alwaysinternational.optional = true
canreinvite = sip:option(ListValue, "canreinvite", "Reinvite/redirect media connections", "")
canreinvite:value("yes", "Yes")
canreinvite:value("nonat", "Yes when not behind NAT")
canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection")
canreinvite:value("no", "No")
canreinvite.optional = true
context = sip:option(ListValue, "context", "Context to use", "")
context.titleref = luci.dispatcher.build_url( "admin", "services", "asterisk", "dialplans" )
cbimap.uci:foreach( "asterisk", "dialplan", function(s) context:value(s['.name']) end )
cbimap.uci:foreach( "asterisk", "dialzone", function(s) context:value(s['.name']) end )
countrycode = sip:option(Value, "countrycode", "Country Code for connection", "")
countrycode.optional = true
dtmfmode = sip:option(ListValue, "dtmfmode", "DTMF mode", "")
dtmfmode:value("info", "Use RFC2833 or INFO for the BudgeTone")
dtmfmode:value("rfc2833", "Use RFC2833 for the BudgeTone")
dtmfmode:value("inband", "Use Inband (only with ulaw/alaw)")
dtmfmode.optional = true
extension = sip:option(Value, "extension", "Add as Extension", "")
extension.optional = true
fromdomain = sip:option(Value, "fromdomain", "Primary domain identity for From: headers", "")
fromdomain.optional = true
fromuser = sip:option(Value, "fromuser", "From user (required by many SIP providers)", "")
fromuser.optional = true
host = sip:option(Value, "host", "Host name (or blank)", "")
host.optional = true
incoming = sip:option(DynamicList, "incoming", "Ring on incoming dialplan contexts", "")
incoming.optional = true
insecure = sip:option(ListValue, "insecure", "Allow Insecure for", "")
insecure:value("port", "Allow mismatched port number")
insecure:value("invite", "Do not require auth of incoming INVITE")
insecure:value("port,invite", "Allow mismatched port and Do not require auth of incoming INVITE")
insecure.optional = true
internationalprefix = sip:option(Value, "internationalprefix", "International Dial Prefix", "")
internationalprefix.optional = true
mailbox = sip:option(Value, "mailbox", "Mailbox for MWI", "")
mailbox.optional = true
nat = sip:option(Flag, "nat", "NAT between phone and Asterisk", "")
nat.optional = true
pedantic = sip:option(Flag, "pedantic", "Check tags in headers", "")
pedantic.optional = true
port = sip:option(Value, "port", "SIP Port", "")
port.optional = true
prefix = sip:option(Value, "prefix", "Dial Prefix (for external line)", "")
prefix.optional = true
qualify = sip:option(Value, "qualify", "Reply Timeout (ms) for down connection", "")
qualify.optional = true
register = sip:option(Flag, "register", "Register connection", "")
register.optional = true
secret = sip:option(Value, "secret", "Secret", "")
secret.optional = true
selfmailbox = sip:option(Flag, "selfmailbox", "Dial own extension for mailbox", "")
selfmailbox.optional = true
timeout = sip:option(Value, "timeout", "Dial Timeout (sec)", "")
timeout.optional = true
type = sip:option(ListValue, "type", "Client Type", "")
type:value("friend", "Friend (outbound/inbound)")
type:value("user", "User (inbound - authenticate by \"from\")")
type:value("peer", "Peer (outbound - match by host)")
type.optional = true
username = sip:option(Value, "username", "Username", "")
username.optional = true
return cbimap

View File

@@ -0,0 +1,52 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk-voice.lua 3620 2008-10-23 15:42:12Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
voicegeneral = cbimap:section(TypedSection, "voicegeneral", "Voicemail general options", "")
serveremail = voicegeneral:option(Value, "serveremail", "From Email address of server", "")
voicemail = cbimap:section(TypedSection, "voicemail", "Voice Mail boxes", "")
voicemail.addremove = true
attach = voicemail:option(Flag, "attach", "Email contains attachment", "")
attach.rmempty = true
email = voicemail:option(Value, "email", "Email", "")
email.rmempty = true
name = voicemail:option(Value, "name", "Display Name", "")
name.rmempty = true
password = voicemail:option(Value, "password", "Password", "")
password.rmempty = true
zone = voicemail:option(ListValue, "zone", "Voice Zone", "")
cbimap.uci:foreach( "asterisk", "voicezone", function(s) zone:value(s['.name']) end )
voicezone = cbimap:section(TypedSection, "voicezone", "Voice Zone settings", "")
voicezone.addremove = true
message = voicezone:option(Value, "message", "Message Format", "")
message.rmempty = true
zone = voicezone:option(Value, "zone", "Time Zone", "")
zone.rmempty = true
return cbimap

View File

@@ -0,0 +1,162 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: asterisk.lua 3618 2008-10-23 02:25:26Z jow $
]]--
cbimap = Map("asterisk", "asterisk", "")
asterisk = cbimap:section(TypedSection, "asterisk", "Asterisk General Options", "")
asterisk.anonymous = true
agidir = asterisk:option(Value, "agidir", "AGI directory", "")
agidir.rmempty = true
cache_record_files = asterisk:option(Flag, "cache_record_files", "Cache recorded sound files during recording", "")
cache_record_files.rmempty = true
debug = asterisk:option(Value, "debug", "Debug Level", "")
debug.rmempty = true
dontwarn = asterisk:option(Flag, "dontwarn", "Disable some warnings", "")
dontwarn.rmempty = true
dumpcore = asterisk:option(Flag, "dumpcore", "Dump core on crash", "")
dumpcore.rmempty = true
highpriority = asterisk:option(Flag, "highpriority", "High Priority", "")
highpriority.rmempty = true
initcrypto = asterisk:option(Flag, "initcrypto", "Initialise Crypto", "")
initcrypto.rmempty = true
internal_timing = asterisk:option(Flag, "internal_timing", "Use Internal Timing", "")
internal_timing.rmempty = true
logdir = asterisk:option(Value, "logdir", "Log directory", "")
logdir.rmempty = true
maxcalls = asterisk:option(Value, "maxcalls", "Maximum number of calls allowed", "")
maxcalls.rmempty = true
maxload = asterisk:option(Value, "maxload", "Maximum load to stop accepting new calls", "")
maxload.rmempty = true
nocolor = asterisk:option(Flag, "nocolor", "Disable console colors", "")
nocolor.rmempty = true
record_cache_dir = asterisk:option(Value, "record_cache_dir", "Sound files Cache directory", "")
record_cache_dir.rmempty = true
record_cache_dir:depends({ ["cache_record_files"] = "true" })
rungroup = asterisk:option(Flag, "rungroup", "The Group to run as", "")
rungroup.rmempty = true
runuser = asterisk:option(Flag, "runuser", "The User to run as", "")
runuser.rmempty = true
spooldir = asterisk:option(Value, "spooldir", "Voicemail Spool directory", "")
spooldir.rmempty = true
systemname = asterisk:option(Value, "systemname", "Prefix UniquID with system name", "")
systemname.rmempty = true
transcode_via_sln = asterisk:option(Flag, "transcode_via_sln", "Build transcode paths via SLINEAR, not directly", "")
transcode_via_sln.rmempty = true
transmit_silence_during_record = asterisk:option(Flag, "transmit_silence_during_record", "Transmit SLINEAR silence while recording a channel", "")
transmit_silence_during_record.rmempty = true
verbose = asterisk:option(Value, "verbose", "Verbose Level", "")
verbose.rmempty = true
zone = asterisk:option(Value, "zone", "Time Zone", "")
zone.rmempty = true
hardwarereboot = cbimap:section(TypedSection, "hardwarereboot", "Reload Hardware Config", "")
method = hardwarereboot:option(ListValue, "method", "Reboot Method", "")
method:value("web", "Web URL (wget)")
method:value("system", "program to run")
method.rmempty = true
param = hardwarereboot:option(Value, "param", "Parameter", "")
param.rmempty = true
iaxgeneral = cbimap:section(TypedSection, "iaxgeneral", "IAX General Options", "")
iaxgeneral.anonymous = true
iaxgeneral.addremove = true
allow = iaxgeneral:option(MultiValue, "allow", "Allow Codecs", "")
allow:value("alaw", "alaw")
allow:value("gsm", "gsm")
allow:value("g726", "g726")
allow.rmempty = true
canreinvite = iaxgeneral:option(ListValue, "canreinvite", "Reinvite/redirect media connections", "")
canreinvite:value("yes", "Yes")
canreinvite:value("nonat", "Yes when not behind NAT")
canreinvite:value("update", "Use UPDATE rather than INVITE for path redirection")
canreinvite:value("no", "No")
canreinvite.rmempty = true
static = iaxgeneral:option(Flag, "static", "Static", "")
static.rmempty = true
writeprotect = iaxgeneral:option(Flag, "writeprotect", "Write Protect", "")
writeprotect.rmempty = true
sipgeneral = cbimap:section(TypedSection, "sipgeneral", "Section sipgeneral", "")
sipgeneral.anonymous = true
sipgeneral.addremove = true
allow = sipgeneral:option(MultiValue, "allow", "Allow codecs", "")
allow:value("ulaw", "ulaw")
allow:value("alaw", "alaw")
allow:value("gsm", "gsm")
allow:value("g726", "g726")
allow.rmempty = true
port = sipgeneral:option(Value, "port", "SIP Port", "")
port.rmempty = true
realm = sipgeneral:option(Value, "realm", "SIP realm", "")
realm.rmempty = true
moh = cbimap:section(TypedSection, "moh", "Music On Hold", "")
application = moh:option(Value, "application", "Application", "")
application.rmempty = true
application:depends({ ["asterisk.moh.mode"] = "custom" })
directory = moh:option(Value, "directory", "Directory of Music", "")
directory.rmempty = true
mode = moh:option(ListValue, "mode", "Option mode", "")
mode:value("system", "program to run")
mode:value("files", "Read files from directory")
mode:value("quietmp3", "Quite MP3")
mode:value("mp3", "Loud MP3")
mode:value("mp3nb", "unbuffered MP3")
mode:value("quietmp3nb", "Quiet Unbuffered MP3")
mode:value("custom", "Run a custom application")
mode.rmempty = true
random = moh:option(Flag, "random", "Random Play", "")
random.rmempty = true
return cbimap

View File

@@ -0,0 +1,228 @@
config 'asterisk'
option 'verbose' 3
option 'debug' 3
option 'zone' 'Australia/Perth'
config 'hardware' 'reboot'
option 'method' 'web'
option 'param' 'http://ata.lan/admin/reboot'
config 'feature' 'park'
option 'parkenabled' 'yes'
option 'parkext' '700'
option 'parkpos' '701-720'
option 'context' 'parkedcalls'
option 'parkingtime' '45'
option 'courtesytone' 'beep'
option 'parkedplay' 'caller'
option 'adsipark' 'yes'
option 'findslot' 'first'
option 'parkedmusicclass' 'default'
option 'transferdigittimeout' '3'
option 'xfersound' 'beep'
option 'xferfailsound' 'beeperr'
option 'pickupexten' '"*8"'
option 'featuredigittimeout' '500'
option 'atxfernoanswertimeout' '15'
config 'feature' 'map'
option 'blindxfer' '#1'
option 'disconnect' '*0'
option 'automon' '*1'
option 'atxfer' '#2'
option 'parkcall' '#30'
config 'sipgeneral'
option 'realm' 'sip.mydomain.net'
option 'allow' 'alaw'
option 'extension' '102'
config 'module'
option 'res_config_mysql' 'no'
option 'res_crypto' 'auto'
option 'chan_iax2' 'yes'
config 'sip' 'PAP2T'
option 'type' 'friend'
option 'extension' '101'
option 'username' 'PAP2T'
option 'secret' 'mypass'
option 'port' '5061'
option 'host' ''
option 'dtmfmode' 'rfc2833'
option 'insecure' 'very'
option 'context' 'internal'
option 'mailbox' '1001@default'
option 'nat' 'no'
option 'canreinvite' 'nonat'
option 'selfmailbox' 'yes'
option 'incoming' 'provider_inbound'
config 'sip' 'PAP2T2'
option 'type' 'friend'
option 'extension' '101'
option 'username' 'PAP2T2'
option 'secret' 'mysecret'
option 'port' '5060'
option 'host' ''
option 'dtmfmode' 'rfc2833'
option 'insecure' 'very'
option 'context' 'internal'
option 'mailbox' '1001@default'
option 'nat' 'no'
option 'canreinvite' 'nonat'
option 'selfmailbox' 'yes'
option 'incoming' 'provider_inbound'
config 'sip' 'providerphone'
option 'type' 'friend'
option 'timeout' '55'
option 'internationalprefix' '0011'
option 'alwaysinternational' 'no'
option 'countrycode' '63'
option 'register' 'yes'
option 'host' '200.200.200.200'
option 'username' '0899999999'
option 'fromuser' '0899999999'
option 'secret' 'mysecret'
option 'fromdomain' 'providerphone.provider.net.au'
option 'context' 'provider_inbound'
option 'canreinvite' 'no'
option 'nat' 'yes'
option 'qualify' 'yes'
option 'insecure' 'very'
option 'pedantic' 'no'
option 'qualify' '1000'
config 'iaxgeneral'
option 'static' 'yes'
option 'writeprotect' 'no'
option 'canreinvite' 'no'
option 'allow' 'ulaw,gsm'
config 'iax' 'nell'
option 'type' 'friend'
option 'extension' '108'
option 'host' ''
option 'username' 'nell'
option 'secret' 'mypass'
option 'context' 'internal'
config 'iax' 'iax_vista'
option 'extension' '106'
option 'type' 'friend'
option 'host' ''
option 'username' 'vista'
option 'secret' 'mysecret'
option 'context' 'internal'
config 'iax' 'sam'
option 'type' 'friend'
option 'extension' '103'
option 'host' ''
option 'username' 'sam'
option 'secret' 'mysecret'
option 'context' 'internal'
config 'voicegeneral'
option 'serveremail' 'voice@sip.mydomain.net'
config 'voicemail' '1001'
option 'context' 'default'
option 'password' '0000'
option 'name' 'Family'
option 'email' 'us@mydomain.net'
option 'zone' 'wa'
option 'attach' 'no'
config 'voicezone' 'wa'
option 'zone' 'Australia/Perth'
option 'message' 'Q IMp'
config 'voicezone' 'military'
option 'zone' 'Zulu'
option 'message' '"vm-received" q "digits/at" H N "hours" "phonetic/z_p"'
config 'incominggeneral'
option 'allowtransfer' 'no'
option 'timeout' '20'
option 'answerfirst' 'no'
option 'mailbox' '1001@default'
config 'dialplangeneral'
option 'static' 'yes'
option 'writeprotect' 'no'
option 'canreinvite' 'no'
option 'clearglobalvars' 'no'
option 'allowtransfer' 'no'
config 'dialplan' 'internal'
option 'include' 'localcall interstate smartnumber emergency extensions'
config 'dialplanvoice'
option 'dialplan' 'internal'
option 'extension' '1001'
option 'voicecontext' 'default'
option 'voicebox' '1001'
config 'dialplansaytime'
option 'dialplan' 'internal'
option 'extension' '108'
config 'dialplanmeetme'
option 'dialplan' 'internal'
option 'extension' '109'
option 'room' '101'
config 'dialplanmeetme'
option 'dialplan' 'internal'
option 'extension' '1009'
option 'room' ''
config 'dialplan' 'localinternational'
option 'include' 'mobile interstate'
config 'dialzone' 'interstate'
option 'uses' 'SIP/providerphone'
option 'match' '0[235-8]NXXXXXXX'
option 'localprefix' '0'
config 'dialzone' 'mobile'
option 'uses' 'SIP/iinetphone'
option 'match' '04XXXXXXXX'
option 'localprefix' '0'
config 'dialzone' 'smartnumber'
option 'uses' 'SIP/providerphone'
option 'match' '1[835]00.'
option 'match' '13ZXXX'
config 'dialzone' 'emergency'
option 'uses' 'SIP/providerphone'
option 'match' '000'
option 'match' '112'
config 'dialzone' 'localcall'
option 'uses' 'SIP/providerphone'
option 'match' 'NXXXXXXX'
option 'addprefix' '08'
option 'localprefix' '0'
config 'dialzone' 'international'
option 'uses' 'SIP/providerphone'
option 'international' '0011,+'
option 'localzone' 'localinternational'
option 'localprefix' '0'
option 'addprefix' ''
config 'meetmegeneral'
option 'audiobuffers' '32'
config 'meetme' '101'
option 'pin' ''
option 'adminpin' ''
config 'moh' 'default'
option 'mode' 'files'
option 'directory' '/opt/moh'
option 'random' 'no'

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: coovachilli.lua 3548 2008-10-09 20:28:07Z Cyrus $
]]--
module("luci.controller.coovachilli", package.seeall)
function index()
require("luci.i18n")
local i18n = luci.i18n.translate
local cc = entry( { "admin", "services", "coovachilli" }, cbi("coovachilli"), i18n("coovachilli", "CoovaChilli"), 90)
cc.i18n = "coovachilli"
cc.subindex = true
entry( { "admin", "services", "coovachilli", "network" }, cbi("coovachilli_network"), i18n("coovachilli_network", "Network Configuration"), 10)
entry( { "admin", "services", "coovachilli", "radius" }, cbi("coovachilli_radius"), i18n("coovachilli_radius", "Radius Configuration"), 20)
entry( { "admin", "services", "coovachilli", "auth" }, cbi("coovachilli_auth"), i18n("coovachilli_auth", "UAM and MAC Authentication"), 30)
end

View File

@@ -0,0 +1,177 @@
coovachilli = 'CoovaChilli'
coovachilli_general = 'General configuration'
coovachilli_general_desc = 'General CoovaChilli settings'
coovachilli_general_cmdsock = 'Command socket'
coovachilli_general_cmdsock_desc = 'UNIX socket used for communication with chilli_query'
coovachilli_general_interval = 'Config refresh interval'
coovachilli_general_interval_desc = 'Re-read configuration file and do DNS lookups every interval seconds. This has the same effect as sending the HUP signal. If interval is 0 (zero) this feature is disabled. '
coovachilli_general_pidfile = 'Pid file'
coovachilli_general_pidfile_desc = 'Filename to put the process id'
coovachilli_general_statedir = 'State directory'
coovachilli_general_statedir_desc = 'Directory of non-volatile data'
coovachilli_tun = 'TUN/TAP configuration'
coovachilli_tun_desc = 'Network/Tun configuration'
coovachilli_tun_condown = 'Network down script'
coovachilli_tun_condown_desc = 'Script executed after a session has moved from authorized state to unauthorized'
coovachilli_tun_conup = 'Network up script'
coovachilli_tun_conup_desc = 'Script executed after the tun network interface has been brought up'
coovachilli_tun_dns1 = 'Primary DNS Server'
coovachilli_tun_dns1_desc = 'Is used to inform the client about the DNS address to use for host name resolution'
coovachilli_tun_dns2 = 'Secondary DNS Server'
coovachilli_tun_dns2_desc = 'Is used to inform the client about the DNS address to use for host name resolution'
coovachilli_tun_domain = 'Domain name'
coovachilli_tun_domain_desc = 'Is used to inform the client about the domain name to use for DNS lookups'
coovachilli_tun_dynip = 'Dynamic IP address pool'
coovachilli_tun_dynip_desc = 'Specifies a pool of dynamic IP addresses'
coovachilli_tun_ipdown = 'IP down script'
coovachilli_tun_ipdown_desc = 'Script executed after the tun network interface has been taken down'
coovachilli_tun_ipup = 'IP up script'
coovachilli_tun_ipup_desc = 'Script executed after the TUN/TAP network interface has been brought up'
coovachilli_tun_net = 'Uplink subnet'
coovachilli_tun_net_desc = 'Network address of the uplink interface (CIDR notation)'
coovachilli_tun_statip = 'Static IP address pool'
coovachilli_tun_statip_desc = 'Specifies a pool of static IP addresses'
coovachilli_tun_tundev = 'TUN/TAP device'
coovachilli_tun_tundev_desc = 'The specific device to use for the TUN/TAP interface'
coovachilli_tun_txqlen = 'TX queue length'
coovachilli_tun_txqlen_desc = 'The TX queue length to set on the TUN/TAP interface'
coovachilli_tun_usetap = 'Use TAP device'
coovachilli_tun_usetap_desc = 'Use the TAP interface instead of TUN'
coovachilli_dhcp = 'DHCP configuration'
coovachilli_dhcp_desc = 'Set DHCP options for connecting clients'
coovachilli_dhcp_dhcpend = 'DHCP end number'
coovachilli_dhcp_dhcpend_desc = 'Where to stop assigning IP addresses (default 254)'
coovachilli_dhcp_dhcpif = 'DHCP interface'
coovachilli_dhcp_dhcpif_desc = 'Ethernet interface to listen to for the downlink interface'
coovachilli_dhcp_dhcpmac = 'Listen MAC address'
coovachilli_dhcp_dhcpmac_desc = 'MAC address to listen to. If not specified the MAC address of the interface will be used'
coovachilli_dhcp_dhcpstart = 'DHCP start number'
coovachilli_dhcp_dhcpstart_desc = 'Where to start assigning IP addresses (default 10)'
coovachilli_dhcp_eapolenable = 'Enable IEEE 802.1x'
coovachilli_dhcp_eapolenable_desc = 'Enable IEEE 802.1x authentication and listen for EAP requests'
coovachilli_dhcp_lease = 'Leasetime'
coovachilli_dhcp_lease_desc = 'Use a DHCP lease of seconds (default 600)'
coovachilli_radius = 'RADIUS configuration'
coovachilli_radius_desc = 'RADIUS configuration'
coovachilli_radius_acctupdate = 'Allow session update through RADIUS'
coovachilli_radius_acctupdate_desc = 'Allow updating of session parameters with RADIUS attributes sent in Accounting-Response'
coovachilli_radius_adminpasswd = 'Admin password'
coovachilli_radius_adminpasswd_desc = 'Password to use for Administrative-User authentication in order to pick up chilli configurations and establish a device &quot;system&quot; session'
coovachilli_radius_adminuser = 'Admin user'
coovachilli_radius_adminuser_desc = 'User-name to use for Administrative-User authentication in order to pick up chilli configurations and establish a device &quot;system&quot; session'
coovachilli_radius_coanoipcheck = 'Do not check disconnection requests'
coovachilli_radius_coanoipcheck_desc = 'Do not check the source IP address of radius disconnect requests'
coovachilli_radius_coaport = 'RADIUS disconnect port'
coovachilli_radius_coaport_desc = 'UDP port to listen to for accepting radius disconnect requests'
coovachilli_radius_nasip = 'NAS IP'
coovachilli_radius_nasip_desc = 'Value to use in RADIUS NAS-IP-Address attribute'
coovachilli_radius_nasmac = 'NAS MAC'
coovachilli_radius_nasmac_desc = 'MAC address value to use in RADIUS Called-Station-ID attribute'
coovachilli_radius_openidauth = 'Allow OpenID authentication'
coovachilli_radius_openidauth_desc = 'Allows OpenID authentication by sending ChilliSpot-Config=allow-openidauth in RADIUS Access-Requests'
coovachilli_radius_radiusacctport = 'RADIUS accounting port'
coovachilli_radius_radiusacctport_desc = 'The UDP port number to use for radius accounting requests (default 1813)'
coovachilli_radius_radiusauthport = 'RADIUS authentication port'
coovachilli_radius_radiusauthport_desc = 'The UDP port number to use for radius authentication requests (default 1812)'
coovachilli_radius_radiuscalled = 'Option radiuscalled'
coovachilli_radius_radiuslisten = 'RADIUS listen address'
coovachilli_radius_radiuslisten_desc = 'Local interface IP address to use for the radius interface'
coovachilli_radius_radiuslocationid = 'RADIUS location ID'
coovachilli_radius_radiuslocationid_desc = 'WISPr Location ID'
coovachilli_radius_radiuslocationname = 'RADIUS location name'
coovachilli_radius_radiuslocationname_desc = 'WISPr Location Name'
coovachilli_radius_radiusnasid = 'NAS ID'
coovachilli_radius_radiusnasid_desc = 'Network access server identifier'
coovachilli_radius_radiusnasip = 'Option radiusnasip'
coovachilli_radius_radiusnasporttype = 'NAS port type'
coovachilli_radius_radiusnasporttype_desc = 'Value of NAS-Port-Type attribute. Defaults to 19 (Wireless-IEEE-802.11)'
coovachilli_radius_radiusoriginalurl = 'Send RADIUS VSA'
coovachilli_radius_radiusoriginalurl_desc = 'Send the ChilliSpot-OriginalURL RADIUS VSA in Access-Request'
coovachilli_radius_radiussecret = 'RADIUS secret'
coovachilli_radius_radiussecret_desc = 'Radius shared secret for both servers'
coovachilli_radius_radiusserver1 = 'RADIUS server 1'
coovachilli_radius_radiusserver1_desc = 'The IP address of radius server 1'
coovachilli_radius_radiusserver2 = 'RADIUS server 2'
coovachilli_radius_radiusserver2_desc = 'The IP address of radius server 2'
coovachilli_radius_swapoctets = 'Swap octets'
coovachilli_radius_swapoctets_desc = 'Swap the meaning of &quot;input octets&quot; and &quot;output octets&quot; as it related to RADIUS attribtues'
coovachilli_radius_wpaguests = 'Allow WPA guests'
coovachilli_radius_wpaguests_desc = 'Allows WPA Guest authentication by sending ChilliSpot-Config=allow-wpa-guests in RADIUS Access-Requests'
coovachilli_proxy = 'RADIUS proxy settings'
coovachilli_proxy_desc = 'RADIUS proxy settings'
coovachilli_proxy_proxyclient = 'Proxy client'
coovachilli_proxy_proxyclient_desc = 'IP address from which radius requests are accepted. If omitted the server will not accept radius requests'
coovachilli_proxy_proxylisten = 'Proxy listen address'
coovachilli_proxy_proxylisten_desc = 'Local interface IP address to use for accepting radius requests'
coovachilli_proxy_proxyport = 'Proxy port'
coovachilli_proxy_proxyport_desc = 'UDP Port to listen to for accepting radius requests'
coovachilli_proxy_proxysecret = 'Proxy secret'
coovachilli_proxy_proxysecret_desc = 'Radius shared secret for clients'
coovachilli_uam = 'UAM configuration'
coovachilli_uam_desc = 'Unified Configuration Method settings'
coovachilli_uam_chillixml = 'Use Chilli XML'
coovachilli_uam_chillixml_desc = 'Return the so-called Chilli XML along with WISPr XML'
coovachilli_uam_defidletimeout = 'Default idle timeout'
coovachilli_uam_defidletimeout_desc = 'Default idle timeout unless otherwise set by RADIUS (defaults to 0)'
coovachilli_uam_definteriminterval = 'Default interim interval'
coovachilli_uam_definteriminterval_desc = 'Default interim-interval for RADIUS accounting unless otherwise set by RADIUS (defaults to 0)'
coovachilli_uam_defsessiontimeout = 'Default session timeout'
coovachilli_uam_defsessiontimeout_desc = 'Default session timeout unless otherwise set by RADIUS (defaults to 0)'
coovachilli_uam_dnsparanoia = 'Inspect DNS traffic'
coovachilli_uam_dnsparanoia_desc = 'Inspect DNS packets and drop responses with any non- A, CNAME, SOA, or MX records to prevent dns tunnels (experimental)'
coovachilli_uam_localusers = 'Local users file'
coovachilli_uam_localusers_desc = 'A colon seperated file containing usernames and passwords of locally authenticated users'
coovachilli_uam_locationname = 'Location name'
coovachilli_uam_locationname_desc = 'Human readable location name used in JSON interface'
coovachilli_uam_nouamsuccess = 'Do not redirect to UAM server'
coovachilli_uam_nouamsuccess_desc = 'Do not return to UAM server on login success, just redirect to original URL'
coovachilli_uam_nouamwispr = 'Do not do WISPr'
coovachilli_uam_nouamwispr_desc = 'Do not do any WISPr XML, assume the back-end is doing this instead'
coovachilli_uam_postauthproxy = 'Post auth proxy'
coovachilli_uam_postauthproxy_desc = 'Used with postauthproxyport to define a post authentication HTTP proxy server'
coovachilli_uam_postauthproxyport = 'Post auth proxy port'
coovachilli_uam_postauthproxyport_desc = 'Used with postauthproxy to define a post authentication HTTP proxy server'
coovachilli_uam_uamallowed = 'Allowed resources'
coovachilli_uam_uamallowed_desc = 'List of resources the client can access without first authenticating'
coovachilli_uam_uamanydns = 'Allow any DNS server'
coovachilli_uam_uamanydns_desc = 'Allow any DNS server for unauthenticated clients'
coovachilli_uam_uamanyip = 'Allow any IP address'
coovachilli_uam_uamanyip_desc = 'Allow clients to use any IP settings they wish by spoofing ARP (experimental)'
coovachilli_uam_uamdomain = 'Allowed domains'
coovachilli_uam_uamdomain_desc = 'Defines a list of domain names to automatically add to the walled garden'
coovachilli_uam_uamhomepage = 'UAM homepage'
coovachilli_uam_uamhomepage_desc = 'URL of homepage to redirect unauthenticated users to'
coovachilli_uam_uamiport = 'UAM static content port'
coovachilli_uam_uamiport_desc = 'TCP port to bind to for only serving embedded content'
coovachilli_uam_uamlisten = 'UAM listening address'
coovachilli_uam_uamlisten_desc = 'IP address to listen to for authentication of clients'
coovachilli_uam_uamlogoutip = 'UAM logout IP'
coovachilli_uam_uamlogoutip_desc = 'Use this IP address to instantly logout a client accessing it (defaults to 1.1.1.1)'
coovachilli_uam_uamport = 'UAM listening port'
coovachilli_uam_uamport_desc = 'TCP port to bind to for authenticating clients (default 3990)'
coovachilli_uam_uamsecret = 'UAM secret'
coovachilli_uam_uamsecret_desc = 'Shared secret between uamserver and chilli'
coovachilli_uam_uamserver = 'UAM server'
coovachilli_uam_uamserver_desc = 'URL of web server to use for authenticating clients'
coovachilli_uam_uamui = 'UAM user interface'
coovachilli_uam_uamui_desc = 'An init.d style program to handle local content on the uamuiport web server'
coovachilli_uam_usestatusfile = 'Use status file'
coovachilli_uam_usestatusfile_desc = 'Write the status of clients in a non-volatile state file (experimental)'
coovachilli_uam_wisprlogin = 'WISPr login url'
coovachilli_uam_wisprlogin_desc = 'Specific URL to be given in WISPr XML LoginURL'
coovachilli_uam_wwwbin = 'CGI program'
coovachilli_uam_wwwbin_desc = 'Executable to run as a CGI type program (like haserl) for URLs with extention .chi'
coovachilli_uam_wwwdir = 'Web content directory'
coovachilli_uam_wwwdir_desc = 'Directory where embedded local web content is placed'
coovachilli_macauth = 'MAC configuration'
coovachilli_macauth_desc = 'Configure MAC authentication'
coovachilli_macauth_macallowed = 'Allowed MAC addresses'
coovachilli_macauth_macallowed_desc = 'List of MAC addresses for which MAC authentication will be performed'
coovachilli_macauth_macallowlocal = 'Authenticate locally allowed MACs'
coovachilli_macauth_macallowlocal_desc = 'Authenticate allowed MAC addresses without the use of RADIUS'
coovachilli_macauth_macauth = 'Enable MAC authentification'
coovachilli_macauth_macauth_desc = 'Try to authenticate all users based on their mac address alone'
coovachilli_macauth_macpasswd = 'Password'
coovachilli_macauth_macpasswd_desc = 'Password used when performing MAC authentication'
coovachilli_macauth_macsuffix = 'Suffix'
coovachilli_macauth_macsuffix_desc = 'Suffix to add to the MAC address in order to form the User-Name, which is sent to the radius server'

View File

@@ -0,0 +1,190 @@
<?xml version="1.0" encoding="utf-8"?>
<i18n:msgs xmlns:i18n="http://luci.freifunk-halle.net/2008/i18n#" xmlns="http://www.w3.org/1999/xhtml">
<i18n:msg xml:id="coovachilli">CoovaChilli</i18n:msg>
<i18n:msg xml:id="coovachilli_general">General configuration</i18n:msg>
<i18n:msg xml:id="coovachilli_general_desc">General CoovaChilli settings</i18n:msg>
<i18n:msg xml:id="coovachilli_general_cmdsock">Command socket</i18n:msg>
<i18n:msg xml:id="coovachilli_general_cmdsock_desc">UNIX socket used for communication with chilli_query</i18n:msg>
<i18n:msg xml:id="coovachilli_general_interval">Config refresh interval</i18n:msg>
<i18n:msg xml:id="coovachilli_general_interval_desc">Re-read configuration file and do DNS lookups every interval seconds. This has the same effect as sending the HUP signal. If interval is 0 (zero) this feature is disabled. </i18n:msg>
<i18n:msg xml:id="coovachilli_general_pidfile">Pid file</i18n:msg>
<i18n:msg xml:id="coovachilli_general_pidfile_desc">Filename to put the process id</i18n:msg>
<i18n:msg xml:id="coovachilli_general_statedir">State directory</i18n:msg>
<i18n:msg xml:id="coovachilli_general_statedir_desc">Directory of non-volatile data</i18n:msg>
<i18n:msg xml:id="coovachilli_tun">TUN/TAP configuration</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_desc">Network/Tun configuration</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_condown">Network down script</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_condown_desc">Script executed after a session has moved from authorized state to unauthorized</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_conup">Network up script</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_conup_desc">Script executed after the tun network interface has been brought up</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_dns1">Primary DNS Server</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_dns1_desc">Is used to inform the client about the DNS address to use for host name resolution</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_dns2">Secondary DNS Server</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_dns2_desc">Is used to inform the client about the DNS address to use for host name resolution</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_domain">Domain name</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_domain_desc">Is used to inform the client about the domain name to use for DNS lookups</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_dynip">Dynamic IP address pool</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_dynip_desc">Specifies a pool of dynamic IP addresses</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_ipdown">IP down script</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_ipdown_desc">Script executed after the tun network interface has been taken down</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_ipup">IP up script</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_ipup_desc">Script executed after the TUN/TAP network interface has been brought up</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_net">Uplink subnet</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_net_desc">Network address of the uplink interface (CIDR notation)</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_statip">Static IP address pool</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_statip_desc">Specifies a pool of static IP addresses</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_tundev">TUN/TAP device</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_tundev_desc">The specific device to use for the TUN/TAP interface</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_txqlen">TX queue length</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_txqlen_desc">The TX queue length to set on the TUN/TAP interface</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_usetap">Use TAP device</i18n:msg>
<i18n:msg xml:id="coovachilli_tun_usetap_desc">Use the TAP interface instead of TUN</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp">DHCP configuration</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_desc">Set DHCP options for connecting clients</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_dhcpend">DHCP end number</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_dhcpend_desc">Where to stop assigning IP addresses (default 254)</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_dhcpif">DHCP interface</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_dhcpif_desc">Ethernet interface to listen to for the downlink interface</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_dhcpmac">Listen MAC address</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_dhcpmac_desc">MAC address to listen to. If not specified the MAC address of the interface will be used</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_dhcpstart">DHCP start number</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_dhcpstart_desc">Where to start assigning IP addresses (default 10)</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_eapolenable">Enable IEEE 802.1x</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_eapolenable_desc">Enable IEEE 802.1x authentication and listen for EAP requests</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_lease">Leasetime</i18n:msg>
<i18n:msg xml:id="coovachilli_dhcp_lease_desc">Use a DHCP lease of seconds (default 600)</i18n:msg>
<i18n:msg xml:id="coovachilli_radius">RADIUS configuration</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_desc">RADIUS configuration</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_acctupdate">Allow session update through RADIUS</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_acctupdate_desc">Allow updating of session parameters with RADIUS attributes sent in Accounting-Response</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_adminpasswd">Admin password</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_adminpasswd_desc">Password to use for Administrative-User authentication in order to pick up chilli configurations and establish a device "system" session</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_adminuser">Admin user</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_adminuser_desc">User-name to use for Administrative-User authentication in order to pick up chilli configurations and establish a device "system" session</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_coanoipcheck">Do not check disconnection requests</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_coanoipcheck_desc">Do not check the source IP address of radius disconnect requests</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_coaport">RADIUS disconnect port</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_coaport_desc">UDP port to listen to for accepting radius disconnect requests</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_nasip">NAS IP</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_nasip_desc">Value to use in RADIUS NAS-IP-Address attribute</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_nasmac">NAS MAC</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_nasmac_desc">MAC address value to use in RADIUS Called-Station-ID attribute</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_openidauth">Allow OpenID authentication</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_openidauth_desc">Allows OpenID authentication by sending ChilliSpot-Config=allow-openidauth in RADIUS Access-Requests</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusacctport">RADIUS accounting port</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusacctport_desc">The UDP port number to use for radius accounting requests (default 1813)</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusauthport">RADIUS authentication port</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusauthport_desc">The UDP port number to use for radius authentication requests (default 1812)</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiuscalled">Option radiuscalled</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiuslisten">RADIUS listen address</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiuslisten_desc">Local interface IP address to use for the radius interface</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiuslocationid">RADIUS location ID</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiuslocationid_desc">WISPr Location ID</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiuslocationname">RADIUS location name</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiuslocationname_desc">WISPr Location Name</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusnasid">NAS ID</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusnasid_desc">Network access server identifier</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusnasip">Option radiusnasip</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusnasporttype">NAS port type</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusnasporttype_desc">Value of NAS-Port-Type attribute. Defaults to 19 (Wireless-IEEE-802.11)</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusoriginalurl">Send RADIUS VSA</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusoriginalurl_desc">Send the ChilliSpot-OriginalURL RADIUS VSA in Access-Request</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiussecret">RADIUS secret</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiussecret_desc">Radius shared secret for both servers</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusserver1">RADIUS server 1</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusserver1_desc">The IP address of radius server 1</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusserver2">RADIUS server 2</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_radiusserver2_desc">The IP address of radius server 2</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_swapoctets">Swap octets</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_swapoctets_desc">Swap the meaning of "input octets" and "output octets" as it related to RADIUS attribtues</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_wpaguests">Allow WPA guests</i18n:msg>
<i18n:msg xml:id="coovachilli_radius_wpaguests_desc">Allows WPA Guest authentication by sending ChilliSpot-Config=allow-wpa-guests in RADIUS Access-Requests</i18n:msg>
<i18n:msg xml:id="coovachilli_proxy">RADIUS proxy settings</i18n:msg>
<i18n:msg xml:id="coovachilli_proxy_desc">RADIUS proxy settings</i18n:msg>
<i18n:msg xml:id="coovachilli_proxy_proxyclient">Proxy client</i18n:msg>
<i18n:msg xml:id="coovachilli_proxy_proxyclient_desc">IP address from which radius requests are accepted. If omitted the server will not accept radius requests</i18n:msg>
<i18n:msg xml:id="coovachilli_proxy_proxylisten">Proxy listen address</i18n:msg>
<i18n:msg xml:id="coovachilli_proxy_proxylisten_desc">Local interface IP address to use for accepting radius requests</i18n:msg>
<i18n:msg xml:id="coovachilli_proxy_proxyport">Proxy port</i18n:msg>
<i18n:msg xml:id="coovachilli_proxy_proxyport_desc">UDP Port to listen to for accepting radius requests</i18n:msg>
<i18n:msg xml:id="coovachilli_proxy_proxysecret">Proxy secret</i18n:msg>
<i18n:msg xml:id="coovachilli_proxy_proxysecret_desc">Radius shared secret for clients</i18n:msg>
<i18n:msg xml:id="coovachilli_uam">UAM configuration</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_desc">Unified Configuration Method settings</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_chillixml">Use Chilli XML</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_chillixml_desc">Return the so-called Chilli XML along with WISPr XML</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_defidletimeout">Default idle timeout</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_defidletimeout_desc">Default idle timeout unless otherwise set by RADIUS (defaults to 0)</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_definteriminterval">Default interim interval</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_definteriminterval_desc">Default interim-interval for RADIUS accounting unless otherwise set by RADIUS (defaults to 0)</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_defsessiontimeout">Default session timeout</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_defsessiontimeout_desc">Default session timeout unless otherwise set by RADIUS (defaults to 0)</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_dnsparanoia">Inspect DNS traffic</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_dnsparanoia_desc">Inspect DNS packets and drop responses with any non- A, CNAME, SOA, or MX records to prevent dns tunnels (experimental)</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_localusers">Local users file</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_localusers_desc">A colon seperated file containing usernames and passwords of locally authenticated users</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_locationname">Location name</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_locationname_desc">Human readable location name used in JSON interface</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_nouamsuccess">Do not redirect to UAM server</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_nouamsuccess_desc">Do not return to UAM server on login success, just redirect to original URL</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_nouamwispr">Do not do WISPr</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_nouamwispr_desc">Do not do any WISPr XML, assume the back-end is doing this instead</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_postauthproxy">Post auth proxy</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_postauthproxy_desc">Used with postauthproxyport to define a post authentication HTTP proxy server</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_postauthproxyport">Post auth proxy port</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_postauthproxyport_desc">Used with postauthproxy to define a post authentication HTTP proxy server</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamallowed">Allowed resources</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamallowed_desc">List of resources the client can access without first authenticating</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamanydns">Allow any DNS server</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamanydns_desc">Allow any DNS server for unauthenticated clients</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamanyip">Allow any IP address</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamanyip_desc">Allow clients to use any IP settings they wish by spoofing ARP (experimental)</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamdomain">Allowed domains</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamdomain_desc">Defines a list of domain names to automatically add to the walled garden</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamhomepage">UAM homepage</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamhomepage_desc">URL of homepage to redirect unauthenticated users to</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamiport">UAM static content port</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamiport_desc">TCP port to bind to for only serving embedded content</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamlisten">UAM listening address</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamlisten_desc">IP address to listen to for authentication of clients</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamlogoutip">UAM logout IP</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamlogoutip_desc">Use this IP address to instantly logout a client accessing it (defaults to 1.1.1.1)</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamport">UAM listening port</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamport_desc">TCP port to bind to for authenticating clients (default 3990)</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamsecret">UAM secret</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamsecret_desc">Shared secret between uamserver and chilli</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamserver">UAM server</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamserver_desc">URL of web server to use for authenticating clients</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamui">UAM user interface</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_uamui_desc">An init.d style program to handle local content on the uamuiport web server</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_usestatusfile">Use status file</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_usestatusfile_desc">Write the status of clients in a non-volatile state file (experimental)</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_wisprlogin">WISPr login url</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_wisprlogin_desc">Specific URL to be given in WISPr XML LoginURL</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_wwwbin">CGI program</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_wwwbin_desc">Executable to run as a CGI type program (like haserl) for URLs with extention .chi</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_wwwdir">Web content directory</i18n:msg>
<i18n:msg xml:id="coovachilli_uam_wwwdir_desc">Directory where embedded local web content is placed</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth">MAC configuration</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_desc">Configure MAC authentication</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_macallowed">Allowed MAC addresses</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_macallowed_desc">List of MAC addresses for which MAC authentication will be performed</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_macallowlocal">Authenticate locally allowed MACs</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_macallowlocal_desc">Authenticate allowed MAC addresses without the use of RADIUS</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_macauth">Enable MAC authentification</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_macauth_desc">Try to authenticate all users based on their mac address alone</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_macpasswd">Password</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_macpasswd_desc">Password used when performing MAC authentication</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_macsuffix">Suffix</i18n:msg>
<i18n:msg xml:id="coovachilli_macauth_macsuffix_desc">Suffix to add to the MAC address in order to form the User-Name, which is sent to the radius server</i18n:msg>
</i18n:msgs>

View File

@@ -0,0 +1,31 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: coovachilli.lua 3442 2008-09-25 10:12:21Z jow $
]]--
m = Map("coovachilli")
-- general
s = m:section(TypedSection, "general")
s.anonymous = true
s:option( Flag, "debug" )
s:option( Value, "interval" )
s:option( Value, "pidfile" ).optional = true
s:option( Value, "statedir" ).optional = true
s:option( Value, "cmdsock" ).optional = true
s:option( Value, "logfacility" ).optional = true
return m

View File

@@ -0,0 +1,76 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: coovachilli_auth.lua 3445 2008-09-25 12:11:56Z jow $
]]--
m = Map("coovachilli")
-- uam config
s1 = m:section(TypedSection, "uam")
s1.anonymous = true
s1:option( Value, "uamserver" )
s1:option( Value, "uamsecret" ).password = true
s1:option( Flag, "uamanydns" )
s1:option( Flag, "nouamsuccess" )
s1:option( Flag, "nouamwispr" )
s1:option( Flag, "chillixml" )
s1:option( Flag, "uamanyip" ).optional = true
s1:option( Flag, "dnsparanoia" ).optional = true
s1:option( Flag, "usestatusfile" ).optional = true
s1:option( Value, "uamhomepage" ).optional = true
s1:option( Value, "uamlisten" ).optional = true
s1:option( Value, "uamport" ).optional = true
s1:option( Value, "uamiport" ).optional = true
s1:option( DynamicList, "uamdomain" ).optional = true
s1:option( Value, "uamlogoutip" ).optional = true
s1:option( DynamicList, "uamallowed" ).optional = true
s1:option( Value, "uamui" ).optional = true
s1:option( Value, "wisprlogin" ).optional = true
s1:option( Value, "defsessiontimeout" ).optional = true
s1:option( Value, "defidletimeout" ).optional = true
s1:option( Value, "definteriminterval" ).optional = true
s1:option( Value, "ssid" ).optional = true
s1:option( Value, "vlan" ).optional = true
s1:option( Value, "nasip" ).optional = true
s1:option( Value, "nasmac" ).optional = true
s1:option( Value, "wwwdir" ).optional = true
s1:option( Value, "wwwbin" ).optional = true
s1:option( Value, "localusers" ).optional = true
s1:option( Value, "postauthproxy" ).optional = true
s1:option( Value, "postauthproxyport" ).optional = true
s1:option( Value, "locationname" ).optional = true
-- mac authentication
s2 = m:section(TypedSection, "macauth")
s2.anonymous = true
s2:option( Flag, "macauth" )
s2:option( Flag, "macallowlocal" )
s2:option( DynamicList, "macallowed" )
pw = s2:option( Value, "macpasswd" )
pw.optional = true
pw.password = true
s2:option( Value, "macsuffix" ).optional = true
return m

View File

@@ -0,0 +1,67 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: coovachilli_network.lua 3438M 2008-11-29 19:56:35Z (local) $
]]--
require("luci.sys")
require("luci.ip")
m = Map("coovachilli")
-- tun
s1 = m:section(TypedSection, "tun")
s1.anonymous = true
s1:option( Flag, "usetap" )
s1:option( Value, "tundev" ).optional = true
s1:option( Value, "txqlen" ).optional = true
net = s1:option( Value, "net" )
for _, route in ipairs(luci.sys.net.routes()) do
if route.device ~= "lo" and route.dest:prefix() < 32 then
net:value( route.dest:string() )
end
end
s1:option( Value, "dynip" ).optional = true
s1:option( Value, "statip" ).optional = true
s1:option( Value, "dns1" ).optional = true
s1:option( Value, "dns2" ).optional = true
s1:option( Value, "domain" ).optional = true
s1:option( Value, "ipup" ).optional = true
s1:option( Value, "ipdown" ).optional = true
s1:option( Value, "conup" ).optional = true
s1:option( Value, "condown" ).optional = true
-- dhcp config
s2 = m:section(TypedSection, "dhcp")
s2.anonymous = true
dif = s2:option( Value, "dhcpif" )
for _, nif in ipairs(luci.sys.net.devices()) do
if nif ~= "lo" then dif:value(nif) end
end
s2:option( Value, "dhcpmac" ).optional = true
s2:option( Value, "lease" ).optional = true
s2:option( Value, "dhcpstart" ).optional = true
s2:option( Value, "dhcpend" ).optional = true
s2:option( Flag, "eapolenable" )
return m

View File

@@ -0,0 +1,67 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: coovachilli_radius.lua 3438 2008-09-25 00:42:55Z jow $
]]--
m = Map("coovachilli")
-- radius server
s1 = m:section(TypedSection, "radius")
s1.anonymous = true
s1:option( Value, "radiusserver1" )
s1:option( Value, "radiusserver2" )
s1:option( Value, "radiussecret" ).password = true
s1:option( Value, "radiuslisten" ).optional = true
s1:option( Value, "radiusauthport" ).optional = true
s1:option( Value, "radiusacctport" ).optional = true
s1:option( Value, "radiusnasid" ).optional = true
s1:option( Value, "radiusnasip" ).optional = true
s1:option( Value, "radiuscalled" ).optional = true
s1:option( Value, "radiuslocationid" ).optional = true
s1:option( Value, "radiuslocationname" ).optional = true
s1:option( Value, "radiusnasporttype" ).optional = true
s1:option( Flag, "radiusoriginalurl" )
s1:option( Value, "adminuser" ).optional = true
rs = s1:option( Value, "adminpassword" )
rs.optional = true
rs.password = true
s1:option( Flag, "swapoctets" )
s1:option( Flag, "openidauth" )
s1:option( Flag, "wpaguests" )
s1:option( Flag, "acctupdate" )
s1:option( Value, "coaport" ).optional = true
s1:option( Flag, "coanoipcheck" )
-- radius proxy
s2 = m:section(TypedSection, "proxy")
s2.anonymous = true
s2:option( Value, "proxylisten" ).optional = true
s2:option( Value, "proxyport" ).optional = true
s2:option( Value, "proxyclient" ).optional = true
ps = s2:option( Value, "proxysecret" )
ps.optional = true
ps.password = true
return m

View File

@@ -0,0 +1,243 @@
##############################################################################
#
# Sample CoovaChilli configuration file
#
##############################################################################
# General settings
config general
# Enable this flag to include debug information.
option debug 0
# Re-read configuration file at this interval. Will also cause new domain
# name lookups to be performed. Value is given in seconds.
option interval 3600
# File to store information about the process id of the program.
# The program must have write access to this file/directory.
option pidfile /var/run/chilli.pid
# Directory to use for nonvolatile storage.
# The program must have write access to this directory.
# This tag is currently ignored
#option statedir ./
# TUN parameters
config tun
# IP network address of external packet data network
# Used to allocate dynamic IP addresses and set up routing.
# Normally you do not need to uncomment this tag.
option net 192.168.182.0/24
# Dynamic IP address pool
# Used to allocate dynamic IP addresses to clients.
# If not set it defaults to the net tag.
# Do not uncomment this tag unless you are an experienced user!
#option dynip 192.168.182.0/24
# Static IP address pool
# Used to allocate static IP addresses to clients.
# Do not uncomment this tag unless you are an experienced user!
#option statip 192.168.182.0/24
# Primary DNS server.
# Will be suggested to the client.
# If omitted the system default will be used.
# Normally you do not need to uncomment this tag.
#option dns1 172.16.0.5
# Secondary DNS server.
# Will be suggested to the client.
# If omitted the system default will be used.
# Normally you do not need to uncomment this tag.
#option dns2 172.16.0.6
# Domain name
# Will be suggested to the client.
# Normally you do not need to uncomment this tag.
option domain key.chillispot.org
# Script executed after network interface has been brought up.
# Executed with the following parameters: <devicename> <ip address> <mask>
# Normally you do not need to uncomment this tag.
#option ipup /etc/chilli.ipup
# Script executed after network interface has been taken down.
# Executed with the following parameters: <devicename> <ip address> <mask>
# Normally you do not need to uncomment this tag.
#option ipdown /etc/chilli.ipdown
# Script executed after a user has been authenticated.
# Executed with the following parameters: <devicename> <ip address>
# <mask> <user ip address> <user mac address> <filter ID>
# Normally you do not need to uncomment this tag.
#option conup /etc/chilli.conup
# Script executed after a user has disconnected.
# Executed with the following parameters: <devicename> <ip address>
# <mask> <user ip address> <user mac address> <filter ID>
# Normally you do not need to uncomment this tag.
#option condown /etc/chilli.condown
# DHCP Parameters
config dhcp
# Ethernet interface to listen to.
# This is the network interface which is connected to the access points.
# In a typical configuration this tag should be set to eth1.
option dhcpif eth1
# Use specified MAC address.
# An address in the range 00:00:5E:00:02:00 - 00:00:5E:FF:FF:FF falls
# within the IANA range of addresses and is not allocated for other
# purposes.
# Normally you do not need to uncomment this tag.
#option dhcpmac 00:00:5E:00:02:00
# Time before DHCP lease expires
# Normally you do not need to uncomment this tag.
#option lease 600
# Radius parameters
config radius
# IP address to listen to
# Normally you do not need to uncomment this tag.
#option radiuslisten 127.0.0.1
# IP address of radius server 1
# For most installations you need to modify this tag.
option radiusserver1 rad01.chillispot.org
# IP address of radius server 2
# If you have only one radius server you should set radiusserver2 to the
# same value as radiusserver1.
# For most installations you need to modify this tag.
option radiusserver2 rad02.chillispot.org
# Radius authentication port
# The UDP port number to use for radius authentication requests.
# The same port number is used for both radiusserver1 and radiusserver2.
# Normally you do not need to uncomment this tag.
#option radiusauthport 1812
# Radius accounting port
# The UDP port number to use for radius accounting requests.
# The same port number is used for both radiusserver1 and radiusserver2.
# Normally you do not need to uncomment this tag.
#option radiusacctport 1813
# Radius shared secret for both servers
# For all installations you should modify this tag.
#option radiussecret testing123
# Radius NAS-Identifier
# Normally you do not need to uncomment this tag.
#option radiusnasid nas01
# Radius NAS-IP-Address
# Normally you do not need to uncomment this tag.
#option radiusnasip 127.0.0.1
# Radius Called-Station-ID
# Normally you do not need to uncomment this tag.
#option radiuscalled 00133300
# WISPr Location ID. Should be in the format: isocc=<ISO_Country_Code>,
# cc=<E.164_Country_Code>,ac=<E.164_Area_Code>,network=<ssid/ZONE>
# Normally you do not need to uncomment this tag.
#option radiuslocationid isocc=us,cc=1,ac=408,network=ACMEWISP_NewarkAirport
# WISPr Location Name. Should be in the format:
# <HOTSPOT_OPERATOR_NAME>,<LOCATION>
# Normally you do not need to uncomment this tag.
#option radiuslocationname ACMEWISP,Gate_14_Terminal_C_of_Newark_Airport
# Radius proxy parameters
config proxy
# IP address to listen to
# Normally you do not need to uncomment this tag.
#option proxylisten 10.0.0.1
# UDP port to listen to.
# If not specified a port will be selected by the system
# Normally you do not need to uncomment this tag.
#option proxyport 1645
# Client(s) from which we accept radius requests
# Normally you do not need to uncomment this tag.
#option proxyclient 10.0.0.1/24
# Radius proxy shared secret for all clients
# If not specified defaults to radiussecret
# Normally you do not need to uncomment this tag.
#option proxysecret testing123
# Universal access method (UAM) parameters
config uam
# URL of web server handling authentication.
option uamserver https://radius.chillispot.org/hotspotlogin
# URL of welcome homepage.
# Unauthenticated users will be redirected to this URL. If not specified
# users will be redirected to the uamserver instead.
# Normally you do not need to uncomment this tag.
#option uamhomepage http://192.168.182.1/welcome.html
# Shared between chilli and authentication web server
#option uamsecret ht2eb8ej6s4et3rg1ulp
# IP address to listen to for authentication requests
# Do not uncomment this tag unless you are an experienced user!
#option uamlisten 192.168.182.1
# TCP port to listen to for authentication requests
# Do not uncomment this tag unless you are an experienced user!
#option uamport 3990
# Comma separated list of domain names, IP addresses or network segments
# the client can access without first authenticating.
# It is possible to specify this tag multiple times.
# Normally you do not need to uncomment this tag.
#list uamallowed www.chillispot.org
#list uamallowed 10.11.12.0/24
# If this flag is given unauthenticated users are allowed to use
# any DNS server.
# Normally you do not need to uncomment this tag.
#uamanydns
# MAC authentication
config macauth
# If this flag is given users will be authenticated only on their MAC
# address.
# Normally you do not need to enable this flag.
option macauth 0
# List of MAC addresses.
# The MAC addresses specified in this list will be authenticated only on
# their MAC address.
# This tag is ignored if the macauth tag is given.
# It is possible to specify this tag multiple times.
# Normally you do not need to uncomment this tag.
#list macallowed 00-0A-5E-AC-BE-51
#list macallowed 00-30-1B-3C-32-E9
# Password to use for MAC authentication.
# Normally you do not need to uncomment this tag.
#option macpasswd password
# Suffix to add to MAC address in order to form the username.
# Normally you do not need to uncomment this tag.
#option macsuffix suffix

View File

@@ -0,0 +1,642 @@
package coovachilli
config section
option name 'general'
option title 'General configuration'
option description 'General CoovaChilli settings'
option package 'coovachilli'
option unique true
option required true
config variable
option name 'interval'
option title 'Config refresh interval'
option description 'Re-read configuration file and do DNS lookups every interval seconds. This has the same effect as sending the HUP signal. If interval is 0 (zero) this feature is disabled. '
option section 'coovachilli.general'
option datatype 'uint'
config variable
option name 'pidfile'
option title 'Pid file'
option description 'Filename to put the process id'
option section 'coovachilli.general'
option datatype 'string'
config variable
option name 'statedir'
option title 'State directory'
option description 'Directory of non-volatile data'
option section 'coovachilli.general'
option datatype 'directory'
config variable
option name 'cmdsock'
option title 'Command socket'
option description 'UNIX socket used for communication with chilli_query'
option section 'coovachilli.general'
option datatype 'string'
config section
option name 'tun'
option title 'TUN/TAP configuration'
option description 'Network/Tun configuration'
option package 'coovachilli'
option unique true
option required true
config variable
option name 'txqlen'
option title 'TX queue length'
option description 'The TX queue length to set on the TUN/TAP interface'
option section 'coovachilli.tun'
option datatype 'uint'
config variable
option name 'usetap'
option title 'Use TAP device'
option description 'Use the TAP interface instead of TUN'
option section 'coovachilli.tun'
option datatype 'boolean'
config variable
option name 'tundev'
option title 'TUN/TAP device'
option description 'The specific device to use for the TUN/TAP interface'
option section 'coovachilli.tun'
option datatype 'file'
config variable
option name 'net'
option title 'Uplink subnet'
option description 'Network address of the uplink interface (CIDR notation)'
option section 'coovachilli.tun'
option datatype 'ip4addr'
config variable
option name 'statip'
option title 'Static IP address pool'
option description 'Specifies a pool of static IP addresses'
option section 'coovachilli.tun'
option datatype 'ip4addr'
config variable
option name 'dynip'
option title 'Dynamic IP address pool'
option description 'Specifies a pool of dynamic IP addresses'
option section 'coovachilli.tun'
option datatype 'ip4addr'
config variable
option name 'dns1'
option title 'Primary DNS Server'
option description 'Is used to inform the client about the DNS address to use for host name resolution'
option section 'coovachilli.tun'
option datatype 'host'
config variable
option name 'dns2'
option title 'Secondary DNS Server'
option description 'Is used to inform the client about the DNS address to use for host name resolution'
option section 'coovachilli.tun'
option datatype 'host'
config variable
option name 'domain'
option title 'Domain name'
option description 'Is used to inform the client about the domain name to use for DNS lookups'
option section 'coovachilli.tun'
option datatype 'string'
config variable
option name 'ipdown'
option title 'IP down script'
option description 'Script executed after the tun network interface has been taken down'
option section 'coovachilli.tun'
option datatype 'file'
config variable
option name 'ipup'
option title 'IP up script'
option description 'Script executed after the TUN/TAP network interface has been brought up'
option section 'coovachilli.tun'
option datatype 'file'
config variable
option name 'condown'
option title 'Network down script'
option description 'Script executed after a session has moved from authorized state to unauthorized'
option section 'coovachilli.tun'
option datatype 'file'
config variable
option name 'conup'
option title 'Network up script'
option description 'Script executed after the tun network interface has been brought up'
option section 'coovachilli.tun'
option datatype 'file'
config section
option name 'dhcp'
option title 'DHCP configuration'
option description 'Set DHCP options for connecting clients'
option package 'coovachilli'
option unique true
option required true
config variable
option name 'dhcpif'
option title 'DHCP interface'
option description 'Ethernet interface to listen to for the downlink interface'
option section 'coovachilli.dhcp'
option datatype 'string'
option required true
config variable
option name 'dhcpmac'
option title 'Listen MAC address'
option description 'MAC address to listen to. If not specified the MAC address of the interface will be used'
option section 'coovachilli.dhcp'
option datatype 'macaddr'
config variable
option name 'lease'
option title 'Leasetime'
option description 'Use a DHCP lease of seconds (default 600)'
option section 'coovachilli.dhcp'
option datatype 'uint'
config variable
option name 'dhcpstart'
option title 'DHCP start number'
option description 'Where to start assigning IP addresses (default 10)'
option section 'coovachilli.dhcp'
option datatype 'uint'
config variable
option name 'dhcpend'
option title 'DHCP end number'
option description 'Where to stop assigning IP addresses (default 254)'
option section 'coovachilli.dhcp'
option datatype 'uint'
config variable
option name 'eapolenable'
option title 'Enable IEEE 802.1x'
option description 'Enable IEEE 802.1x authentication and listen for EAP requests'
option section 'coovachilli.dhcp'
option datatype 'boolean'
config section
option name 'macauth'
option title 'MAC configuration'
option description 'Configure MAC authentication'
option package 'coovachilli'
option unique true
option required true
config variable
option name 'macauth'
option title 'Enable MAC authentification'
option description 'Try to authenticate all users based on their mac address alone'
option section 'coovachilli.macauth'
option datatype 'boolean'
config variable
option name 'macallowlocal'
option title 'Authenticate locally allowed MACs'
option description 'Authenticate allowed MAC addresses without the use of RADIUS'
option section 'coovachilli.macauth'
option datatype 'boolean'
config variable
option name 'macallowed'
option title 'Allowed MAC addresses'
option description 'List of MAC addresses for which MAC authentication will be performed'
option section 'coovachilli.macauth'
option datatype 'string'
option type 'lazylist'
config variable
option name 'macpasswd'
option title 'Password'
option description 'Password used when performing MAC authentication'
option section 'coovachilli.macauth'
option datatype 'string'
config variable
option name 'macsuffix'
option title 'Suffix'
option description 'Suffix to add to the MAC address in order to form the User-Name, which is sent to the radius server'
option section 'coovachilli.macauth'
option datatype 'string'
config section
option name 'radius'
option title 'RADIUS configuration'
option description 'RADIUS configuration'
option package 'coovachilli'
option unique true
option required true
config variable
option name 'acctupdate'
option title 'Allow session update through RADIUS'
option description 'Allow updating of session parameters with RADIUS attributes sent in Accounting-Response'
option section 'coovachilli.radius'
option datatype 'boolean'
config variable
option name 'radiusoriginalurl'
option title 'Send RADIUS VSA'
option description 'Send the ChilliSpot-OriginalURL RADIUS VSA in Access-Request'
option section 'coovachilli.radius'
option datatype 'boolean'
config variable
option name 'swapoctets'
option title 'Swap octets'
option description 'Swap the meaning of "input octets" and "output octets" as it related to RADIUS attribtues'
option section 'coovachilli.radius'
option datatype 'boolean'
config variable
option name 'openidauth'
option title 'Allow OpenID authentication'
option description 'Allows OpenID authentication by sending ChilliSpot-Config=allow-openidauth in RADIUS Access-Requests'
option section 'coovachilli.radius'
option datatype 'boolean'
config variable
option name 'wpaguests'
option title 'Allow WPA guests'
option description 'Allows WPA Guest authentication by sending ChilliSpot-Config=allow-wpa-guests in RADIUS Access-Requests'
option section 'coovachilli.radius'
option datatype 'boolean'
config variable
option name 'radiusacctport'
option title 'RADIUS accounting port'
option description 'The UDP port number to use for radius accounting requests (default 1813)'
option section 'coovachilli.radius'
option datatype 'port'
config variable
option name 'radiusauthport'
option title 'RADIUS authentication port'
option description 'The UDP port number to use for radius authentication requests (default 1812)'
option section 'coovachilli.radius'
option datatype 'port'
config variable
option name 'radiuscalled'
option title 'Option radiuscalled'
option description ''
option section 'coovachilli.radius'
option datatype 'string'
config variable
option name 'radiuslisten'
option title 'RADIUS listen address'
option description 'Local interface IP address to use for the radius interface'
option section 'coovachilli.radius'
option datatype 'ip4addr'
config variable
option name 'radiuslocationid'
option title 'RADIUS location ID'
option description 'WISPr Location ID'
option section 'coovachilli.radius'
option datatype 'string'
config variable
option name 'radiuslocationname'
option title 'RADIUS location name'
option description 'WISPr Location Name'
option section 'coovachilli.radius'
option datatype 'string'
config variable
option name 'radiusnasid'
option title 'NAS ID'
option description 'Network access server identifier'
option section 'coovachilli.radius'
option datatype 'string'
config variable
option name 'radiusnasip'
option title 'Option radiusnasip'
option description ''
option section 'coovachilli.radius'
option datatype 'ip4addr'
config variable
option name 'radiusnasporttype'
option title 'NAS port type'
option description 'Value of NAS-Port-Type attribute. Defaults to 19 (Wireless-IEEE-802.11)'
option section 'coovachilli.radius'
option datatype 'port'
config variable
option name 'radiussecret'
option title 'RADIUS secret'
option description 'Radius shared secret for both servers'
option section 'coovachilli.radius'
option datatype 'string'
config variable
option name 'radiusserver1'
option title 'RADIUS server 1'
option description 'The IP address of radius server 1'
option section 'coovachilli.radius'
option datatype 'host'
config variable
option name 'radiusserver2'
option title 'RADIUS server 2'
option description 'The IP address of radius server 2'
option section 'coovachilli.radius'
option datatype 'host'
config variable
option name 'nasip'
option title 'NAS IP'
option description 'Value to use in RADIUS NAS-IP-Address attribute'
option section 'coovachilli.radius'
option datatype 'ip4addr'
config variable
option name 'nasmac'
option title 'NAS MAC'
option description 'MAC address value to use in RADIUS Called-Station-ID attribute'
option section 'coovachilli.radius'
option datatype 'macaddr'
config variable
option name 'adminuser'
option title 'Admin user'
option description 'User-name to use for Administrative-User authentication in order to pick up chilli configurations and establish a device "system" session'
option section 'coovachilli.radius'
option datatype 'string'
config variable
option name 'adminpasswd'
option title 'Admin password'
option description 'Password to use for Administrative-User authentication in order to pick up chilli configurations and establish a device "system" session'
option section 'coovachilli.radius'
option datatype 'string'
config variable
option name 'coaport'
option title 'RADIUS disconnect port'
option description 'UDP port to listen to for accepting radius disconnect requests'
option section 'coovachilli.radius'
option datatype 'port'
config variable
option name 'coanoipcheck'
option title 'Do not check disconnection requests'
option description 'Do not check the source IP address of radius disconnect requests'
option section 'coovachilli.radius'
option datatype 'boolean'
config section
option name 'proxy'
option title 'RADIUS proxy settings'
option description 'RADIUS proxy settings'
option package 'coovachilli'
option unique true
option required true
config variable
option name 'proxyclient'
option title 'Proxy client'
option description 'IP address from which radius requests are accepted. If omitted the server will not accept radius requests'
option section 'coovachilli.proxy'
option datatype 'host'
config variable
option name 'proxylisten'
option title 'Proxy listen address'
option description 'Local interface IP address to use for accepting radius requests'
option section 'coovachilli.proxy'
option datatype 'host'
config variable
option name 'proxyport'
option title 'Proxy port'
option description 'UDP Port to listen to for accepting radius requests'
option section 'coovachilli.proxy'
option datatype 'port'
config variable
option name 'proxysecret'
option title 'Proxy secret'
option description 'Radius shared secret for clients'
option section 'coovachilli.proxy'
option datatype 'string'
config section
option name 'uam'
option title 'UAM settings'
option description 'Unified Configuration Method settings'
option package 'coovachilli'
option unique true
option required true
config variable
option name 'uamanydns'
option title 'Allow any DNS server'
option description 'Allow any DNS server for unauthenticated clients'
option section 'coovachilli.uam'
option datatype 'boolean'
config variable
option name 'uamanyip'
option title 'Allow any IP address'
option description 'Allow clients to use any IP settings they wish by spoofing ARP (experimental)'
option section 'coovachilli.uam'
option datatype 'boolean'
config variable
option name 'dnsparanoia'
option title 'Inspect DNS traffic'
option description 'Inspect DNS packets and drop responses with any non- A, CNAME, SOA, or MX records to prevent dns tunnels (experimental)'
option section 'coovachilli.uam'
option datatype 'boolean'
config variable
option name 'nouamsuccess'
option title 'Do not redirect to UAM server'
option description 'Do not return to UAM server on login success, just redirect to original URL'
option section 'coovachilli.uam'
option datatype 'boolean'
config variable
option name 'nouamwispr'
option title 'Do not do WISPr'
option description 'Do not do any WISPr XML, assume the back-end is doing this instead'
option section 'coovachilli.uam'
option datatype 'boolean'
config variable
option name 'usestatusfile'
option title 'Use status file'
option description 'Write the status of clients in a non-volatile state file (experimental)'
option section 'coovachilli.uam'
option datatype 'boolean'
config variable
option name 'chillixml'
option title 'Use Chilli XML'
option description 'Return the so-called Chilli XML along with WISPr XML'
option section 'coovachilli.uam'
option datatype 'boolean'
config variable
option name 'uamui'
option title 'UAM user interface'
option description 'An init.d style program to handle local content on the uamuiport web server'
option section 'coovachilli.uam'
option datatype 'file'
config variable
option name 'uamallowed'
option title 'Allowed resources'
option description 'List of resources the client can access without first authenticating'
option section 'coovachilli.uam'
option datatype 'string'
option type 'list'
config variable
option name 'uamdomain'
option title 'Allowed domains'
option description 'Defines a list of domain names to automatically add to the walled garden'
option section 'coovachilli.uam'
option datatype 'string'
option type 'list'
config variable
option name 'uamhomepage'
option title 'UAM homepage'
option description 'URL of homepage to redirect unauthenticated users to'
option section 'coovachilli.uam'
option datatype 'string'
config variable
option name 'uamlisten'
option title 'UAM listening address'
option description 'IP address to listen to for authentication of clients'
option section 'coovachilli.uam'
option datatype 'host'
config variable
option name 'uamport'
option title 'UAM listening port'
option description 'TCP port to bind to for authenticating clients (default 3990)'
option section 'coovachilli.uam'
option datatype 'port'
config variable
option name 'uamiport'
option title 'UAM static content port'
option description 'TCP port to bind to for only serving embedded content'
option section 'coovachilli.uam'
option datatype 'port'
config variable
option name 'uamsecret'
option title 'UAM secret'
option description 'Shared secret between uamserver and chilli'
option section 'coovachilli.uam'
option datatype 'string'
option required true
config variable
option name 'uamserver'
option title 'UAM server'
option description 'URL of web server to use for authenticating clients'
option section 'coovachilli.uam'
option datatype 'string'
config variable
option name 'uamlogoutip'
option title 'UAM logout IP'
option description 'Use this IP address to instantly logout a client accessing it (defaults to 1.1.1.1)'
option section 'coovachilli.uam'
option datatype 'ip4addr'
config variable
option name 'wisprlogin'
option title 'WISPr login url'
option description 'Specific URL to be given in WISPr XML LoginURL'
option section 'coovachilli.uam'
option datatype 'string'
config variable
option name 'defsessiontimeout'
option title 'Default session timeout'
option description 'Default session timeout unless otherwise set by RADIUS (defaults to 0)'
option section 'coovachilli.uam'
option datatype 'uint'
config variable
option name 'defidletimeout'
option title 'Default idle timeout'
option description 'Default idle timeout unless otherwise set by RADIUS (defaults to 0)'
option section 'coovachilli.uam'
option datatype 'uint'
config variable
option name 'definteriminterval'
option title 'Default interim interval'
option description 'Default interim-interval for RADIUS accounting unless otherwise set by RADIUS (defaults to 0)'
option section 'coovachilli.uam'
option datatype 'uint'
config variable
option name 'wwwdir'
option title 'Web content directory'
option description 'Directory where embedded local web content is placed'
option section 'coovachilli.uam'
option datatype 'directory'
config variable
option name 'wwwbin'
option title 'CGI program'
option description 'Executable to run as a CGI type program (like haserl) for URLs with extention .chi'
option section 'coovachilli.uam'
option datatype 'file'
config variable
option name 'localusers'
option title 'Local users file'
option description 'A colon seperated file containing usernames and passwords of locally authenticated users'
option section 'coovachilli.uam'
option datatype 'file'
config variable
option name 'postauthproxy'
option title 'Post auth proxy'
option description 'Used with postauthproxyport to define a post authentication HTTP proxy server'
option section 'coovachilli.uam'
option datatype 'file'
config variable
option name 'postauthproxyport'
option title 'Post auth proxy port'
option description 'Used with postauthproxy to define a post authentication HTTP proxy server'
option section 'coovachilli.uam'
option datatype 'file'
config variable
option name 'locationname'
option title 'Location name'
option description 'Human readable location name used in JSON interface'
option section 'coovachilli.uam'
option datatype 'file'

View File

@@ -0,0 +1,24 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: openvpn.lua 3549 2008-10-09 22:24:21Z jow $
]]--
module("luci.controller.openvpn", package.seeall)
function index()
require("luci.i18n")
luci.i18n.loadc("openvpn")
entry( {"admin", "services", "openvpn"}, cbi("openvpn"), luci.i18n.translate("openvpn", "OpenVPN") ).i18n = "openvpn"
entry( {"admin", "services", "openvpn", "basic"}, cbi("openvpn-basic"), nil ).leaf = true
entry( {"admin", "services", "openvpn", "advanced"}, cbi("openvpn-advanced"), nil ).leaf = true
end

View File

@@ -0,0 +1,196 @@
openvpn="OpenVPN"
openvpn_switch_basic="« Switch to basic configuration"
openvpn_switch_advanced="Switch to advanced configuration »"
openvpn_enable="Enabled"
openvpn_active="Started"
openvpn_active_no="no"
openvpn_active_yes="yes (%i)"
openvpn_port="Port"
openvpn_proto="Protocol"
openvpn_instance="Instance \"%s\""
openvpn_overview="OpenVPN instances"
openvpn_overview_desc="Below is a list of configured OpenVPN instances and their current state"
openvpn_service="Daemon configuration"
openvpn_networking="Networking options"
openvpn_vpn="VPN options"
openvpn_cryptography="Cryptography settings"
openvpn_param_config="Read configuration options from file"
openvpn_param_local="Local host name or ip address"
openvpn_param_remote="Remote host name or ip address"
openvpn_param_remote_random="Randomly choose remote server"
openvpn_param_mode="Major mode"
openvpn_param_proto="Use protocol"
openvpn_param_connect_retry="Connection retry interval"
openvpn_param_connect_timeout="Connection timeout"
openvpn_param_connect_retry_max="Maximum connection attempt retries"
openvpn_param_auto_proxy="Try to sense proxy settings automatically"
openvpn_param_http_proxy="Connect to remote host"
openvpn_param_http_proxy_retry="Retry indefinitely on HTTP proxy errors"
openvpn_param_http_proxy_timeout="Proxy timeout in seconds"
openvpn_param_http_proxy_option="Set extended HTTP proxy options"
openvpn_param_socks_proxy="Connect through Socks5 proxy"
openvpn_param_socks_proxy_retry="Retry indefinitely on Socks proxy errors"
openvpn_param_resolv_retry="If hostname resolve fails, retry"
openvpn_param_float="Allow remote to change its IP or port"
openvpn_param_ipchange="Execute shell command on remote ip change"
openvpn_param_port="TCP/UDP port # for both local and remote"
openvpn_param_lport="TCP/UDP port # for local (default=1194)"
openvpn_param_rport="TCP/UDP port # for remote (default=1194)"
openvpn_param_bind="Bind to local address and port"
openvpn_param_nobind="Do not bind to local address and port"
openvpn_param_dev="tun/tap device"
openvpn_param_dev_type="Type of used device"
openvpn_param_dev_node="Use tun/tap device node"
openvpn_param_lladdr="Set the link layer address of the tap device"
openvpn_param_topology="'net30', 'p2p', or 'subnet'"
openvpn_param_tun_ipv6="Make tun device IPv6 capable"
openvpn_param_ifconfig="Configure device to use IP address"
openvpn_param_ifconfig_noexec="Don't actually execute ifconfig"
openvpn_param_ifconfig_nowarn="Don't warn on ifconfig inconsistencies"
openvpn_param_route="Add route after establishing connection"
openvpn_param_route_gateway="Specify a default gateway for routes"
openvpn_param_route_metric="Specify a default metric for routes"
openvpn_param_route_delay="Delay n seconds after connection "
openvpn_param_route_up="Execute shell cmd after routes are added"
openvpn_param_route_noexec="Don't add routes automatically"
openvpn_param_route_nopull="Don't pull options from server"
openvpn_param_redirect_gateway="Automatically redirect default route"
openvpn_param_setenv="Pass environment variables to script"
openvpn_param_shaper="Shaping for peer bandwidth"
openvpn_param_keepalive="Set timeouts in server mode"
openvpn_param_inactive="tun/tap inactivity timeout"
openvpn_param_ping_exit="Remote ping timeout"
openvpn_param_ping_restart="Restart after remote ping timeout"
openvpn_param_ping_timer_rem="Only process ping timeouts if routes exist"
openvpn_param_ping="Ping remote every n seconds over TCP/UDP port"
openvpn_param_multihome="Configure a multi-homed UDP server"
openvpn_param_fast_io="Optimize TUN/TAP/UDP writes"
openvpn_param_remap_usr1="Remap SIGUSR1 signals"
openvpn_param_persist_tun="Keep tun/tap device open on restart"
openvpn_param_persist_remote_ip="Keep remote IP address on restart"
openvpn_param_persist_local_ip="Keep local IP address on restart"
openvpn_param_persist_key="Don't re-read key on restart"
openvpn_param_passtos="TOS passthrough (applies to IPv4 only)"
openvpn_param_tun_mtu="Set tun/tap device MTU"
openvpn_param_tun_mtu_extra="Set tun/tap device overhead"
openvpn_param_link_mtu="Set TCP/UDP MTU"
openvpn_param_mtu_disc="Enable Path MTU discovery"
openvpn_param_mtu_test="Empirically measure MTU"
openvpn_param_fragment="Enable internal datagram fragmentation"
openvpn_param_mssfix="Set upper bound on TCP MSS"
openvpn_param_sndbuf="Set the TCP/UDP send buffer size"
openvpn_param_rcvbuf="Set the TCP/UDP receive buffer size"
openvpn_param_txqueuelen="Set tun/tap TX queue length"
openvpn_param_mlock="Disable Paging"
openvpn_param_up="Shell cmd to execute after tun device open"
openvpn_param_up_delay="Delay tun/tap open and up script execution"
openvpn_param_down="Shell cmd to run after tun device close"
openvpn_param_down_pre="Call down cmd/script before TUN/TAP close"
openvpn_param_up_restart="Run up/down scripts for all restarts"
openvpn_param_user="Set UID to user"
openvpn_param_group="Set GID to group"
openvpn_param_chroot="Chroot to directory after initialization"
openvpn_param_cd="Change to directory before initialization"
openvpn_param_daemon="Daemonize after initialization"
openvpn_param_syslog="Output to syslog and do not daemonize"
openvpn_param_inetd="Run as an inetd or xinetd server"
openvpn_param_log="Write log to file"
openvpn_param_log_append="Append log to file"
openvpn_param_suppress_timestamps="Don't log timestamps"
openvpn_param_writepid="Write process ID to file"
openvpn_param_nice="Change process priority"
openvpn_param_echo="Echo parameters to log"
openvpn_param_verb="Set output verbosity"
openvpn_param_mute="Limit repeated log messages"
openvpn_param_status="Write status to file every n seconds"
openvpn_param_status_version="Status file format version"
openvpn_param_disable_occ="Disable options consistency check"
openvpn_param_gremlin="Special stress testing mode"
openvpn_param_comp_lzo="Use fast LZO compression"
openvpn_param_comp_noadapt="Don't use adaptive lzo compression"
openvpn_param_management="Enable TCP server on ip:port"
openvpn_param_management_client="Management interface will connect as a TCP client"
openvpn_param_management_query_passwords="Query management channel for private key"
openvpn_param_management_hold="Start OpenVPN in a hibernating state"
openvpn_param_management_signal="Issue SIGUSR1 on management disconnect"
openvpn_param_management_forget_disconnect="Forget passwords on management disconnect"
openvpn_param_management_log_cache="Number of lines for log file history"
openvpn_param_plugin="Load plug-in module"
openvpn_param_server="Configure server mode"
openvpn_param_server_bridge="Configure server bridge"
openvpn_param_push="Push options to peer"
openvpn_param_push_reset="Don't inherit global push options"
openvpn_param_ifconfig_pool="Set aside a pool of subnets"
openvpn_param_ifconfig_pool_linear="Use individual addresses rather than /30 subnets"
openvpn_param_ifconfig_pool_persist="Persist/unpersist ifconfig-pool"
openvpn_param_ifconfig_push="Push an ifconfig option to remote"
openvpn_param_iroute="Route subnet to client"
openvpn_param_disable="Client is disabled"
openvpn_param_client_cert_not_required="Don't require client certificate"
openvpn_param_username_as_common_name="Use username as common name"
openvpn_param_auth_user_pass_verify="Script to verify interactive authentication"
openvpn_param_client_to_client="Allow client-to-client traffic"
openvpn_param_duplicate_cn="Allow multiple clients with same certificate"
openvpn_param_client_connect="Run script cmd on client connection"
openvpn_param_client_disconnect="Run script cmd on client disconnection"
openvpn_param_client_config_dir="Directory for custom client config files"
openvpn_param_ccd_exclusive="Refuse connection if no custom client config"
openvpn_param_tmp_dir="Temporary directory for client-connect return file"
openvpn_param_hash_size="Set size of real and virtual address hash tables"
openvpn_param_bcast_buffers="Number of allocated broadcast buffers"
openvpn_param_tcp_queue_limit="Maximum number of queued TCP output packets"
openvpn_param_learn_address="Script to validate client virtual addresses"
openvpn_param_connect_freq="Allowed maximum of new connections"
openvpn_param_max_clients="Allowed maximum of connected clients"
openvpn_param_max_routes_per_client="Allowed maximum of internal"
openvpn_param_port_share="Proxy incoming HTTPS sessions"
openvpn_param_client="Configure client mode"
openvpn_param_auth_user_pass="Authenticate using username/password"
openvpn_param_pull="Accept options pushed from server"
openvpn_param_auth_retry="Handling of authentication failures"
openvpn_param_explicit_exit_notify="Send notification to peer on disconnect"
openvpn_param_secret="Enable Static Key encryption mode (non-TLS)"
openvpn_param_auth="HMAC authentication for packets"
openvpn_param_cipher="Encryption cipher for packets"
openvpn_param_keysize="Size of cipher key"
openvpn_param_engine="Enable OpenSSL hardware crypto engines"
openvpn_param_no_replay="Disable replay protection"
openvpn_param_mute_replay_warnings="Silence the output of replay warnings"
openvpn_param_replay_window="Replay protection sliding window size"
openvpn_param_no_iv="Disable cipher initialisation vector"
openvpn_param_replay_persist="Persist replay-protection state"
openvpn_param_test_crypto="Run a self-test of crypto features"
openvpn_param_tls_server="Enable TLS and assume server role"
openvpn_param_tls_client="Enable TLS and assume client role"
openvpn_param_key_method="Data channel key exchange method"
openvpn_param_ca="Certificate authority"
openvpn_param_capath="Directory of trusted certificates (CAs and CRLs)"
openvpn_param_dh="Diffie Hellman parameters"
openvpn_param_cert="Local certificate"
openvpn_param_key="Local private key"
openvpn_param_pkcs12="PKCS#12 file containing keys"
openvpn_param_tls_cipher="TLS cipher"
openvpn_param_tls_timeout="Retransmit timeout on TLS control channel"
openvpn_param_reneg_bytes="Renegotiate data chan. key after bytes"
openvpn_param_reneg_pkts="Renegotiate data chan. key after packets"
openvpn_param_reneg_sec="Renegotiate data chan. key after seconds"
openvpn_param_hand_window="Timeframe for key exchange"
openvpn_param_tran_window="Key transition window"
openvpn_param_single_session="Allow only one session"
openvpn_param_tls_exit="Exit on TLS negotiation failure"
openvpn_param_tls_auth="Additional authentication over TLS"
openvpn_param_askpass="Get PEM password from controlling tty before we daemonize"
openvpn_param_auth_nocache="Don't cache --askpass or --auth-user-pass passwords"
openvpn_param_crl_verify="Check peer certificate against a CRL"
openvpn_param_tls_verify="Shell command to verify X509 name"
openvpn_param_tls_remote="Only accept connections from given X509 name"
openvpn_param_ns_cert_type="Require explicit designation on certificate"
openvpn_param_remote_cert_ku="Require explicit key usage on certificate"
openvpn_param_remote_cert_eku="Require extended explicit key usage on certificate"
openvpn_param_remote_cert_tls="Require normal and extended key usage on certificate"

View File

@@ -0,0 +1,271 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: openvpn-advanced.lua 3551 2008-10-10 11:48:04Z jow $
]]--
require("luci.fs")
require("luci.ip")
local knownParams = {
--
-- Widget Name Optn. Default(s)
--
{ "service", {
-- initialisation and daemon options
{ ListValue, "verb", { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
{ Flag, "mlock", 0 },
{ Flag, "disable_occ", 0 },
-- { Value, "user", "root" },
-- { Value, "group", "root" },
{ Value, "cd", "/etc/openvpn" },
{ Value, "chroot", "/var/run" },
-- { Value, "daemon", "Instance-Name" },
-- { Value, "syslog", "Instance-Name" },
{ Flag, "passtos", 0 },
-- { Value, "inetd", "nowait Instance-Name" },
{ Value, "log", "/var/log/openvpn.log" },
{ Value, "log_append", "/var/log/openvpn.log" },
{ Flag, "suppress_timestamps", 0 },
-- { Value, "writepid", "/var/run/openvpn.pid" },
{ Value, "nice", 0 },
{ Flag, "fast_io", 0 },
{ Value, "echo", "some params echoed to log" },
{ ListValue, "remap_usr1", { "SIGHUP", "SIGTERM" } },
{ Value, "status", "/var/run/openvpn.status 5" },
{ Value, "status_version", { 1, 2 } }, -- status
{ Value, "mute", 5 },
{ Value, "up", "/usr/bin/ovpn-up" },
{ Value, "up_delay", 5 },
{ Value, "down", "/usr/bin/ovpn-down" },
{ Flag, "down_pre", 0 },
{ Flag, "up_restart", 0 },
{ Value, "route_up", "/usr/bin/ovpn-routeup" },
{ Value, "ipchange", "/usr/bin/ovpn-ipchange", { mode="p2p" } },
{ DynamicList, "setenv", { "VAR1 value1", "VAR2 value2" } },
{ Value, "tls_verify", "/usr/bin/ovpn-tlsverify" },
{ Value, "client_connect", "/usr/bin/ovpn-clientconnect" },
{ Flag, "client_disconnect", 0 },
{ Value, "learn_address", "/usr/bin/ovpn-learnaddress" },
{ Value, "auth_user_pass_verify", "/usr/bin/ovpn-userpass via-env" },
} },
{ "networking", {
-- socket config
{ ListValue, "mode", { "p2p", "server" } },
{ Value, "local", "0.0.0.0" },
{ Value, "port", 1194 },
{ Value, "lport", 1194 },
{ Value, "rport", 1194 },
{ Flag, "float", 0 },
{ Flag, "nobind", 0 },
{ Value, "dev", "tun0" },
{ ListValue, "dev_type", { "tun", "tap" } },
{ Value, "dev_node", "/dev/net/tun" },
{ Flag, "tun_ipv6", 0 },
{ Value, "ifconfig", "10.200.200.3 10.200.200.1" },
{ Flag, "ifconfig_noexec", 0 },
{ Flag, "ifconfig_nowarn", 0 },
{ DynamicList, "route", "10.123.0.0 255.255.0.0" },
{ Value, "route_gateway", "10.234.1.1" },
{ Value, "route_delay", 0 },
{ Flag, "route_noexec", 0 },
{ ListValue, "mtu_disc", { "yes", "maybe", "no" } },
{ Flag, "mtu_test", 0 },
{ Flag, "comp_lzo", 0 },
{ Flag, "comp_noadept", 0, { comp_lzo=1 } },
{ Value, "link_mtu", 1500 },
{ Value, "tun_mtu", 1500 },
{ Value, "tun_mtu_extra", 1500 },
{ Value, "fragment", 1500, { proto="udp" } },
{ Value, "mssfix", 1500, { proto="udp" } },
{ Value, "sndbuf", 65536 },
{ Value, "rcvbuf", 65536 },
{ Value, "txqueuelen", 100 },
{ Value, "shaper", 10240 },
{ Value, "inactive", 240 },
{ Value, "keepalive", "10 60" },
{ Value, "ping", 30 },
{ Value, "ping_exit", 120 },
{ Value, "ping_restart", 60 },
{ Flag, "ping_timer_rem", 0 },
{ Flag, "persist_tun", 0 },
{ Flag, "persist_key", 0 },
{ Flag, "persist_local_ip", 0 },
{ Flag, "persist_remote_ip", 0 },
-- management channel
{ Value, "management", "127.0.0.1 31194 /etc/openvpn/mngmt-pwds" },
{ Flag, "management_query_passwords", 0 }, -- management
{ Flag, "management_hold", 0 }, -- management
{ Flag, "management_log_cache", 100 }, -- management
} },
{ "vpn", {
{ Value, "server", "10.200.200.0 255.255.255.0", { server_mode="1" } },
{ Value, "server_bridge", "10.200.200.1 255.255.255.0 10.200.200.200 10.200.200.250", { server_mode="1" } },
{ DynamicList, "push", { "redirect-gateway", "comp-lzo" }, { server_mode="1" } },
{ Flag, "push_reset", 0, { server_mode="1" } },
{ Flag, "disable", 0, { server_mode="1" } },
{ Value, "ifconfig_pool", "10.200.200.100 10.200.200.150 255.255.255.0", { server_mode="1" } },
{ Value, "ifconfig_pool_persist", "/etc/openvpn/ipp.txt 600", { server_mode="1" } },
{ Flag, "ifconfig_pool_linear", 0, { server_mode="1" } },
{ Value, "ifconfig_push", "10.200.200.1 255.255.255.255", { server_mode="1" } },
{ Value, "iroute", "10.200.200.0 255.255.255.0", { server_mode="1" } },
{ Flag, "client_to_client", 0, { server_mode="1" } },
{ Flag, "duplicate_cn", 0, { server_mode="1" } },
{ Value, "client_config_dir", "/etc/openvpn/ccd", { server_mode="1" } },
{ Flag, "ccd_exclusive", 0, { server_mode="1" } },
{ Value, "tmp_dir", "/var/run/openvpn", { server_mode="1" } },
{ Value, "hash_size", "256 256", { server_mode="1" } },
{ Value, "bcast_buffers", 256, { server_mode="1" } },
{ Value, "tcp_queue_limit", 64, { server_mode="1" } },
{ Value, "max_clients", 10, { server_mode="1" } },
{ Value, "max_routes_per_client", 256, { server_mode="1" } },
{ Value, "connect_freq", "3 10", { server_mode="1" } },
{ Flag, "client_cert_not_required", 0, { server_mode="1" } },
{ Flag, "username_as_common_name", 0, { server_mode="1" } },
{ Flag, "client", 0, { server_mode="0" }, { server_mode="" } },
{ Flag, "pull", 0, { client="1" } },
{ Value, "auth_user_pass", "/etc/openvpn/userpass.txt", { client="1" } },
{ ListValue, "auth_retry", { "none", "nointeract", "interact" }, { client="1" } },
{ Value, "explicit_exit_notify", 1, { client="1" } },
{ DynamicList, "remote", "1.2.3.4", { client="1" } }, -- client
{ Flag, "remote_random", 1, { client="1" } }, -- client
{ ListValue, "proto", { "udp", "tcp-client", "tcp-server" }, { client="1" } },
{ Value, "connect_retry", 5, { proto="tcp-client" }, { client="1" } }, -- client && proto=tcp-client
{ Value, "http_proxy_server", "192.168.1.100 8080", { client="1" } }, -- client
{ Flag, "http_proxy_retry", 0, { client="1" } }, -- client && http_proxy_server
{ Value, "http_proxy_timeout", 5, { client="1" } }, -- client && http_proxy_server
{ DynamicList, "http_proxy_option", { "VERSION 1.0", "AGENT OpenVPN/2.0.9" }, { client="1" } }, -- client && http_proxy_server
{ Value, "socks_proxy_server", "192.168.1.200 1080", { client="1" } }, -- client
{ Value, "socks_proxy_retry", 5, { client="1" } }, -- client && socks_proxy_server
{ Value, "resolv_retry", "infinite", { client="1" } }, -- client
{ ListValue, "redirect_gateway", { "", "local", "def1", "local def1" }, { client="1" } }, -- client
} },
{ "cryptography", {
{ Value, "secret", "/etc/openvpn/secret.key 1" },
{ Value, "auth", "SHA1" }, -- parse
{ Value, "cipher", "BF-CBC" }, -- parse
{ Value, "keysize", 1024 }, -- parse
{ Value, "engine", "dynamic" }, -- parse
{ Flag, "no_replay", 0 },
{ Value, "replay_window", "64 15" },
{ Flag, "mute_replay_warnings", 0 },
{ Value, "replay_persist", "/var/run/openvpn-replay-state" },
{ Flag, "no_iv", 0 },
{ Flag, "tls_server", 0, { tls_client="" }, { tls_client="0" } },
{ Flag, "tls_client", 0, { tls_server="" }, { tls_server="0" } },
{ Value, "ca", "/etc/easy-rsa/keys/ca.crt" },
{ Value, "dh", "/etc/easy-rsa/keys/dh1024.pem" },
{ Value, "cert", "/etc/easy-rsa/keys/some-client.crt" },
{ Value, "key", "/etc/easy-rsa/keys/some-client.key" },
{ Value, "pkcs12", "/etc/easy-rsa/keys/some-client.pk12" },
{ ListValue, "key_method", { 1, 2 } },
{ Value, "tls_cipher", "DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3-SHA:DES-CBC3-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:AES128-SHA:RC4-SHA:RC4-MD5:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:EXP-EDH-RSA-DES-CBC-SHA:EXP-EDH-DSS-DES-CBC-SHA:EXP-DES-CBC-SHA:EXP-RC2-CBC-MD5:EXP-RC4-MD5" },
{ Value, "tls_timeout", 2 },
{ Value, "reneg_bytes", 1024 },
{ Value, "reneg_pkts", 100 },
{ Value, "reneg_sec", 3600 },
{ Value, "hand_window", 60 },
{ Value, "tran_window", 3600 },
{ Flag, "single_session", 0 },
{ Flag, "tls_exit", 0 },
{ Value, "tls_auth", "/etc/openvpn/tlsauth.key 1" },
--{ Value, "askpass", "[file]" },
{ Flag, "auth_nocache", 0 },
{ Value, "tls_remote", "remote_x509_name" },
{ ListValue, "ns_cert_type", { "client", "server" } },
{ Value, "crl_verify", "/etc/easy-rsa/keys/crl.pem" },
} }
}
local cts = { }
local params = { }
local m = Map("openvpn")
local p = m:section( SimpleSection )
p.template = "openvpn/pageswitch"
p.mode = "advanced"
p.instance = arg[1]
p.category = arg[2] or "service"
for _, c in ipairs(knownParams) do
cts[#cts+1] = c[1]
if c[1] == p.category then params = c[2] end
end
p.categories = cts
local s = m:section(
NamedSection, arg[1], "openvpn",
translate("openvpn_%s" % arg[2]),
translate("openvpn_%s_desc" % arg[2])
)
s.title = translate("openvpn_%s" % arg[2])
s.addremove = false
s.anonymous = true
for _, option in ipairs(params) do
local o = s:option(
option[1], option[2],
translate("openvpn_param_%s" % option[2]),
translate("openvpn_param_%s_desc" % option[2])
)
if option[1] == DummyValue then
o.value = option[3]
else
if option[1] == DynamicList then
o.cast = nil
function o.cfgvalue(...)
local val = AbstractValue.cfgvalue(...)
return ( val and type(val) ~= "table" ) and { val } or val
end
end
o.optional = true
if type(option[3]) == "table" then
if o.optional then o:value("", "-- remove --") end
for _, v in ipairs(option[3]) do
v = tostring(v)
o:value(v)
end
o.default = tostring(option[3][1])
else
o.default = tostring(option[3])
end
end
for i=5,#option do
if type(option[i]) == "table" then
o:depends(option[i])
end
end
end
return m

View File

@@ -0,0 +1,102 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: openvpn-basic.lua 3551 2008-10-10 11:48:04Z jow $
]]--
require("luci.fs")
require("luci.ip")
require("luci.model.uci")
local basicParams = {
--
-- Widget Name Optn. Default(s)
--
{ ListValue, "verb", { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
{ Value, "nice", 0 },
{ Value, "port", 1194 },
{ ListValue, "dev_type", { "tun", "tap" } },
{ Flag, "tun_ipv6", 0 },
{ Value, "ifconfig", "10.200.200.3 10.200.200.1" },
{ Value, "server", "10.200.200.0 255.255.255.0" },
{ Value, "server_bridge", "192.168.1.1 255.255.255.0 192.168.1.128 192.168.1.254" },
{ Flag, "nobind", 0 },
{ Flag, "comp_lzo", 0 },
{ Value, "keepalive", "10 60" },
{ ListValue, "proto", { "udp", "tcp" } },
{ Flag, "client", 0 },
{ Flag, "client_to_client", 0 },
{ DynamicList, "remote", "vpnserver.example.org" },
{ Value, "secret", "/etc/openvpn/secret.key 1" },
{ Value, "ca", "/etc/easy-rsa/keys/ca.crt" },
{ Value, "dh", "/etc/easy-rsa/keys/dh1024.pem" },
{ Value, "cert", "/etc/easy-rsa/keys/some-client.crt" },
{ Value, "key", "/etc/easy-rsa/keys/some-client.key" },
}
local m = Map("openvpn")
local p = m:section( SimpleSection )
p.template = "openvpn/pageswitch"
p.mode = "basic"
p.instance = arg[1]
local s = m:section( NamedSection, arg[1], "openvpn" )
for _, option in ipairs(basicParams) do
local o = s:option(
option[1], option[2],
translate("openvpn_param_%s" % option[2]),
translate("openvpn_param_%s_desc" % option[2])
)
o.optional = true
if option[1] == DummyValue then
o.value = option[3]
else
if option[1] == DynamicList then
o.cast = nil
function o.cfgvalue(...)
local val = AbstractValue.cfgvalue(...)
return ( val and type(val) ~= "table" ) and { val } or val
end
end
if type(option[3]) == "table" then
if o.optional then o:value("", "-- remove --") end
for _, v in ipairs(option[3]) do
v = tostring(v)
o:value(v)
end
o.default = tostring(option[3][1])
else
o.default = tostring(option[3])
end
end
for i=5,#option do
if type(option[i]) == "table" then
o:depends(option[i])
end
end
end
return m

View File

@@ -0,0 +1,101 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: openvpn.lua 3551 2008-10-10 11:48:04Z jow $
]]--
require("luci.fs")
require("luci.ip")
require("luci.sys")
require("luci.model.uci")
local uci = luci.model.uci.cursor()
local m = Map("openvpn", translate("openvpn"))
local s = m:section( TypedSection, "openvpn", translate("openvpn_overview"), translate("openvpn_overview_desc") )
s.template = "cbi/tblsection"
s.template_addremove = "openvpn/cbi-select-input-add"
s.addremove = true
s.add_select_options = { }
s.extedit = luci.dispatcher.build_url(
"admin", "services", "openvpn", "basic", "%s"
)
uci:load("openvpn_recipes")
uci:foreach( "openvpn_recipes", "openvpn_recipe",
function(section)
s.add_select_options[section['.name']] =
section['_description'] or section['.name']
end
)
function s.parse(self, section)
local recipe = luci.http.formvalue(
luci.cbi.CREATE_PREFIX .. self.config .. "." ..
self.sectiontype .. ".select"
)
if recipe and not s.add_select_options[recipe] then
self.invalid_cts = true
else
TypedSection.parse( self, section )
end
end
function s.create(self, name)
local recipe = luci.http.formvalue(
luci.cbi.CREATE_PREFIX .. self.config .. "." ..
self.sectiontype .. ".select"
)
uci:section(
"openvpn", "openvpn", name,
uci:get_all( "openvpn_recipes", recipe )
)
uci:delete("openvpn", name, "_role")
uci:delete("openvpn", name, "_description")
uci:save("openvpn")
luci.http.redirect( self.extedit:format(name) )
end
s:option( Flag, "enable", translate("openvpn_enable") )
local active = s:option( DummyValue, "_active", translate("openvpn_active") )
function active.cfgvalue(self, section)
if luci.fs.isfile("/var/run/openvpn_%s.pid" % section) then
local pid = io.lines("/var/run/openvpn_%s.pid" % section)()
if pid and #pid > 0 and tonumber(pid) ~= nil then
return (luci.sys.process.signal(pid, 0))
and translatef("openvpn_active_yes", pid)
or translate("openvpn_active_no")
end
end
return translate("openvpn_active_no")
end
local port = s:option( DummyValue, "port", translate("openvpn_port") )
function port.cfgvalue(self, section)
local val = AbstractValue.cfgvalue(self, section)
return val or "1194"
end
local proto = s:option( DummyValue, "proto", translate("openvpn_proto") )
function proto.cfgvalue(self, section)
local val = AbstractValue.cfgvalue(self, section)
return val or "udp"
end
return m

View File

@@ -0,0 +1,11 @@
<div class="cbi-section-create">
<% if self.invalid_cts then -%><div class="cbi-section-error"><% end %>
<input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
<select class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.select">
<%- for k, v in luci.util.kspairs(self.add_select_options) do %>
<option value="<%=k%>"><%=luci.util.pcdata(v)%></option>
<% end -%>
</select>
<input class="cbi-button cbi-button-add" type="submit" value="<%:cbi_add%>" title="<%:cbi_add%>" />
<% if self.invalid_cts then %><br /><%:cbi_invalid%></div><% end %>
</div>

View File

@@ -0,0 +1,39 @@
<%#
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: pageswitch.htm 3551 2008-10-10 11:48:04Z jow $
-%>
<fieldset class="cbi-section">
<legend>
<a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn")%>"><%:openvpn_overview Overview%></a> &raquo;
<%=luci.i18n.translatef("openvpn_instance", "%s", self.instance)%>
</legend>
<% if self.mode == "basic" then %>
<a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn", "advanced", self.instance)%>"><%:openvpn_switch_advanced Switch to advanced configuration &raquo;%></a>
<% else %>
<a href="<%=luci.dispatcher.build_url("admin", "services", "openvpn", "basic", self.instance)%>"><%:openvpn_switch_basic &laquo; Switch to basic configuration%></a>
<hr style="margin:0.5em 0" />
<%:openvpn_confcategory Configuration category%>:
<% for i, c in ipairs(self.categories) do %>
<% if c == self.category then %>
<strong><%=translate("openvpn_%s" % c, c)%></strong>
<% else %>
<a href="<%=luci.dispatcher.build_url(
"admin", "services", "openvpn", "advanced", self.instance, c
)%>"><%=translate("openvpn_%s" % c, c)%></a>
<% end %>
<% if next(self.categories, i) then %>|<% end %>
<% end %>
<% end %>
</fieldset>

View File

@@ -0,0 +1,383 @@
#################################################
# Sample OpenVPN 2.0 config file for #
# multi-client server. #
#################################################
config openvpn sample_server
# Set to 1 to enable this instance:
option enable 0
# Which local IP address should OpenVPN
# listen on? (optional)
# option local 0.0.0.0
# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one. You will need to
# open up this port on your firewall.
option port 1194
# TCP or UDP server?
# option proto tcp
option proto udp
# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
# option dev tap
option dev tun
# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key). Each client
# and the server must have their own cert and
# key file. The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys. Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
option ca ca.crt
option cert server.crt
# This file should be kept secret:
option key server.key
# Diffie hellman parameters.
# Generate your own with:
# openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys.
option dh dh1024.pem
# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
option server "10.8.0.0 255.255.255.0"
# Maintain a record of client <-> virtual IP address
# associations in this file. If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
option ifconfig_pool_persist ipp.txt
# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface. Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0. Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients. Leave this line commented
# out unless you are ethernet bridging.
# option server_bridge "10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100"
# Push routes to the client to allow it
# to reach other private subnets behind
# the server. Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
# list push "route 192.168.10.0 255.255.255.0"
# list push "route 192.168.20.0 255.255.255.0"
# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).
# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
# option client_config_dir ccd
# list route "192.168.40.128 255.255.255.248"
# Then create a file ccd/Thelonious with this line:
# iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN. This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.
# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
# option client_config_dir ccd
# list route "10.9.0.0 255.255.255.252"
# list route "192.168.100.0 255.255.255.0"
# Then add this line to ccd/Thelonious:
# ifconfig-push "10.9.0.1 10.9.0.2"
# Suppose that you want to enable different
# firewall access policies for different groups
# of clients. There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
# group, and firewall the TUN/TAP interface
# for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
# modify the firewall in response to access
# from different clients. See man
# page for more info on learn-address script.
# option learn_address ./script
# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# the TUN/TAP interface to the internet in
# order for this to work properly).
# CAVEAT: May break client's network config if
# client's local DHCP server packets get routed
# through the tunnel. Solution: make sure
# client's local DHCP server is reachable via
# a more specific route than the default route
# of 0.0.0.0/0.0.0.0.
# list push "redirect-gateway"
# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses. CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# list push "dhcp-option DNS 10.8.0.1"
# list push "dhcp-option WINS 10.8.0.1"
# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
# option client_to_client 1
# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names. This is recommended
# only for testing purposes. For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
# option duplicate_cn 1
# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
option keepalive "10 120"
# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
# openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
# This file is secret:
# option tls_auth "ta.key 0"
# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
# Blowfish (default):
# option cipher BF-CBC
# AES:
# option cipher AES-128-CBC
# Triple-DES:
# option cipher DES-EDE3-CBC
# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
option comp_lzo 1
# The maximum number of concurrently connected
# clients we want to allow.
# option max_clients 100
# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
option persist_key 1
option persist_tun 1
# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
option status openvpn-status.log
# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it. Use one
# or the other (but not both).
# option log openvpn.log
# option log_append openvpn.log
# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
option verb 3
# Silence repeating messages. At most 20
# sequential messages of the same message
# category will be output to the log.
# option mute 20
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
##############################################
config openvpn sample_client
# Set to 1 to enable this instance:
option enable 0
# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
option client 1
# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
# option dev tap
option dev tun
# Are we connecting to a TCP or
# UDP server? Use the same setting as
# on the server.
# option proto tcp
option proto udp
# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
list remote "my_server_1 1194"
# list remote "my_server_2 1194"
# Choose a random host from the remote
# list for load_balancing. Otherwise
# try hosts in the order specified.
# option remote_random 1
# Keep trying indefinitely to resolve the
# host name of the OpenVPN server. Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
option resolv_retry infinite
# Most clients don't need to bind to
# a specific local port number.
option nobind 1
# Try to preserve some state across restarts.
option persist_key 1
option persist_tun 1
# If you are connecting through an
# HTTP proxy to reach the actual OpenVPN
# server, put the proxy server/IP and
# port number here. See the man page
# if your proxy server requires
# authentication.
# retry on connection failures:
# option http_proxy_retry 1
# specify http proxy address and port:
# option http_proxy "192.168.1.100 8080"
# Wireless networks often produce a lot
# of duplicate packets. Set this flag
# to silence duplicate packet warnings.
# option mute_replay_warnings 1
# SSL/TLS parms.
# See the server config file for more
# description. It's best to use
# a separate .crt/.key file pair
# for each client. A single ca
# file can be used for all clients.
option ca ca.crt
option cert client.crt
option key client.key
# Verify server certificate by checking
# that the certicate has the nsCertType
# field set to "server". This is an
# important precaution to protect against
# a potential attack discussed here:
# http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the nsCertType
# field set to "server". The build_key_server
# script in the easy_rsa folder will do this.
# option ns_cert_type server
# If a tls_auth key is used on the server
# then every client must also have the key.
# option tls_auth "ta.key 1"
# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
# option cipher x
# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
option comp_lzo 1
# Set log file verbosity.
option verb 3
# Silence repeating messages
# option mute 20

View File

@@ -0,0 +1,95 @@
#
# Routed point-to-point server
#
config openvpn_recipe server_tun_ptp
option _description "Simple server configuration for a routed point-to-point VPN"
option _role "server"
option dev "tun"
option port "1194"
option ifconfig "10.0.0.1 10.0.0.2"
option secret "shared-secret.key"
#
# Routed point-to-point client
#
config openvpn_recipe client_tun_ptp
option _description "Simple client configuration for a routed point-to-point VPN"
option _role "client"
option dev "tun"
list remote "mypeer.dyndns.org"
option port "1194"
option ifconfig "10.0.0.2 10.0.0.1"
option secret "shared-secret.key"
option nobind "1"
#
# Routed multi-client server
#
config openvpn_recipe server_tun
option _description "Server configuration for a routed multi-client VPN"
option _role "server"
option dev "tun"
option port "1194"
option server "10.0.100.0 255.255.255.0"
option ca "ca.crt"
option cert "server.crt"
option key "server.key"
option dh "dh1024.pem"
option client_to_client "1"
option keepalive "10 120"
option comp_lzo "1"
#
# Routed client
#
config openvpn_recipe client_tun
option _description "Client configuration for a routed multi-client VPN"
option _role "client"
option client "1"
option dev "tun"
list remote "vpnserver.example.org 1194"
option ca "ca.crt"
option cert "my_client.crt"
option key "my_client.key"
option dh "dh1024.pem"
option ns_cert_type "server"
option keepalive "10 120"
option comp_lzo "1"
option nobind "1"
#
# Multi-client ethernet bridge server
#
config openvpn_recipe server_tap_bridge
option _description "Server configuration for an ethernet bridge VPN"
option _role "server"
option dev "tap"
option port "1194"
option server_bridge "192.168.1.1 255.255.255.0 192.168.1.128 192.168.1.254"
option ca "ca.crt"
option cert "server.crt"
option key "server.key"
option dh "dh1024.pem"
option client_to_client "1"
option keepalive "10 120"
option comp_lzo "1"
#
# Ethernet bridge client
#
config openvpn_recipe client_tap_bridge
option _description "Client configuration for an ethernet bridge VPN"
option _role "client"
option client "1"
option dev "tap"
list remote "vpnserver.example.org 1194"
option ca "ca.crt"
option cert "my_client.crt"
option key "my_client.key"
option dh "dh1024.pem"
option ns_cert_type "server"
option keepalive "10 120"
option comp_lzo "1"
option nobind "1"

View File

@@ -0,0 +1,144 @@
#!/bin/sh /etc/rc.common
# OpenVPN init script
# Copyright (C) 2008 Jo-Philipp Wich
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
# $Id$
START=95
BIN=/usr/sbin/openvpn
SSD=start-stop-daemon
LIST_SEP="
"
append_param() {
local v="$1"
case "$v" in
*_*_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;;
*_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;;
*_*) v=${v%%_*}-${v#*_} ;;
esac
ARGS="$ARGS --$v"
return 0
}
append_bools() {
local p; local v; local s="$1"; shift
for p in $*; do
config_get_bool v "$s" "$p"
[ "$v" == 1 ] && append_param "$p"
done
}
append_params() {
local p; local v; local s="$1"; shift
for p in $*; do
config_get v "$s" "$p"
IFS="$LIST_SEP"
for v in $v; do
[ -n "$v" ] && append_param "$p" && ARGS="$ARGS $v"
done
unset IFS
done
}
append_params_quoted() {
local p; local v; local s="$1"; shift
for p in $*; do
config_get v "$s" "$p"
IFS="$LIST_SEP"
for v in $v; do
[ -n "$v" ] && append_param "$p" && ARGS="$ARGS '$v'"
done
unset IFS
done
}
start_service() {
local s="$1"
local enable=0
# disabled?
config_get_bool enable "$s" enable 0
[ "$enable" == 0 ] && return 0
PID="/var/run/openvpn-$s.pid"
ARGS=""
# append flags
append_bools "$s" \
auth_nocache ccd_exclusive client client_cert_not_required \
client_disconnect client_to_client comp_lzo comp_noadapt disable \
disable_occ down_pre duplicate_cn fast_io float http_proxy_retry \
ifconfig_noexec ifconfig_nowarn ifconfig_pool_linear management_hold \
management_query_passwords mktun mlock mtu_test mute_replay_warnings \
nobind no_iv no_replay passtos persist_key persist_local_ip \
persist_remote_ip persist_tun ping_timer_rem pull push_reset \
remote_random rmtun route_noexec single_session socks_proxy_retry \
suppress_timestamps test_crypto tls_client tls_exit tls_server \
tun_ipv6 up_delay up_restart username_as_common_name
# append params
append_params "$s" \
auth auth_user_pass auth_user_pass_verify bcast_buffers ca cd cert \
chroot cipher client_config_dir client_connect config connect_freq \
connect_retry crl_verify cryptoapicert dev dev_node dev_type dh down \
echo engine explicit_exit_notify fragment group hand_window hash_size \
http_proxy http_proxy_option http_proxy_timeout ifconfig ifconfig_pool \
ifconfig_pool_persist ifconfig_push inactive ipchange iroute keepalive \
key key_method keysize learn_address link_mtu local log log_append \
lport management management_log_cache max_clients \
max_routes_per_client mode mssfix mtu_disc mute nice ns_cert_type ping \
ping_exit ping_restart pkcs12 plugin port proto rcvbuf \
redirect_gateway remap_usr1 remote reneg_bytes reneg_pkts reneg_sec \
replay_persist replay_window resolv_retry route route_delay \
route_gateway route_up rport server server_bridge setenv shaper sndbuf \
socks_proxy status status_version syslog tcp_queue_limit tls_auth \
tls_cipher tls_remote tls_timeout tls_verify tmp_dir tran_window \
tun_mtu tun_mtu_extra txqueuelen up user verb
# append multi-value params
append_params_quoted "$s" \
push
[ -n "$ARGS" ] && \
eval "$SSD -q -b -m -p $PID -x $BIN -S -- --syslog 'openvpn($s)' $ARGS"
}
kill_service() {
local s="$1"
local S="${2:-TERM}"
local enable=0
# disabled?
config_get_bool enable "$s" enable 0
[ "$enable" == 0 ] && return 0
PID="/var/run/openvpn-$s.pid"
$SSD -q -p $PID -x $BIN -K -s $S
}
hup_service() { kill_service "$1" HUP; }
stop_service() { kill_service "$1" TERM; }
start() {
config_load openvpn
config_foreach start_service openvpn
}
stop() {
config_load openvpn
config_foreach stop_service openvpn
}
reload() {
config_load openvpn
config_foreach hup_service openvpn
}
restart() {
stop; sleep 5; start
}

View File

@@ -0,0 +1,299 @@
mode m
Set OpenVPN major mode
local host
Local host name or IP address for bind
remote host [port]
Remote host name or IP address
remote-random
When multiple --remote address/ports are specified, initially randomize the order of the list as a kind of basic load-balancing measure
proto p
Use protocol p for communicating with remote host
connect-retry n
For --proto tcp-client, take n as the number of seconds to wait between connection retries (default=5)
connect-retry-max n
For --proto tcp-client, take n as the number of retries of connection attempt (default=infinite)
auto-proxy
Try to sense HTTP or SOCKS proxy settings automatically
http-proxy server port [authfile|'auto'] [auth-method]
Connect to remote host through an HTTP proxy at address server and port port
http-proxy-retry
Retry indefinitely on HTTP proxy errors
http-proxy-timeout n
Set proxy timeout to n seconds, default=5
http-proxy-option type [parm]
Set extended HTTP proxy options
socks-proxy server [port]
Connect to remote host through a Socks5 proxy at address server and port port (default=1080)
socks-proxy-retry
Retry indefinitely on Socks proxy errors
resolv-retry n
If hostname resolve fails for --remote, retry resolve for n seconds before failing
float
Allow remote peer to change its IP address and/or port number, such as due to DHCP (this is the default if --remote is not used)
ipchange cmd
Execute shell command cmd when our remote ip-address is initially authenticated or changes
port port
TCP/UDP port number for both local and remote
lport port
TCP/UDP port number for bind
rport port
TCP/UDP port number for remote
bind
Bind to local address and port
nobind
Do not bind to local address and port
dev tunX | tapX | null
TUN/TAP virtual network device ( X can be omitted for a dynamic device
dev-type device-type
Which device type are we using? device-type should be tun or tap
topology mode
Configure virtual addressing topology when running in --dev tun mode
tun-ipv6
Build a tun link capable of forwarding IPv6 traffic
dev-node node
Explicitly set the device node rather than using /dev/net/tun, /dev/tun, /dev/tap, etc
lladdr address
Specify the link layer address, more commonly known as the MAC address
iproute cmd
Set alternate command to execute instead of default iproute2 command
ifconfig l rn
Set TUN/TAP adapter parameters
ifconfig-noexec
Don't actually execute ifconfig/netsh commands, instead pass --ifconfig parameters to scripts using environmental variables
ifconfig-nowarn
Don't output an options consistency check warning if the --ifconfig option on this side of the connection doesn't match the remote side
route network/IP [netmask] [gateway] [metric]
Add route to routing table after connection is established
route-gateway gw
Specify a default gateway gw for use with --route
route-metric m
Specify a default metric m for use with --route
route-delay [n] [w]
Delay n seconds (default=0) after connection establishment, before adding routes
route-up cmd
Execute shell command cmd after routes are added, subject to --route-delay
route-noexec
Don't add or remove routes automatically
route-nopull
When used with --client or --pull, accept options pushed by server EXCEPT for routes
redirect-gateway flags...
(Experimental) Automatically execute routing commands to cause all outgoing IP traffic to be redirected over the VPN
link-mtu n
Sets an upper bound on the size of UDP packets which are sent between OpenVPN peers
tun-mtu n
Take the TUN device MTU to be n and derive the link MTU from it (default=1500)
tun-mtu-extra n
Assume that the TUN/TAP device might return as many as n bytes more than the --tun-mtu size on read
mtu-disc type
Should we do Path MTU discovery on TCP/UDP channel? Only supported on OSes such as Linux that supports the necessary system call to set
mtu-test
To empirically measure MTU on connection startup, add the --mtu-test option to your configuration
fragment max
Enable internal datagram fragmentation so that no UDP datagrams are sent which are larger than max bytes
mssfix max
Announce to TCP sessions running over the tunnel that they should limit their send packet sizes such that after OpenVPN has encapsulated them, the resulting UDP packet size that OpenVPN sends to its peer will not exceed max bytes
sndbuf size
Set the TCP/UDP socket send buffer size
rcvbuf size
Set the TCP/UDP socket receive buffer size
socket-flags flags...
Apply the given flags to the OpenVPN transport socket
txqueuelen n
(Linux only) Set the TX queue length on the TUN/TAP interface
shaper n
Limit bandwidth of outgoing tunnel data to n bytes per second on the TCP/UDP port
inactive n [bytes]
Causes OpenVPN to exit after n seconds of inactivity on the TUN/TAP device
ping n
Ping remote over the TCP/UDP control channel if no packets have been sent for at least n seconds (specify --ping on both peers to cause ping packets to be sent in both directions since OpenVPN ping packets are not echoed like IP ping packets)
ping-exit n
Causes OpenVPN to exit after n seconds pass without reception of a ping or other packet from remote
ping-restart n
Similar to --ping-exit, but trigger a SIGUSR1 restart after n seconds pass without reception of a ping or other packet from remote
keepalive n m
A helper directive designed to simplify the expression of --ping and --ping-restart in server mode configurations
ping-timer-rem
Run the --ping-exit / --ping-restart timer only if we have a remote address
persist-tun
Don't close and reopen TUN/TAP device or run up/down scripts across SIGUSR1 or --ping-restart restarts
persist-key
Don't re-read key files across SIGUSR1 or --ping-restart
persist-local-ip
Preserve initially resolved local IP address and port number across SIGUSR1 or --ping-restart restarts
persist-remote-ip
Preserve most recently authenticated remote IP address and port number across SIGUSR1 or --ping-restart restarts
mlock
Disable paging by calling the POSIX mlockall function
up cmd
Shell command to run after successful TUN/TAP device open (pre --user UID change)
up-delay
Delay TUN/TAP open and possible --up script execution until after TCP/UDP connection establishment with peer
down cmd
Shell command to run after TUN/TAP device close (post --user UID change and/or --chroot )
down-pre
Call --down cmd/script before, rather than after, TUN/TAP close
up-restart
Enable the --up and --down scripts to be called for restarts as well as initial program start
setenv name value
Set a custom environmental variable name=value to pass to script
setenv-safe name value
Set a custom environmental variable OPENVPN_name=value to pass to script
disable-occ
Don't output a warning message if option inconsistencies are detected between peers
user user
Change the user ID of the OpenVPN process to user after initialization, dropping privileges in the process
group group
Similar to the --user option, this option changes the group ID of the OpenVPN process to group after initialization
cd dir
Change directory to dir prior to reading any files such as configuration files, key files, scripts, etc
chroot dir
Chroot to dir after initialization
#daemon [progname]
#Become a daemon after all initialization functions are completed
#syslog [progname]
#Direct log output to system logger, but do not become a daemon
passtos
Set the TOS field of the tunnel packet to what the payload's TOS is
inetd [wait|nowait] [progname]
Use this option when OpenVPN is being run from the inetd or xinetd(8) server
log file
Output logging messages to file, including output to stdout/stderr which is generated by called scripts
log-append file
Append logging messages to file
suppress-timestamps
Avoid writing timestamps to log messages, even when they otherwise would be prepended
writepid file
Write OpenVPN's main process ID to file
nice n
Change process priority after initialization ( n greater than 0 is lower priority, n less than zero is higher priority)
fast-io
(Experimental) Optimize TUN/TAP/UDP I/O writes by avoiding a call to poll/epoll/select prior to the write operation
echo [parms...]
Echo parms to log output
remap-usr1 signal
Control whether internally or externally generated SIGUSR1 signals are remapped to SIGHUP (restart without persisting state) or SIGTERM (exit)
verb n
Set output verbosity to n (default=1)
status file [n]
Write operational status to file every n seconds
status-version [n]
Choose the status file format version number
mute n
Log at most n consecutive messages in the same category
comp-lzo [mode]
Use fast LZO compression -- may add up to 1 byte per packet for incompressible data
comp-noadapt
When used in conjunction with --comp-lzo, this option will disable OpenVPN's adaptive compression algorithm
management IP port [pw-file]
Enable a TCP server on IP:port to handle daemon management functions
management-query-passwords
Query management channel for private key password and --auth-user-pass username/password
management-forget-disconnect
Make OpenVPN forget passwords when management session disconnects
management-hold
Start OpenVPN in a hibernating state, until a client of the management interface explicitly starts it with the hold release command
management-signal
Send SIGUSR1 signal to OpenVPN if management session disconnects
management-log-cache n
Cache the most recent n lines of log file history for usage by the management channel
plugin module-pathname [init-string]
Load plug-in module from the file module-pathname, passing init-string as an argument to the module initialization function

View File

@@ -0,0 +1,21 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: siitwizard.lua 3934 2008-12-23 05:18:08Z jow $
]]--
module "luci.controller.siitwizard"
function index()
entry({"admin", "network", "siitwizard"}, form("siitwizard"), "SIIT 4over6 assistent", 99)
end

View File

@@ -0,0 +1,338 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: siitwizard.lua 3940 2008-12-23 16:49:48Z jow $
]]--
local uci = require "luci.model.uci".cursor()
-------------------- View --------------------
f = SimpleForm("siitwizward", "4over6-Assistent",
"Dieser Assistent unterstüzt bei der Einrichtung von IPv4-over-IPv6 Translation.")
mode = f:field(ListValue, "mode", "Betriebsmodus")
mode:value("client", "Client")
mode:value("gateway", "Gateway")
dev = f:field(ListValue, "device", "WLAN-Gerät")
uci:foreach("wireless", "wifi-device",
function(section)
dev:value(section[".name"])
end)
lanip = f:field(Value, "ipaddr", "LAN IP Adresse")
lanip.value = "172.23.1.1"
lanmsk = f:field(Value, "lanmask", "Lokale LAN Netzmaske")
lanmsk.value = "255.255.255.0"
gv4msk = f:field(Value, "gv4mask", "Globale LAN Netzmaske")
gv4msk.value = "255.255.0.0"
-------------------- Control --------------------
LL_PREFIX = luci.ip.IPv6("fe80::/64")
--
-- find link-local address
--
function find_ll()
for _, r in ipairs(luci.sys.net.routes6()) do
if LL_PREFIX:contains(r.dest) and r.dest:higher(LL_PREFIX) then
return r.dest:sub(LL_PREFIX)
end
end
return luci.ip.IPv6("::")
end
function f.handle(self, state, data)
if state == FORM_VALID then
luci.http.redirect(luci.dispatcher.build_url("admin", "uci", "changes"))
return false
elseif state == FORM_INVALID then
self.errmessage = "Ungültige Eingabe: Bitte die Formularfelder auf Fehler prüfen."
end
return true
end
function mode.write(self, section, value)
-- lan interface
local lan_net = luci.ip.IPv4(
lanip:formvalue(section) or "192.168.1.1",
lanmsk:formvalue(section) or "255.255.255.0"
)
local gv4_net = luci.ip.IPv4(
lanip:formvalue(section) or "192.168.1.1",
gv4msk:formvalue(section) or "255.255.0.0"
)
--
-- Configure wifi device
--
local wifi_device = dev:formvalue(section)
local wifi_essid = uci:get("siit", "wifi", "essid") or "6mesh.freifunk.net"
local wifi_bssid = uci:get("siit", "wifi", "bssid") or "02:ca:ff:ee:ba:be"
local wifi_channel = uci:get("siit", "wifi", "channel") or "1"
-- nuke old device definition
uci:delete_all("wireless", "wifi-iface",
function(s) return s.device == wifi_device end )
uci:delete_all("network", "interface",
function(s) return s['.name'] == wifi_device end )
-- create wifi device definition
uci:tset("wireless", wifi_device, {
disabled = 0,
channel = wifi_channel,
-- txantenna = 1,
-- rxantenna = 1,
-- diversity = 0
})
uci:section("wireless", "wifi-iface", nil, {
encryption = "none",
mode = "adhoc",
network = wifi_device,
device = wifi_device,
ssid = wifi_essid,
bssid = wifi_bssid,
})
--
-- Determine defaults
--
local ula_prefix = uci:get("siit", "ipv6", "ula_prefix") or "fd00::"
local ula_global = uci:get("siit", "ipv6", "ula_global") or "00ca:ffee:babe::" -- = Freifunk
local ula_subnet = uci:get("siit", "ipv6", "ula_subnet") or "0000:0000:0000:4223::" -- = Berlin
local siit_prefix = uci:get("siit", "ipv6", "siit_prefix") or "::ffff:0000:0000"
-- Find wifi interface
local device = dev:formvalue(section)
--
-- Generate ULA
--
local ula = luci.ip.IPv6("::/64")
for _, prefix in ipairs({ ula_prefix, ula_global, ula_subnet }) do
ula = ula:add(luci.ip.IPv6(prefix))
end
ula = ula:add(find_ll())
--
-- Gateway mode
--
-- * wan port is dhcp, lan port is 172.23.1.1/24
-- * siit0 gets a dummy address: 169.254.42.42
-- * wl0 gets an ipv6 address, in this case the fdca:ffee:babe::1:1/64
-- * we do a ::ffff:ffff:0/96 route into siit0, so everything from 6mesh goes into translation.
-- * an HNA6 of ::ffff:ffff:0:0/96 announces the mapped 0.0.0.0/0 ipv4 space.
-- * MTU on WAN, LAN down to 1400, ipv6 headers are slighly larger.
if value == "gateway" then
-- wan mtu
uci:set("network", "wan", "mtu", 1400)
-- lan settings
uci:tset("network", "lan", {
mtu = 1400,
ipaddr = lan_net:host():string(),
netmask = lan_net:mask():string()
})
-- use full siit subnet
siit_route = luci.ip.IPv6(siit_prefix .. "/96")
-- v4 <-> siit route
uci:delete_all("network", "route",
function(s) return s.interface == "siit0" end)
uci:section("network", "route", nil, {
interface = "siit0",
target = gv4_net:network():string(),
netmask = gv4_net:mask():string()
})
--
-- Client mode
--
-- * 172.23.2.1/24 on its lan, fdca:ffee:babe::1:2 on wl0 and the usual dummy address on siit0.
-- * we do a ::ffff:ffff:172.13.2.0/120 to siit0, because in this case, only traffic directed to clients needs to go into translation.
-- * same route as HNA6 announcement to catch the traffic out of the mesh.
-- * Also, MTU on LAN reduced to 1400.
else
-- lan settings
uci:tset("network", "lan", {
mtu = 1400,
ipaddr = lan_net:host():string(),
netmask = lan_net:mask():string()
})
-- derive siit subnet from lan config
siit_route = luci.ip.IPv6(
siit_prefix .. "/" .. (96 + lan_net:prefix())
):add(lan_net[2])
-- ipv4 <-> siit route
uci:delete_all("network", "route",
function(s) return s.interface == "siit0" end)
-- XXX: kind of a catch all, gv4_net would be better
-- but does not cover non-local v4 space
uci:section("network", "route", nil, {
interface = "siit0",
target = "0.0.0.0",
netmask = "0.0.0.0"
})
end
-- setup the firewall
uci:delete_all("firewall", "zone",
function(s) return (
s['.name'] == "siit0" or s.name == "siit0" or
s.network == "siit0" or s['.name'] == wifi_device or
s.name == wifi_device or s.network == wifi_device
) end)
uci:delete_all("firewall", "forwarding",
function(s) return (
s.src == wifi_device and s.dest == "siit0" or
s.dest == wifi_device and s.src == "siit0" or
s.src == "lan" and s.dest == "siit0" or
s.dest == "lan" and s.src == "siit0"
) end)
uci:section("firewall", "zone", "siit0", {
name = "siit0",
network = "siit0",
input = "ACCEPT",
output = "ACCEPT",
forward = "ACCEPT"
})
uci:section("firewall", "zone", wifi_device, {
name = wifi_device,
network = wifi_device,
input = "ACCEPT",
output = "ACCEPT",
forward = "ACCEPT"
})
uci:section("firewall", "forwarding", nil, {
src = wifi_device,
dest = "siit0"
})
uci:section("firewall", "forwarding", nil, {
src = "siit0",
dest = wifi_device
})
uci:section("firewall", "forwarding", nil, {
src = "lan",
dest = "siit0"
})
uci:section("firewall", "forwarding", nil, {
src = "siit0",
dest = "lan"
})
-- firewall include
uci:delete_all("firewall", "include",
function(s) return s.path == "/etc/firewall.user" end)
uci:section("firewall", "include", nil, {
path = "/etc/firewall.user"
})
-- siit0 interface
uci:delete_all("network", "interface",
function(s) return ( s.ifname == "siit0" ) end)
uci:section("network", "interface", "siit0", {
ifname = "siit0",
proto = "none"
})
-- siit0 route
uci:delete_all("network", "route6",
function(s) return siit_route:contains(luci.ip.IPv6(s.target)) end)
uci:section("network", "route6", nil, {
interface = "siit0",
target = siit_route:string()
})
-- create wifi network interface
uci:section("network", "interface", wifi_device, {
proto = "static",
mtu = 1400,
ip6addr = ula:string()
})
-- nuke old olsrd interfaces
uci:delete_all("olsrd", "Interface",
function(s) return s.interface == wifi_device end)
-- configure olsrd interface
uci:foreach("olsrd", "olsrd",
function(s) uci:set("olsrd", s['.name'], "IpVersion", 6) end)
uci:section("olsrd", "Interface", nil, {
ignore = 0,
interface = wifi_device,
Ip6AddrType = "global"
})
-- hna6
uci:delete_all("olsrd", "Hna6",
function(s)
if s.netaddr and s.prefix then
return siit_route:contains(luci.ip.IPv6(s.netaddr.."/"..s.prefix))
end
end)
uci:section("olsrd", "Hna6", nil, {
netaddr = siit_route:host():string(),
prefix = siit_route:prefix()
})
-- txtinfo v6
uci:foreach("olsrd", "LoadPlugin",
function(s)
if s.library == "olsrd_txtinfo.so.0.1" then
uci:set("olsrd", s['.name'], "accept", "::1")
end
end)
uci:save("wireless")
uci:save("firewall")
uci:save("network")
uci:save("olsrd")
end
return f

View File

@@ -0,0 +1,10 @@
config siit ipv6
option ula_prefix "fd00::"
option ula_global "00ca:ffee:babe::"
option ula_subnet "0000:0000:0000:dada::"
option siit_prefix "::ffff:0000:0000"
config siit wifi
option essid "6mesh.freifunk.net"
option bssid "02:ca:ff:ee:ba:be"
option channel "1"

62
contrib/axtls/Makefile Normal file
View File

@@ -0,0 +1,62 @@
#
# Copyright (C) 2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=axtls
PKG_VERSION:=1.2.0
PKG_RELEASE:=2
PKG_BUILD_DIR=$(BUILD_DIR)/axTLS
PKG_SOURCE:=axTLS-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/axtls
PKG_MD5SUM:=af805c76c0da1dbfc0c5e6b8dbd6706a
include $(INCLUDE_DIR)/package.mk
# set to 1 to enable debugging
DEBUG=
define Package/libaxtls
SECTION:=libs
CATEGORY:=Libraries
TITLE:=axTLS embedded SSL library
endef
define Package/axhttpd
SUBMENU:=Web
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libaxtls
TITLE:=axTLS embedded http/https server
endef
define Build/Configure
$(INSTALL_DIR) $(PKG_BUILD_DIR)/config
$(CP) ./files/axtls-config $(PKG_BUILD_DIR)/config/.config
$(CP) ./files/axtls-config.h $(PKG_BUILD_DIR)/config/config.h
endef
TARGET_CFLAGS += $(FPIC)
#define Build/Compile
# $(MAKE) -C $(PKG_BUILD_DIR)
#endef
define Package/libaxtls/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/_stage/libaxtls.so* $(1)/usr/lib/
endef
define Package/axhttpd/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_stage/axhttpd $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,libaxtls))
$(eval $(call BuildPackage,axhttpd))

View File

@@ -0,0 +1,116 @@
#
# Automatically generated make config: don't edit
#
HAVE_DOT_CONFIG=y
CONFIG_PLATFORM_LINUX=y
# CONFIG_PLATFORM_CYGWIN is not set
# CONFIG_PLATFORM_WIN32 is not set
#
# General Configuration
#
PREFIX="/usr/local"
# CONFIG_DEBUG is not set
# CONFIG_STRIP_UNWANTED_SECTIONS is not set
# CONFIG_VISUAL_STUDIO_7_0 is not set
# CONFIG_VISUAL_STUDIO_8_0 is not set
CONFIG_VISUAL_STUDIO_7_0_BASE=""
CONFIG_VISUAL_STUDIO_8_0_BASE=""
CONFIG_EXTRA_CFLAGS_OPTIONS="-fPIC"
CONFIG_EXTRA_LDFLAGS_OPTIONS="-lc -lm"
#
# SSL Library
#
# CONFIG_SSL_SERVER_ONLY is not set
# CONFIG_SSL_CERT_VERIFICATION is not set
# CONFIG_SSL_ENABLE_CLIENT is not set
# CONFIG_SSL_FULL_MODE is not set
CONFIG_SSL_SKELETON_MODE=y
# CONFIG_SSL_PROT_LOW is not set
# CONFIG_SSL_PROT_MEDIUM is not set
# CONFIG_SSL_PROT_HIGH is not set
# CONFIG_SSL_USE_DEFAULT_KEY is not set
CONFIG_SSL_PRIVATE_KEY_LOCATION=""
CONFIG_SSL_PRIVATE_KEY_PASSWORD=""
CONFIG_SSL_X509_CERT_LOCATION=""
# CONFIG_SSL_GENERATE_X509_CERT is not set
CONFIG_SSL_X509_COMMON_NAME=""
CONFIG_SSL_X509_ORGANIZATION_NAME=""
CONFIG_SSL_X509_ORGANIZATION_UNIT_NAME=""
CONFIG_SSL_ENABLE_V23_HANDSHAKE=y
# CONFIG_SSL_HAS_PEM is not set
# CONFIG_SSL_USE_PKCS12 is not set
CONFIG_SSL_EXPIRY_TIME=0
CONFIG_X509_MAX_CA_CERTS=0
CONFIG_SSL_MAX_CERTS=2
# CONFIG_SSL_CTX_MUTEXING is not set
CONFIG_USE_DEV_URANDOM=y
# CONFIG_WIN32_USE_CRYPTO_LIB is not set
# CONFIG_OPENSSL_COMPATIBLE is not set
# CONFIG_PERFORMANCE_TESTING is not set
# CONFIG_SSL_TEST is not set
CONFIG_AXHTTPD=y
#
# Axhttpd Configuration
#
# CONFIG_HTTP_STATIC_BUILD is not set
CONFIG_HTTP_PORT=80
CONFIG_HTTP_HTTPS_PORT=443
CONFIG_HTTP_SESSION_CACHE_SIZE=5
CONFIG_HTTP_WEBROOT="/www"
CONFIG_HTTP_TIMEOUT=300
#
# CGI
#
CONFIG_HTTP_HAS_CGI=y
CONFIG_HTTP_CGI_EXTENSIONS="luci"
# CONFIG_HTTP_ENABLE_LUA is not set
CONFIG_HTTP_LUA_PREFIX=""
CONFIG_HTTP_LUA_CGI_LAUNCHER=""
# CONFIG_HTTP_BUILD_LUA is not set
CONFIG_HTTP_DIRECTORIES=y
# CONFIG_HTTP_HAS_AUTHORIZATION is not set
# CONFIG_HTTP_HAS_IPV6 is not set
# CONFIG_HTTP_ENABLE_DIFFERENT_USER is not set
CONFIG_HTTP_USER=""
# CONFIG_HTTP_VERBOSE is not set
CONFIG_HTTP_IS_DAEMON=y
#
# Language Bindings
#
# CONFIG_BINDINGS is not set
# CONFIG_CSHARP_BINDINGS is not set
# CONFIG_VBNET_BINDINGS is not set
CONFIG_DOT_NET_FRAMEWORK_BASE=""
# CONFIG_JAVA_BINDINGS is not set
CONFIG_JAVA_HOME=""
# CONFIG_PERL_BINDINGS is not set
CONFIG_PERL_CORE=""
CONFIG_PERL_LIB=""
# CONFIG_LUA_BINDINGS is not set
CONFIG_LUA_CORE=""
#
# Samples
#
# CONFIG_SAMPLES is not set
# CONFIG_C_SAMPLES is not set
# CONFIG_CSHARP_SAMPLES is not set
# CONFIG_VBNET_SAMPLES is not set
# CONFIG_JAVA_SAMPLES is not set
# CONFIG_PERL_SAMPLES is not set
# CONFIG_LUA_SAMPLES is not set
# CONFIG_BIGINT_CLASSICAL is not set
# CONFIG_BIGINT_MONTGOMERY is not set
# CONFIG_BIGINT_BARRETT is not set
# CONFIG_BIGINT_CRT is not set
# CONFIG_BIGINT_KARATSUBA is not set
MUL_KARATSUBA_THRESH=0
SQU_KARATSUBA_THRESH=0
# CONFIG_BIGINT_SLIDING_WINDOW is not set
# CONFIG_BIGINT_SQUARE is not set
# CONFIG_BIGINT_CHECK_ON is not set

View File

@@ -0,0 +1,117 @@
/*
* Automatically generated header file: don't edit
*/
#define HAVE_DOT_CONFIG 1
#define CONFIG_PLATFORM_LINUX 1
#undef CONFIG_PLATFORM_CYGWIN
#undef CONFIG_PLATFORM_WIN32
/*
* General Configuration
*/
#define PREFIX "/usr/local"
#undef CONFIG_DEBUG
#undef CONFIG_STRIP_UNWANTED_SECTIONS
#undef CONFIG_VISUAL_STUDIO_7_0
#undef CONFIG_VISUAL_STUDIO_8_0
#define CONFIG_VISUAL_STUDIO_7_0_BASE ""
#define CONFIG_VISUAL_STUDIO_8_0_BASE ""
#define CONFIG_EXTRA_CFLAGS_OPTIONS "-fPIC"
#define CONFIG_EXTRA_LDFLAGS_OPTIONS "-lc -lm"
/*
* SSL Library
*/
#undef CONFIG_SSL_SERVER_ONLY
#undef CONFIG_SSL_CERT_VERIFICATION
#undef CONFIG_SSL_ENABLE_CLIENT
#undef CONFIG_SSL_FULL_MODE
#define CONFIG_SSL_SKELETON_MODE 1
#undef CONFIG_SSL_PROT_LOW
#undef CONFIG_SSL_PROT_MEDIUM
#undef CONFIG_SSL_PROT_HIGH
#undef CONFIG_SSL_USE_DEFAULT_KEY
#define CONFIG_SSL_PRIVATE_KEY_LOCATION ""
#define CONFIG_SSL_PRIVATE_KEY_PASSWORD ""
#define CONFIG_SSL_X509_CERT_LOCATION ""
#undef CONFIG_SSL_GENERATE_X509_CERT
#define CONFIG_SSL_X509_COMMON_NAME ""
#define CONFIG_SSL_X509_ORGANIZATION_NAME ""
#define CONFIG_SSL_X509_ORGANIZATION_UNIT_NAME ""
#define CONFIG_SSL_ENABLE_V23_HANDSHAKE 1
#undef CONFIG_SSL_HAS_PEM
#undef CONFIG_SSL_USE_PKCS12
#define CONFIG_SSL_EXPIRY_TIME
#define CONFIG_X509_MAX_CA_CERTS
#define CONFIG_SSL_MAX_CERTS 2
#undef CONFIG_SSL_CTX_MUTEXING
#define CONFIG_USE_DEV_URANDOM 1
#undef CONFIG_WIN32_USE_CRYPTO_LIB
#undef CONFIG_OPENSSL_COMPATIBLE
#undef CONFIG_PERFORMANCE_TESTING
#undef CONFIG_SSL_TEST
#define CONFIG_AXHTTPD 1
/*
* Axhttpd Configuration
*/
#undef CONFIG_HTTP_STATIC_BUILD
#define CONFIG_HTTP_PORT 80
#define CONFIG_HTTP_HTTPS_PORT 443
#define CONFIG_HTTP_SESSION_CACHE_SIZE 5
#define CONFIG_HTTP_WEBROOT "/www"
#define CONFIG_HTTP_TIMEOUT 300
/*
* CGI
*/
#define CONFIG_HTTP_HAS_CGI 1
#define CONFIG_HTTP_CGI_EXTENSIONS "luci"
#undef CONFIG_HTTP_ENABLE_LUA
#define CONFIG_HTTP_LUA_PREFIX ""
#define CONFIG_HTTP_LUA_CGI_LAUNCHER ""
#undef CONFIG_HTTP_BUILD_LUA
#define CONFIG_HTTP_DIRECTORIES 1
#undef CONFIG_HTTP_HAS_AUTHORIZATION
#undef CONFIG_HTTP_HAS_IPV6
#undef CONFIG_HTTP_ENABLE_DIFFERENT_USER
#define CONFIG_HTTP_USER ""
#undef CONFIG_HTTP_VERBOSE
#define CONFIG_HTTP_IS_DAEMON 1
/*
* Language Bindings
*/
#undef CONFIG_BINDINGS
#undef CONFIG_CSHARP_BINDINGS
#undef CONFIG_VBNET_BINDINGS
#define CONFIG_DOT_NET_FRAMEWORK_BASE ""
#undef CONFIG_JAVA_BINDINGS
#define CONFIG_JAVA_HOME ""
#undef CONFIG_PERL_BINDINGS
#define CONFIG_PERL_CORE ""
#define CONFIG_PERL_LIB ""
#undef CONFIG_LUA_BINDINGS
#define CONFIG_LUA_CORE ""
/*
* Samples
*/
#undef CONFIG_SAMPLES
#undef CONFIG_C_SAMPLES
#undef CONFIG_CSHARP_SAMPLES
#undef CONFIG_VBNET_SAMPLES
#undef CONFIG_JAVA_SAMPLES
#undef CONFIG_PERL_SAMPLES
#undef CONFIG_LUA_SAMPLES
#undef CONFIG_BIGINT_CLASSICAL
#undef CONFIG_BIGINT_MONTGOMERY
#undef CONFIG_BIGINT_BARRETT
#undef CONFIG_BIGINT_CRT
#undef CONFIG_BIGINT_KARATSUBA
#define MUL_KARATSUBA_THRESH
#define SQU_KARATSUBA_THRESH
#undef CONFIG_BIGINT_SLIDING_WINDOW
#undef CONFIG_BIGINT_SQUARE
#undef CONFIG_BIGINT_CHECK_ON

View File

@@ -0,0 +1,12 @@
diff -urb axTLS.orig/ssl/Makefile axTLS/ssl/Makefile
--- axTLS.orig/ssl/Makefile 2008-11-09 00:58:43.000000000 +0000
+++ axTLS/ssl/Makefile 2008-11-09 00:58:57.000000000 +0000
@@ -96,7 +96,7 @@
$(TARGET2) : $(OBJ)
ifndef CONFIG_PLATFORM_CYGWIN
- $(LD) $(LDFLAGS) $(LDSHARED) -Wl,-soname,$(LIBMAJOR) -o $(AXTLS_HOME)/$(STAGE)/$(LIBMINOR) $(CRYPTO_OBJ) $(OBJ)
+ $(LD) $(LDFLAGS) $(LDSHARED) -o $(AXTLS_HOME)/$(STAGE)/$(LIBMINOR) $(CRYPTO_OBJ) $(OBJ)
cd $(AXTLS_HOME)/$(STAGE); ln -sf $(LIBMINOR) $(LIBMAJOR); ln -sf $(LIBMAJOR) $(BASETARGET); cd -
else
$(LD) $(LDFLAGS) $(LDSHARED) -o $(AXTLS_HOME)/$(STAGE)/cygaxtls.dll \

View File

@@ -0,0 +1,12 @@
diff -urb axTLS.orig/httpd/Makefile axTLS/httpd/Makefile
--- axTLS.orig/httpd/Makefile 2008-11-09 00:58:44.000000000 +0000
+++ axTLS/httpd/Makefile 2008-11-09 01:29:55.000000000 +0000
@@ -95,7 +95,7 @@
ifndef CONFIG_PLATFORM_WIN32
$(TARGET): $(OBJ) $(AXTLS_HOME)/$(STAGE)/libaxtls.a
- $(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+ $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
ifdef CONFIG_STRIP_UNWANTED_SECTIONS
strip --remove-section=.comment $(TARGET)
endif

View File

@@ -0,0 +1,37 @@
diff -urb axTLS.orig/httpd/axhttp.h axTLS/httpd/axhttp.h
--- axTLS.orig/httpd/axhttp.h 2008-11-09 00:58:44.000000000 +0000
+++ axTLS/httpd/axhttp.h 2008-11-09 02:33:44.000000000 +0000
@@ -91,6 +91,7 @@
uint8_t is_lua;
#endif
int content_length;
+ char content_type[MAXREQUESTLENGTH];
char remote_addr[MAXREQUESTLENGTH];
char uri_request[MAXREQUESTLENGTH];
char uri_path_info[MAXREQUESTLENGTH];
diff -urb axTLS.orig/httpd/proc.c axTLS/httpd/proc.c
--- axTLS.orig/httpd/proc.c 2008-11-09 00:58:44.000000000 +0000
+++ axTLS/httpd/proc.c 2008-11-09 02:43:32.000000000 +0000
@@ -129,6 +129,10 @@
my_strncpy(cn->server_name, value, MAXREQUESTLENGTH);
}
+ else if (strcmp(buf, "Content-Type:") == 0 )
+ {
+ my_strncpy(cn->content_type, value, MAXREQUESTLENGTH);
+ }
else if (strcmp(buf, "Connection:") == 0 && strcmp(value, "close") == 0)
{
cn->close_when_done = 1;
@@ -673,8 +677,9 @@
type = "POST";
sprintf(cgienv[cgi_index++],
"CONTENT_LENGTH=%d", cn->content_length);
- strcpy(cgienv[cgi_index++], /* hard-code? */
- "CONTENT_TYPE=application/x-www-form-urlencoded");
+ snprintf(cgienv[cgi_index++], MAXREQUESTLENGTH,
+ "CONTENT_TYPE=%s", cn->content_type);
+
break;
}

View File

@@ -0,0 +1,20 @@
--- axTLS/httpd/proc.c 2008-11-13 14:05:02.000000000 +0100
+++ axTLS.new/httpd/proc.c 2008-11-13 16:07:12.000000000 +0100
@@ -556,13 +556,13 @@
int tmp_stdout;
#endif
- snprintf(cgienv[0], MAXREQUESTLENGTH,
+ if (cn->reqtype == TYPE_HEAD)
+ {
+ snprintf(cgienv[0], MAXREQUESTLENGTH,
HTTP_VERSION" 200 OK\nServer: %s\n%s",
server_version, (cn->reqtype == TYPE_HEAD) ? "\n" : "");
- special_write(cn, cgienv[0], strlen(cgienv[0]));
+ special_write(cn, cgienv[0], strlen(cgienv[0]));
- if (cn->reqtype == TYPE_HEAD)
- {
removeconnection(cn);
return;
}

View File

@@ -0,0 +1,59 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=xrelayd
PKG_VERSION:=0.2.1pre2
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://znerol.ch/files
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MD5SUM:=05f242295fa864bb3b0b7f0712b4dfa3
PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
PKG_BUILD_DEPENDS:=libxyssl
include $(INCLUDE_DIR)/package.mk
define Package/xrelayd
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libxyssl
TITLE:=stunnel replacement based on xyssl
URL:=http://znerol.ch/
endef
define Package/xrelayd/description
stunnel replacement based on xyssl
endef
define Build/Configure
endef
define Build/Compile
rm -rf $(PKG_INSTALL_DIR)
mkdir -p $(PKG_INSTALL_DIR)
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
CC="$(TARGET_CC)" \
LD="$(TARGET_CC)" \
CFLAGS="$(strip $(TARGET_CFLAGS))" \
CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include" \
LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
prefix="$(PKG_INSTALL_DIR)/usr"
mkdir -p $(PKG_INSTALL_DIR)/usr/bin
$(CP) $(PKG_BUILD_DIR)/xrelayd $(PKG_INSTALL_DIR)/usr/bin
endef
define Package/xrelayd/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xrelayd $(1)/usr/bin
$(RSTRIP) $(1)/usr/bin/xrelayd
endef
#mostlyclean:
# make -C $(PKG_BUILD_DIR) clean
# rm $(PKG_BUILD_DIR)/.built
$(eval $(call BuildPackage,xrelayd))

View File

@@ -2,9 +2,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="0; URL=/luci/olsr" />
<meta http-equiv="refresh" content="0; URL=/luci" />
</head>
<body style="background-color: black">
<a style="color: white; text-decoration: none" href="/luci/olsr">LuCI - Lua Configuration Interface</a>
<a style="color: white; text-decoration: none" href="/luci">LuCI - Lua Configuration Interface</a>
</body>
</html>

18
libs/lucittpd/Makefile Normal file
View File

@@ -0,0 +1,18 @@
ifeq ($(CFLAGS),)
MYLDFLAGS ?= -L../../../contrib/uci/dist/usr/lib/
endif
include ../../build/module.mk
include ../../build/config.mk
include ../../build/gccconfig.mk
compile:
make -Csrc \
CFLAGS="$(CFLAGS) $(FPIC) $(LUA_CFLAGS) $(EXTRA_CFLAGS) $(WFLAGS)" \
LDFLAGS="$(LDFLAGS) $(LUA_SHLIBS) -luci" \
MYLDFLAGS="$(MYLDFLAGS)"
mkdir -p dist/usr/bin
cp src/lucittpd dist/usr/bin
clean: luaclean
make -Csrc clean

View File

@@ -0,0 +1,34 @@
function initialize()
local lucittpd = require "luci.ttpd.server"
server = lucittpd.Server(lucittpd.VHost())
end
function register()
local filehnd = require "luci.ttpd.handler.file"
local filehandler = filehnd.Simple(os.getenv("LUCI_SYSROOT") .. "/www")
server:get_default_vhost():set_default_handler(filehandler)
end
function accept()
server:process({
_read = function(...)
local chunk, err = webuci_read(...)
return chunk or (err and error(err, 0))
end,
_write = function(...)
local chunk, err = webuci_write(...)
return chunk or (err and error(err, 0))
end,
_close = function(...)
local chunk, err = webuci_close(...)
return chunk or (err and error(err, 0))
end,
_sendfile = function(...)
local chunk, err = webuci_sendfile(...)
return chunk or (err and error(err, 0))
end
})
end

6
libs/lucittpd/ipkg/postinst Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
[ -n "${IPKG_INSTROOT}" ] || {
/etc/init.d/lucittpd enabled || /etc/init.d/lucittpd enable
/etc/init.d/lucittpd start || true
}

View File

@@ -0,0 +1,252 @@
--[[
HTTP server implementation for LuCI - file handler
(c) 2008 Steven Barth <steven@midlink.org>
(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
local ipairs, type, tonumber = ipairs, type, tonumber
local io = require "io"
local os = require "os"
local fs = require "luci.fs"
local util = require "luci.util"
local ltn12 = require "luci.ltn12"
local mod = require "luci.ttpd.module"
local srv = require "luci.ttpd.server"
local string = require "string"
local prot = require "luci.http.protocol"
local date = require "luci.http.protocol.date"
local mime = require "luci.http.protocol.mime"
local cond = require "luci.http.protocol.conditionals"
module "luci.ttpd.handler.file"
Simple = util.class(mod.Handler)
Response = mod.Response
function Simple.__init__(self, docroot, dirlist)
mod.Handler.__init__(self)
self.docroot = docroot
self.dirlist = dirlist and true or false
end
function Simple.parse_range(self, request, size)
if not request.headers.Range then
return true
end
local from, to = request.headers.Range:match("bytes=([0-9]*)-([0-9]*)")
if not (from or to) then
return true
end
from, to = tonumber(from), tonumber(to)
if not (from or to) then
return true
elseif not from then
from, to = size - to, size - 1
elseif not to then
to = size - 1
end
-- Not satisfiable
if from >= size then
return false
end
-- Normalize
if to >= size then
to = size - 1
end
local range = "bytes " .. from .. "-" .. to .. "/" .. size
return from, (1 + to - from), range
end
function Simple.getfile(self, uri)
local file = self.docroot .. uri:gsub("%.%./+", "")
local stat = fs.stat(file)
return file, stat
end
function Simple.handle_get(self, request, sourcein, sinkerr)
local file, stat = self:getfile( prot.urldecode( request.env.PATH_INFO, true ) )
if stat then
if stat.type == "regular" then
-- Generate Entity Tag
local etag = cond.mk_etag( stat )
-- Check conditionals
local ok, code, hdrs
ok, code, hdrs = cond.if_modified_since( request, stat )
if ok then
ok, code, hdrs = cond.if_match( request, stat )
if ok then
ok, code, hdrs = cond.if_unmodified_since( request, stat )
if ok then
ok, code, hdrs = cond.if_none_match( request, stat )
if ok then
local f, err = io.open(file)
if f then
local code = 200
local o, s, r = self:parse_range(request, stat.size)
if not o then
return self:failure(416, "Invalid Range")
end
local headers = {
["Last-Modified"] = date.to_http( stat.mtime ),
["Content-Type"] = mime.to_mime( file ),
["ETag"] = etag,
["Accept-Ranges"] = "bytes",
}
if o == true then
o = 0
s = stat.size
else
code = 206
headers["Content-Range"] = r
end
headers["Content-Length"] = s
-- Send Response
return Response(code, headers),
srv.IOResource(f, o, s)
else
return self:failure( 403, err:gsub("^.+: ", "") )
end
else
return Response( code, hdrs or { } )
end
else
return Response( code, hdrs or { } )
end
else
return Response( code, hdrs or { } )
end
else
return Response( code, hdrs or { } )
end
elseif stat.type == "directory" then
local ruri = request.request_uri:gsub("/$","")
local duri = prot.urldecode( ruri, true )
local root = self.docroot:gsub("/$","")
-- check for index files
local index_candidates = {
"index.html", "index.htm", "default.html", "default.htm",
"index.txt", "default.txt"
}
-- try to find an index file and redirect to it
for i, candidate in ipairs( index_candidates ) do
local istat = fs.stat(
root .. "/" .. duri .. "/" .. candidate
)
if istat ~= nil and istat.type == "regular" then
return Response( 302, {
["Location"] = ruri .. "/" .. candidate
} )
end
end
local html = string.format(
'<?xml version="1.0" encoding="ISO-8859-15"?>\n' ..
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ' ..
'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n' ..
'<html xmlns="http://www.w3.org/1999/xhtml" ' ..
'xml:lang="en" lang="en">\n' ..
'<head>\n' ..
'<title>Index of %s/</title>\n' ..
'<style type="text/css"><!--\n' ..
'body { background-color:#fbb034; color:#ffffff } ' ..
'li { border-bottom:1px dotted #CCCCCC; padding:3px } ' ..
'small { font-size:60%%; color:#ffffff } ' ..
'p { margin:0 }' ..
'\n--></style></head><body><h1>Index of %s/</h1><hr /><ul>',
duri, duri
)
local entries = fs.dir( file )
if type(entries) == "table" then
for i, e in util.spairs(
entries, function(a,b)
if entries[a] == '..' then
return true
elseif entries[b] == '..' then
return false
else
return ( entries[a] < entries[b] )
end
end
) do
if e ~= '.' and ( e == '..' or e:sub(1,1) ~= '.' ) then
local estat = fs.stat( file .. "/" .. e )
if estat.type == "directory" then
html = html .. string.format(
'<li><p><a href="%s/%s/">%s/</a> ' ..
'<small>(directory)</small><br />' ..
'<small>Changed: %s</small></li>',
ruri, prot.urlencode( e ), e,
date.to_http( estat.mtime )
)
else
html = html .. string.format(
'<li><p><a href="%s/%s">%s</a> ' ..
'<small>(%s)</small><br />' ..
'<small>Size: %i Bytes | ' ..
'Changed: %s</small></li>',
ruri, prot.urlencode( e ), e,
mime.to_mime( e ),
estat.size, date.to_http( estat.mtime )
)
end
end
end
html = html .. '</ul><hr /></body></html>'
return Response(
200, {
["Date"] = date.to_http( os.time() );
["Content-Type"] = "text/html; charset=ISO-8859-15";
}
), ltn12.source.string(html)
else
return self:failure(403, "Permission denied")
end
else
return self:failure(403, "Unable to transmit " .. stat.type .. " " .. file)
end
else
return self:failure(404, "No such file: " .. file)
end
end
function Simple.handle_head(self, ...)
return (self:handle_get(...))
end

View File

@@ -0,0 +1,121 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
local pcall, ipairs, tonumber, type, next = pcall, ipairs, tonumber, type, next
local util = require "luci.util"
local http = require "luci.http.protocol"
local ltn12 = require "luci.ltn12"
local table = require "table"
module "luci.ttpd.module"
-- Server handler implementation
Handler = util.class()
-- Constructor
function Handler.__init__(self)
self.handler = {}
self.filters = {}
self.modifiers = {}
end
-- Add a filter
function Handler.setfilter(self, filter, key)
self.filters[(key) or (#self.filters+1)] = filter
end
-- Add a modifier
function Handler.setmodifier(self, modifier, key)
self.modifiers[(pos) or (#self.modifiers+1)] = modifier
end
-- Creates a failure reply
function Handler.failure(self, code, message)
local response = Response(code, { ["Content-Type"] = "text/plain" })
local sourceout = ltn12.source.string(message)
return response, sourceout
end
-- Processes a request
function Handler.process(self, request, sourcein, sinkerr)
local stat, response, sourceout
-- Detect request Method
local hname = "handle_" .. request.request_method
if self[hname] then
local t = {
processor = self[hname],
handler = self,
request = request,
sourcein = sourcein,
sinkerr = sinkerr
}
if next(self.modifiers) then
for _, mod in util.kspairs(self.modifiers) do
mod(t)
end
end
-- Run the handler
stat, response, sourceout = pcall(
t.processor, t.handler, t.request, t.sourcein, t.sinkerr
)
-- Check for any errors
if not stat then
response, sourceout = self:failure(500, response)
elseif next(self.filters) then
local t = {
response = response,
sourceout = sourceout,
sinkerr = t.sinkerr
}
for _, filter in util.kspairs(self.filters) do
filter(t)
end
response = t.response
sourceout = t.sourceout
end
else
response, sourceout = self:failure(405, http.protocol.statusmsg[405])
end
-- Check data
if not util.instanceof(response, Response) then
response, sourceout = self:failure(500, "Core error: Invalid module response!")
end
return response, sourceout
end
-- Handler Response
Response = util.class()
function Response.__init__(self, status, headers)
self.status = tonumber(status) or 200
self.headers = (type(headers) == "table") and headers or {}
end
function Response.addheader(self, key, value)
self.headers[key] = value
end
function Response.setstatus(self, status)
self.status = status
end

View File

@@ -0,0 +1,444 @@
--[[
LuCIttpd
(c) 2008 Steven Barth <steven@midlink.org>
(c) 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
local ipairs, pairs = ipairs, pairs
local tostring, tonumber = tostring, tonumber
local pcall, assert = pcall, assert
local os = require "os"
local io = require "io"
local uci = require "luci.model.uci"
local util = require "luci.util"
local ltn12 = require "luci.ltn12"
local proto = require "luci.http.protocol"
local string = require "string"
local date = require "luci.http.protocol.date"
module "luci.ttpd.server"
BUFSIZE = 4096
VERSION = 0.91
-- File Resource
IOResource = util.class()
function IOResource.__init__(self, fd, offset, len)
self.fd, self.offset, self.len = fd, offset, len
end
VHost = util.class()
function VHost.__init__(self, handler)
self.handler = handler
self.dhandler = {}
end
function VHost.process(self, request, sourcein, sinkerr, ...)
local handler = self.handler
local uri = request.env.REQUEST_URI:match("^([^?]*)")
-- SCRIPT_NAME
request.env.SCRIPT_NAME = ""
-- Call URI part
request.env.PATH_INFO = uri
for k, dhandler in pairs(self.dhandler) do
if k == uri or k.."/" == uri:sub(1, #k+1) then
handler = dhandler
request.env.SCRIPT_NAME = k
request.env.PATH_INFO = uri:sub(#k+1)
break;
end
end
if handler then
return handler:process(request, sourcein, sinkerr, ...)
end
end
function VHost.get_default_handler(self)
return self.handler
end
function VHost.set_default_handler(self, handler)
self.handler = handler
end
function VHost.get_handlers(self)
return self.dhandler
end
function VHost.set_handler(self, match, handler)
self.dhandler[match] = handler
end
Server = util.class()
function Server.__init__(self, host)
self.uci = uci.cursor()
self.host = host
self.vhosts = {}
self.rbuf = ""
self.wbuf = ""
end
function Server.get_default_vhost(self)
return self.host
end
function Server.set_default_vhost(self, vhost)
self.host = vhost
end
function Server.get_vhosts(self)
return self.vhosts
end
function Server.set_vhost(self, name, vhost)
self.vhosts[name] = vhost
end
function Server.flush(self)
if #self.wbuf > 0 then
self._write(self.wbuf)
self.wbuf = ""
end
end
function Server.read(self, len)
while #self.rbuf < len do
self.rbuf = self.rbuf .. self._read(len - #self.rbuf)
end
local chunk = self.rbuf:sub(1, len)
self.rbuf = self.rbuf:sub(len + 1)
return chunk
end
function Server.limitsource(self, limit)
limit = limit or 0
return function()
if limit < 1 then
return nil
else
local read = (limit > BUFSIZE) and BUFSIZE or limit
limit = limit - read
return self:read(read)
end
end
end
-- Adapted from Luaposix
function Server.receiveheaders(self)
local line, name, value, err
local headers = {}
-- get first line
line, err = self:readline()
if err then return nil, err end
-- headers go until a blank line is found
while line do
-- get field-name and value
_, _, name, value = line:find("^(.-):%s*(.*)")
if not (name and value) then return nil, "malformed reponse headers" end
name = name:lower()
-- get next line (value might be folded)
line, err = self:readline()
if err then return nil, err end
-- unfold any folded values
while line:find("^%s") do
value = value .. line
line = self:readline()
if err then return nil, err end
end
-- save pair in table
if headers[name] then headers[name] = headers[name] .. ", " .. value
else headers[name] = value end
end
return headers
end
function Server.readchunk(self)
-- get chunk size, skip extention
local line, err = self:readline()
if err then return nil, err end
local size = tonumber(line:gsub(";.*", ""), 16)
if not size then return nil, "invalid chunk size" end
-- was it the last chunk?
if size > 0 then
-- if not, get chunk and skip terminating CRLF
local chunk, err, part = self:read(size)
if chunk then self:readline() end
return chunk, err
else
-- if it was, read trailers into headers table
headers, err = self:receiveheaders()
if not headers then return nil, err end
end
end
function Server.readline(self)
if #self.rbuf < 1 then
self.rbuf = self._read(BUFSIZE)
end
while true do
local le = self.rbuf:find("\r\n", nil, true)
if le then
if le == 1 then -- EoH
self.rbuf = self.rbuf:sub(le + 2)
return nil
else -- Header
local line = self.rbuf:sub(1, le - 1)
self.rbuf = self.rbuf:sub(le + 2)
return line
end
else
if #self.rbuf >= BUFSIZE then
return nil, "Invalid Request"
end
self.rbuf = self.rbuf .. self._read(BUFSIZE-#self.rbuf)
end
end
end
function Server.sink(self)
return function(chunk, err)
if err then
return nil, err
elseif chunk then
local stat, err = pcall(self.write, self, chunk)
if stat then
return stat
else
return nil, err
end
else
return true
end
end
end
function Server.chunksink(self)
return function(chunk, err)
local stat, err = pcall(self.writechunk, self, chunk)
if stat then
return stat
else
return nil, err
end
end
end
function Server.writechunk(self, chunk, err)
self:flush()
if not chunk then return self._write("0\r\n\r\n") end
local size = string.format("%X\r\n", #chunk)
return self._write(size .. chunk .. "\r\n")
end
function Server.write(self, chunk)
while #chunk > 0 do
local missing = BUFSIZE - #self.wbuf
self.wbuf = self.wbuf .. chunk:sub(1, missing)
chunk = chunk:sub(missing + 1)
if #self.wbuf == BUFSIZE then
assert(self._write(self.wbuf))
self.wbuf = ""
end
end
end
function Server.close(self)
self:flush()
self._close()
end
function Server.sendfile(self, fd, offset, len)
self:flush()
self._sendfile(fd, offset, len)
end
function Server.error(self, code, msg)
hcode = tostring(code)
self:write( "HTTP/1.0 " .. hcode .. " " ..
proto.statusmsg[code] .. "\r\n" )
self:write( "Connection: close\r\n" )
self:write( "Content-Type: text/plain\r\n\r\n" )
if msg then
self:write( "HTTP-Error " .. code .. ": " .. msg .. "\r\n" )
end
end
function Server.process(self, functions)
util.update(self, functions)
local sourcein = ltn12.source.empty()
local sourcehdr = function() return self:readline() or "" end
local sinkerr = ltn12.sink.file( io.stderr )
local sinkout = self:sink()
local close = false
local stat, message, err
repeat
-- parse headers
stat, message, err = pcall(proto.parse_message_header, sourcehdr)
-- remote socket closed
if not stat and message == 0 then
break
end
-- remote timeout
if not stat and message == 11 then
--self:error(408)
break
end
-- any other error
if not stat or not message then
self:error(400, err)
break
end
-- keep-alive
if message.http_version == 1.1 then
close = (message.env.HTTP_CONNECTION == "close")
else
close = not message.env.HTTP_CONNECTION or message.env.HTTP_CONNECTION == "close"
end
-- Uncomment this to disable keep-alive
close = not (self.uci:get("lucittpd", "lucittpd", "keepalive") == "1")
if message.request_method == "get" or message.request_method == "head" then
-- Be happy
elseif message.request_method == "post" then
-- If we have a HTTP/1.1 client and an Expect: 100-continue header then
-- respond with HTTP 100 Continue message
if message.http_version == 1.1 and message.headers['Expect'] and
message.headers['Expect'] == '100-continue'
then
self:write("HTTP/1.1 100 Continue\r\n\r\n")
end
if message.headers['Transfer-Encoding'] and
message.headers['Transfer-Encoding'] ~= "identity" then
sourcein = function() return self:readchunk() end
elseif message.env.CONTENT_LENGTH then
sourcein = self:limitsource(
tonumber(message.env.CONTENT_LENGTH)
)
else
self:error( 411, proto.statusmsg[411] )
break
end
else
self:error( 405, proto.statusmsg[405] )
break
end
local host = self.vhosts[message.env.HTTP_HOST] or self.host
if not host then
self:error( 500, "Unable to find matching host" )
break;
end
local response, sourceout = host:process(
message, sourcein, sinkerr,
client, io.stderr
)
if not response then
self:error( 500, "Error processing handler" )
end
-- Post process response
if sourceout then
if util.instanceof(sourceout, IOResource) then
if not response.headers["Content-Length"] then
response.headers["Content-Length"] = sourceout.len
end
end
if not response.headers["Content-Length"] then
if message.http_version == 1.1 then
response.headers["Transfer-Encoding"] = "chunked"
sinkout = self:chunksink()
else
close = true
end
end
elseif message.request_method ~= "head" then
response.headers["Content-Length"] = 0
end
if close then
response.headers["Connection"] = "close"
end
response.headers["Date"] = date.to_http(os.time())
local header =
message.env.SERVER_PROTOCOL .. " " ..
tostring(response.status) .. " " ..
proto.statusmsg[response.status] .. "\r\n"
header = header .. "Server: LuCIttpd/" .. tostring(VERSION) .. "\r\n"
for k,v in pairs(response.headers) do
header = header .. k .. ": " .. v .. "\r\n"
end
-- Output
local stat, err = pcall(function()
self:write(header .. "\r\n")
if sourceout then
if util.instanceof(sourceout, IOResource) then
self:sendfile(sourceout.fd, sourceout.offset, sourceout.len)
else
ltn12.pump.all(sourceout, sinkout)
end
end
self:flush()
end)
-- Write errors
if not stat then
if err == 107 then
-- Remote end closed the socket, so do we
elseif err then
io.stderr:write("Error sending data: " .. err .. "\n")
end
break
end
until close
self:close()
end

View File

@@ -0,0 +1,6 @@
config lucittpd lucittpd
option port 80
option timeout 90
option keepalive 0
option path /usr/lib/lucittpd/plugins/
option root /www

View File

@@ -0,0 +1,44 @@
#!/bin/sh /etc/rc.common
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/lucittpd
NAME=lucittpd
DESC="HTTP server"
START=49
test -x $DAEMON || exit 0
set -e
start() {
echo -n "Starting $DESC: $NAME"
start-stop-daemon -b -S -q -x $DAEMON
echo "."
}
stop() {
echo -n "Stopping $DESC: $NAME"
start-stop-daemon -K -q -x $DAEMON
echo "."
}
restart() {
# echo -n "Restarting $DESC: $NAME... "
# start-stop-daemon -K -s HUP -q -x $DAEMON
# echo "done."
stop
sleep 3
start
}
reload() {
#
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
#
# echo -n "Reloading $DESC configuration... "
# start-stop-daemon -K -s 1 -q -x $DAEMON
# echo "done."
restart
}

View File

@@ -0,0 +1,35 @@
function initialize()
local lucittpd = require "luci.ttpd.server"
server = lucittpd.Server(lucittpd.VHost())
end
function register()
local filehnd = require "luci.ttpd.handler.file"
local uci = require "luci.model.uci".cursor()
local filehandler = filehnd.Simple((uci:get("lucittpd", "lucittpd", "root") or "/www"))
server:get_default_vhost():set_default_handler(filehandler)
end
function accept()
server:process({
_read = function(...)
local chunk, err = webuci_read(...)
return chunk or (err and error(err, 0))
end,
_write = function(...)
local chunk, err = webuci_write(...)
return chunk or (err and error(err, 0))
end,
_close = function(...)
local chunk, err = webuci_close(...)
return chunk or (err and error(err, 0))
end,
_sendfile = function(...)
local chunk, err = webuci_sendfile(...)
return chunk or (err and error(err, 0))
end
})
end

1
libs/lucittpd/src/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
lucittpd

View File

@@ -0,0 +1,20 @@
PROGS=lucittpd
STRIP?=strip
CFLAGS?=
CFLAGS+=-pedantic -Werror -Wall -std=gnu99 -I/usr/include/lua5.1/
CPPFLAGS=-I./include
LDFLAGS?=
LDFLAGS+=-luci -llua5.1
OBJS=main.o lib/log.o lib/signal.o lib/uci.o lib/luaplugin.o
all: $(PROGS)
$(PROGS): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(MYLDFLAGS) $^ -o $@
#$(CC) $(CFLAGS) -shared -Wl,-soname,gdata $(LDFLAGS) $^ -o $@
clean:
rm -f $(PROGS) *.o *.so lib/*.o
%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(MYCFLAGS) -c $^ -o $@

View File

@@ -0,0 +1,601 @@
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
#include <stddef.h>
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
* @type: the type of the container struct this is embedded in.
* @member: the name of the member within the struct.
*
*/
#ifndef container_of
#define container_of(ptr, type, member) ( \
(type *)( (char *)ptr - offsetof(type,member) ))
#endif
/*
* Simple doubly linked list implementation.
*
* Some of the internal functions ("__xxx") are useful when
* manipulating whole lists rather than single entries, as
* sometimes we already know the next/prev entries and we can
* generate better code by using them directly rather than
* using the generic single-entry routines.
*/
struct list_head {
struct list_head *next, *prev;
};
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
static inline void INIT_LIST_HEAD(struct list_head *list)
{
list->next = list;
list->prev = list;
}
/*
* Insert a new entry between two known consecutive entries.
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
static inline void __list_add(struct list_head *new,
struct list_head *prev,
struct list_head *next)
{
next->prev = new;
new->next = next;
new->prev = prev;
prev->next = new;
}
/**
* list_add - add a new entry
* @new: new entry to be added
* @head: list head to add it after
*
* Insert a new entry after the specified head.
* This is good for implementing stacks.
*/
static inline void list_add(struct list_head *new, struct list_head *head)
{
__list_add(new, head, head->next);
}
/**
* list_add_tail - add a new entry
* @new: new entry to be added
* @head: list head to add it before
*
* Insert a new entry before the specified head.
* This is useful for implementing queues.
*/
static inline void list_add_tail(struct list_head *new, struct list_head *head)
{
__list_add(new, head->prev, head);
}
/*
* Delete a list entry by making the prev/next entries
* point to each other.
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
static inline void __list_del(struct list_head * prev, struct list_head * next)
{
next->prev = prev;
prev->next = next;
}
/**
* list_del - deletes entry from list.
* @entry: the element to delete from the list.
* Note: list_empty() on entry does not return true after this, the entry is
* in an undefined state.
*/
static inline void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
entry->next = NULL;
entry->prev = NULL;
}
/**
* list_replace - replace old entry by new one
* @old : the element to be replaced
* @new : the new element to insert
*
* If @old was empty, it will be overwritten.
*/
static inline void list_replace(struct list_head *old,
struct list_head *new)
{
new->next = old->next;
new->next->prev = new;
new->prev = old->prev;
new->prev->next = new;
}
static inline void list_replace_init(struct list_head *old,
struct list_head *new)
{
list_replace(old, new);
INIT_LIST_HEAD(old);
}
/**
* list_del_init - deletes entry from list and reinitialize it.
* @entry: the element to delete from the list.
*/
static inline void list_del_init(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
INIT_LIST_HEAD(entry);
}
/**
* list_move - delete from one list and add as another's head
* @list: the entry to move
* @head: the head that will precede our entry
*/
static inline void list_move(struct list_head *list, struct list_head *head)
{
__list_del(list->prev, list->next);
list_add(list, head);
}
/**
* list_move_tail - delete from one list and add as another's tail
* @list: the entry to move
* @head: the head that will follow our entry
*/
static inline void list_move_tail(struct list_head *list,
struct list_head *head)
{
__list_del(list->prev, list->next);
list_add_tail(list, head);
}
/**
* list_is_last - tests whether @list is the last entry in list @head
* @list: the entry to test
* @head: the head of the list
*/
static inline int list_is_last(const struct list_head *list,
const struct list_head *head)
{
return list->next == head;
}
/**
* list_empty - tests whether a list is empty
* @head: the list to test.
*/
static inline int list_empty(const struct list_head *head)
{
return head->next == head;
}
/**
* list_empty_careful - tests whether a list is empty and not being modified
* @head: the list to test
*
* Description:
* tests whether a list is empty _and_ checks that no other CPU might be
* in the process of modifying either member (next or prev)
*
* NOTE: using list_empty_careful() without synchronization
* can only be safe if the only activity that can happen
* to the list entry is list_del_init(). Eg. it cannot be used
* if another CPU could re-list_add() it.
*/
static inline int list_empty_careful(const struct list_head *head)
{
struct list_head *next = head->next;
return (next == head) && (next == head->prev);
}
static inline void __list_splice(struct list_head *list,
struct list_head *head)
{
struct list_head *first = list->next;
struct list_head *last = list->prev;
struct list_head *at = head->next;
first->prev = head;
head->next = first;
last->next = at;
at->prev = last;
}
/**
* list_splice - join two lists
* @list: the new list to add.
* @head: the place to add it in the first list.
*/
static inline void list_splice(struct list_head *list, struct list_head *head)
{
if (!list_empty(list))
__list_splice(list, head);
}
/**
* list_splice_init - join two lists and reinitialise the emptied list.
* @list: the new list to add.
* @head: the place to add it in the first list.
*
* The list at @list is reinitialised
*/
static inline void list_splice_init(struct list_head *list,
struct list_head *head)
{
if (!list_empty(list)) {
__list_splice(list, head);
INIT_LIST_HEAD(list);
}
}
/**
* list_entry - get the struct for this entry
* @ptr: the &struct list_head pointer.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct.
*/
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
/**
* list_first_entry - get the first element from a list
* @ptr: the list head to take the element from.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct.
*
* Note, that list is expected to be not empty.
*/
#define list_first_entry(ptr, type, member) \
list_entry((ptr)->next, type, member)
/**
* list_for_each - iterate over a list
* @pos: the &struct list_head to use as a loop cursor.
* @head: the head for your list.
*/
#define list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); \
pos = pos->next)
/**
* __list_for_each - iterate over a list
* @pos: the &struct list_head to use as a loop cursor.
* @head: the head for your list.
*
* This variant differs from list_for_each() in that it's the
* simplest possible list iteration code, no prefetching is done.
* Use this for code that knows the list to be very short (empty
* or 1 entry) most of the time.
*/
#define __list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
/**
* list_for_each_prev - iterate over a list backwards
* @pos: the &struct list_head to use as a loop cursor.
* @head: the head for your list.
*/
#define list_for_each_prev(pos, head) \
for (pos = (head)->prev; pos != (head); \
pos = pos->prev)
/**
* list_for_each_safe - iterate over a list safe against removal of list entry
* @pos: the &struct list_head to use as a loop cursor.
* @n: another &struct list_head to use as temporary storage
* @head: the head for your list.
*/
#define list_for_each_safe(pos, n, head) \
for (pos = (head)->next, n = pos->next; pos != (head); \
pos = n, n = pos->next)
/**
* list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
* @pos: the &struct list_head to use as a loop cursor.
* @n: another &struct list_head to use as temporary storage
* @head: the head for your list.
*/
#define list_for_each_prev_safe(pos, n, head) \
for (pos = (head)->prev, n = pos->prev; \
pos != (head); \
pos = n, n = pos->prev)
/**
* list_for_each_entry - iterate over list of given type
* @pos: the type * to use as a loop cursor.
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*/
#define list_for_each_entry(pos, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member); \
&pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
/**
* list_for_each_entry_reverse - iterate backwards over list of given type.
* @pos: the type * to use as a loop cursor.
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*/
#define list_for_each_entry_reverse(pos, head, member) \
for (pos = list_entry((head)->prev, typeof(*pos), member); \
&pos->member != (head); \
pos = list_entry(pos->member.prev, typeof(*pos), member))
/**
* list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue()
* @pos: the type * to use as a start point
* @head: the head of the list
* @member: the name of the list_struct within the struct.
*
* Prepares a pos entry for use as a start point in list_for_each_entry_continue().
*/
#define list_prepare_entry(pos, head, member) \
((pos) ? : list_entry(head, typeof(*pos), member))
/**
* list_for_each_entry_continue - continue iteration over list of given type
* @pos: the type * to use as a loop cursor.
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*
* Continue to iterate over list of given type, continuing after
* the current position.
*/
#define list_for_each_entry_continue(pos, head, member) \
for (pos = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
/**
* list_for_each_entry_continue_reverse - iterate backwards from the given point
* @pos: the type * to use as a loop cursor.
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*
* Start to iterate over list of given type backwards, continuing after
* the current position.
*/
#define list_for_each_entry_continue_reverse(pos, head, member) \
for (pos = list_entry(pos->member.prev, typeof(*pos), member); \
&pos->member != (head); \
pos = list_entry(pos->member.prev, typeof(*pos), member))
/**
* list_for_each_entry_from - iterate over list of given type from the current point
* @pos: the type * to use as a loop cursor.
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*
* Iterate over list of given type, continuing from current position.
*/
#define list_for_each_entry_from(pos, head, member) \
for (; &pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
/**
* list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
* @pos: the type * to use as a loop cursor.
* @n: another type * to use as temporary storage
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*/
#define list_for_each_entry_safe(pos, n, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member), \
n = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))
/**
* list_for_each_entry_safe_continue
* @pos: the type * to use as a loop cursor.
* @n: another type * to use as temporary storage
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*
* Iterate over list of given type, continuing after current point,
* safe against removal of list entry.
*/
#define list_for_each_entry_safe_continue(pos, n, head, member) \
for (pos = list_entry(pos->member.next, typeof(*pos), member), \
n = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))
/**
* list_for_each_entry_safe_from
* @pos: the type * to use as a loop cursor.
* @n: another type * to use as temporary storage
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*
* Iterate over list of given type from current point, safe against
* removal of list entry.
*/
#define list_for_each_entry_safe_from(pos, n, head, member) \
for (n = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))
/**
* list_for_each_entry_safe_reverse
* @pos: the type * to use as a loop cursor.
* @n: another type * to use as temporary storage
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*
* Iterate backwards over list of given type, safe against removal
* of list entry.
*/
#define list_for_each_entry_safe_reverse(pos, n, head, member) \
for (pos = list_entry((head)->prev, typeof(*pos), member), \
n = list_entry(pos->member.prev, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.prev, typeof(*n), member))
/*
* Double linked lists with a single pointer list head.
* Mostly useful for hash tables where the two pointer list head is
* too wasteful.
* You lose the ability to access the tail in O(1).
*/
struct hlist_head {
struct hlist_node *first;
};
struct hlist_node {
struct hlist_node *next, **pprev;
};
#define HLIST_HEAD_INIT { .first = NULL }
#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL }
#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
static inline void INIT_HLIST_NODE(struct hlist_node *h)
{
h->next = NULL;
h->pprev = NULL;
}
static inline int hlist_unhashed(const struct hlist_node *h)
{
return !h->pprev;
}
static inline int hlist_empty(const struct hlist_head *h)
{
return !h->first;
}
static inline void __hlist_del(struct hlist_node *n)
{
struct hlist_node *next = n->next;
struct hlist_node **pprev = n->pprev;
*pprev = next;
if (next)
next->pprev = pprev;
}
static inline void hlist_del(struct hlist_node *n)
{
__hlist_del(n);
n->next = NULL;
n->pprev = NULL;
}
static inline void hlist_del_init(struct hlist_node *n)
{
if (!hlist_unhashed(n)) {
__hlist_del(n);
INIT_HLIST_NODE(n);
}
}
static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
{
struct hlist_node *first = h->first;
n->next = first;
if (first)
first->pprev = &n->next;
h->first = n;
n->pprev = &h->first;
}
/* next must be != NULL */
static inline void hlist_add_before(struct hlist_node *n,
struct hlist_node *next)
{
n->pprev = next->pprev;
n->next = next;
next->pprev = &n->next;
*(n->pprev) = n;
}
static inline void hlist_add_after(struct hlist_node *n,
struct hlist_node *next)
{
next->next = n->next;
n->next = next;
next->pprev = &n->next;
if(next->next)
next->next->pprev = &next->next;
}
#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
#define hlist_for_each(pos, head) \
for (pos = (head)->first; pos; pos = pos->next)
#define hlist_for_each_safe(pos, n, head) \
for (pos = (head)->first; pos; pos = n)
/**
* hlist_for_each_entry - iterate over list of given type
* @tpos: the type * to use as a loop cursor.
* @pos: the &struct hlist_node to use as a loop cursor.
* @head: the head for your list.
* @member: the name of the hlist_node within the struct.
*/
#define hlist_for_each_entry(tpos, pos, head, member) \
for (pos = (head)->first; pos && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = pos->next)
/**
* hlist_for_each_entry_continue - iterate over a hlist continuing after current point
* @tpos: the type * to use as a loop cursor.
* @pos: the &struct hlist_node to use as a loop cursor.
* @member: the name of the hlist_node within the struct.
*/
#define hlist_for_each_entry_continue(tpos, pos, member) \
for (pos = (pos)->next; pos && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = pos->next)
/**
* hlist_for_each_entry_from - iterate over a hlist continuing from current point
* @tpos: the type * to use as a loop cursor.
* @pos: the &struct hlist_node to use as a loop cursor.
* @member: the name of the hlist_node within the struct.
*/
#define hlist_for_each_entry_from(tpos, pos, member) \
for (; pos && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = pos->next)
/**
* hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
* @tpos: the type * to use as a loop cursor.
* @pos: the &struct hlist_node to use as a loop cursor.
* @n: another &struct hlist_node to use as temporary storage
* @head: the head for your list.
* @member: the name of the hlist_node within the struct.
*/
#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \
for (pos = (head)->first; \
pos && ({ n = pos->next; 1; }) && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = n)
#endif

View File

@@ -0,0 +1,24 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Provided by fon.com
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
*/
#ifndef _LOG_H__
#define _LOG_H__
void log_printf(char *fmt, ...);
void log_start(int daemon);
#endif

View File

@@ -0,0 +1,71 @@
/*
* luaplugin - fast lua plugin indexing
* Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __LUAPLUGIN_H
#define __LUAPLUGIN_H
#include <sys/time.h>
#include <lualib.h>
#include <lauxlib.h>
#include <stdbool.h>
#include "list.h"
struct luaplugin_entry {
struct luaplugin_ctx *ctx;
struct list_head list;
time_t timestamp;
int checked;
bool loaded;
bool reload;
char *name;
char *module;
/* privdata for the caller */
void *priv;
};
struct luaplugin_ctx {
const char *path;
const struct luaplugin_ops *ops;
lua_State *L;
int checked;
struct list_head *last;
struct list_head entries;
};
/** luaplugin_init:
* initialize the luaplugin context (allocates a new lua context)
*/
extern int luaplugin_init(struct luaplugin_ctx *ctx, const char *path);
/** luaplugin_scan:
* rescan the plugin cache
*/
extern void luaplugin_scan(struct luaplugin_ctx *ctx);
/** luaplugin_call:
* call out to a lua function.
* to be able to use this, you need to push the function name on the lua stack (ctx->L)
* and then narg function arguments afterwards.
* this call pops (narg + 1) arguments from the stack
* returns -ENOENT if the function was not found
*/
extern int luaplugin_call(struct luaplugin_entry *e, int narg);
/** luaplugin_done:
* drop the luaplugin context (and associated lua context)
* frees all memory allocated by the library
*/
extern void luaplugin_done(struct luaplugin_ctx *ctx);
#endif

View File

@@ -0,0 +1,25 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Provided by fon.com
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
*/
#ifndef _SIGNAL_H__
#define _SIGNAL_H__
void setup_signals(void);
#endif

View File

@@ -0,0 +1,54 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
*/
#ifndef _UCI_H__
#define _UCI_H__
#include <uci.h>
#include <lib/list.h>
struct ucilist {
struct list_head list;
char *val;
};
struct uci_context* ucix_init(const char *config_file);
struct uci_context* ucix_init_path(const char *path, const char *config_file);
void ucix_cleanup(struct uci_context *ctx);
void ucix_save(struct uci_context *ctx);
void ucix_save_state(struct uci_context *ctx);
const char* ucix_get_option(struct uci_context *ctx,
const char *p, const char *s, const char *o);
int ucix_get_option_list(struct uci_context *ctx, const char *p,
const char *s, const char *o, struct list_head *l);
int ucix_get_option_int(struct uci_context *ctx,
const char *p, const char *s, const char *o, int def);
void ucix_add_section(struct uci_context *ctx,
const char *p, const char *s, const char *t);
void ucix_add_option(struct uci_context *ctx,
const char *p, const char *s, const char *o, const char *t);
void ucix_add_option_int(struct uci_context *ctx,
const char *p, const char *s, const char *o, int t);
void ucix_for_each_section_type(struct uci_context *ctx,
const char *p, const char *t,
void (*cb)(const char*, void*), void *priv);
int ucix_commit(struct uci_context *ctx, const char *p);
void ucix_revert(struct uci_context *ctx,
const char *p, const char *s, const char *o);
void ucix_del(struct uci_context *ctx, const char *p,
const char *s, const char *o);
#endif

View File

@@ -0,0 +1,543 @@
/*
* libuci - Library for the Unified Configuration Interface
* Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __LIBUCI_H
#define __LIBUCI_H
#include "uci_config.h"
/*
* you can use these defines to enable debugging behavior for
* apps compiled against libuci:
*
* #define UCI_DEBUG_TYPECAST:
* enable uci_element typecast checking at run time
*
*/
#include <stdbool.h>
#include <setjmp.h>
#include <stdio.h>
#define UCI_CONFDIR "/etc/config"
#define UCI_SAVEDIR "/tmp/.uci"
#define UCI_DIRMODE 0700
#define UCI_FILEMODE 0600
enum
{
UCI_OK = 0,
UCI_ERR_MEM,
UCI_ERR_INVAL,
UCI_ERR_NOTFOUND,
UCI_ERR_IO,
UCI_ERR_PARSE,
UCI_ERR_DUPLICATE,
UCI_ERR_UNKNOWN,
UCI_ERR_LAST
};
struct uci_list;
struct uci_list
{
struct uci_list *next;
struct uci_list *prev;
};
struct uci_ptr;
struct uci_element;
struct uci_package;
struct uci_section;
struct uci_option;
struct uci_history;
struct uci_context;
struct uci_backend;
struct uci_parse_context;
/**
* uci_alloc_context: Allocate a new uci context
*/
extern struct uci_context *uci_alloc_context(void);
/**
* uci_free_context: Free the uci context including all of its data
*/
extern void uci_free_context(struct uci_context *ctx);
/**
* uci_perror: Print the last uci error that occured
* @ctx: uci context
* @str: string to print before the error message
*/
extern void uci_perror(struct uci_context *ctx, const char *str);
/**
* uci_geterror: Get an error string for the last uci error
* @ctx: uci context
* @dest: target pointer for the string
* @str: prefix for the error message
*
* Note: string must be freed by the caller
*/
extern void uci_get_errorstr(struct uci_context *ctx, char **dest, const char *str);
/**
* uci_import: Import uci config data from a stream
* @ctx: uci context
* @stream: file stream to import from
* @name: (optional) assume the config has the given name
* @package: (optional) store the last parsed config package in this variable
* @single: ignore the 'package' keyword and parse everything into a single package
*
* the name parameter is for config files that don't explicitly use the 'package <...>' keyword
* if 'package' points to a non-null struct pointer, enable history tracking and merge
*/
extern int uci_import(struct uci_context *ctx, FILE *stream, const char *name, struct uci_package **package, bool single);
/**
* uci_export: Export one or all uci config packages
* @ctx: uci context
* @stream: output stream
* @package: (optional) uci config package to export
* @header: include the package header
*/
extern int uci_export(struct uci_context *ctx, FILE *stream, struct uci_package *package, bool header);
/**
* uci_load: Parse an uci config file and store it in the uci context
*
* @ctx: uci context
* @name: name of the config file (relative to the config directory)
* @package: store the loaded config package in this variable
*/
extern int uci_load(struct uci_context *ctx, const char *name, struct uci_package **package);
/**
* uci_unload: Unload a config file from the uci context
*
* @ctx: uci context
* @package: pointer to the uci_package struct
*/
extern int uci_unload(struct uci_context *ctx, struct uci_package *p);
/**
* uci_lookup_ptr: Split an uci tuple string and look up an element tree
* @ctx: uci context
* @ptr: lookup result struct
* @str: uci tuple string to look up
* @extended: allow extended syntax lookup
*
* if extended is set to true, uci_lookup_ptr supports the following
* extended syntax:
*
* Examples:
* network.@interface[0].ifname ('ifname' option of the first interface section)
* network.@interface[-1] (last interface section)
* Note: uci_lookup_ext will automatically load a config package if necessary
*/
extern int uci_lookup_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *str, bool extended);
/**
* uci_add_section: Add an unnamed section
* @ctx: uci context
* @p: package to add the section to
* @type: section type
* @res: pointer to store a reference to the new section in
*/
extern int uci_add_section(struct uci_context *ctx, struct uci_package *p, const char *type, struct uci_section **res);
/**
* uci_set: Set an element's value; create the element if necessary
* @ctx: uci context
* @ptr: uci pointer
*
* The updated/created element is stored in ptr->last
*/
extern int uci_set(struct uci_context *ctx, struct uci_ptr *ptr);
/**
* uci_add_list: Append a string to an element list
* @ctx: uci context
* @ptr: uci pointer (with value)
*
* Note: if the given option already contains a string value,
* it will be converted to an 1-element-list before appending the next element
*/
extern int uci_add_list(struct uci_context *ctx, struct uci_ptr *ptr);
/**
* uci_rename: Rename an element
* @ctx: uci context
* @ptr: uci pointer (with value)
*/
extern int uci_rename(struct uci_context *ctx, struct uci_ptr *ptr);
/**
* uci_delete: Delete a section or option
* @ctx: uci context
* @ptr: uci pointer
*/
extern int uci_delete(struct uci_context *ctx, struct uci_ptr *ptr);
/**
* uci_save: save change history for a package
* @ctx: uci context
* @p: uci_package struct
*/
extern int uci_save(struct uci_context *ctx, struct uci_package *p);
/**
* uci_commit: commit changes to a package
* @ctx: uci context
* @p: uci_package struct pointer
* @overwrite: overwrite existing config data and flush history
*
* committing may reload the whole uci_package data,
* the supplied pointer is updated accordingly
*/
extern int uci_commit(struct uci_context *ctx, struct uci_package **p, bool overwrite);
/**
* uci_list_configs: List available uci config files
* @ctx: uci context
*
* caller is responsible for freeing the allocated memory behind list
*/
extern int uci_list_configs(struct uci_context *ctx, char ***list);
/**
* uci_set_savedir: override the default history save directory
* @ctx: uci context
* @dir: directory name
*/
extern int uci_set_savedir(struct uci_context *ctx, const char *dir);
/**
* uci_set_savedir: override the default config storage directory
* @ctx: uci context
* @dir: directory name
*/
extern int uci_set_confdir(struct uci_context *ctx, const char *dir);
/**
* uci_add_history_path: add a directory to the search path for change history files
* @ctx: uci context
* @dir: directory name
*
* This function allows you to add directories, which contain 'overlays'
* for the active config, that will never be committed.
*/
extern int uci_add_history_path(struct uci_context *ctx, const char *dir);
/**
* uci_revert: revert all changes to a config item
* @ctx: uci context
* @ptr: uci pointer
*/
extern int uci_revert(struct uci_context *ctx, struct uci_ptr *ptr);
/**
* uci_parse_argument: parse a shell-style argument, with an arbitrary quoting style
* @ctx: uci context
* @stream: input stream
* @str: pointer to the current line (use NULL for parsing the next line)
* @result: pointer for the result
*/
extern int uci_parse_argument(struct uci_context *ctx, FILE *stream, char **str, char **result);
/**
* uci_set_backend: change the default backend
* @ctx: uci context
* @name: name of the backend
*
* The default backend is "file", which uses /etc/config for config storage
*/
extern int uci_set_backend(struct uci_context *ctx, const char *name);
/**
* uci_validate_text: validate a value string for uci options
* @str: value
*
* this function checks whether a given string is acceptable as value
* for uci options
*/
extern bool uci_validate_text(const char *str);
/* UCI data structures */
enum uci_type {
UCI_TYPE_UNSPEC = 0,
UCI_TYPE_HISTORY = 1,
UCI_TYPE_PACKAGE = 2,
UCI_TYPE_SECTION = 3,
UCI_TYPE_OPTION = 4,
UCI_TYPE_PATH = 5,
UCI_TYPE_BACKEND = 6,
UCI_TYPE_ITEM = 7,
};
enum uci_option_type {
UCI_TYPE_STRING = 0,
UCI_TYPE_LIST = 1,
};
enum uci_flags {
UCI_FLAG_STRICT = (1 << 0), /* strict mode for the parser */
UCI_FLAG_PERROR = (1 << 1), /* print parser error messages */
UCI_FLAG_EXPORT_NAME = (1 << 2), /* when exporting, name unnamed sections */
UCI_FLAG_SAVED_HISTORY = (1 << 3), /* store the saved history in memory as well */
};
struct uci_element
{
struct uci_list list;
enum uci_type type;
char *name;
};
struct uci_backend
{
struct uci_element e;
char **(*list_configs)(struct uci_context *ctx);
struct uci_package *(*load)(struct uci_context *ctx, const char *name);
void (*commit)(struct uci_context *ctx, struct uci_package **p, bool overwrite);
/* private: */
const void *ptr;
void *priv;
};
struct uci_context
{
/* list of config packages */
struct uci_list root;
/* parser context, use for error handling only */
struct uci_parse_context *pctx;
/* backend for import and export */
struct uci_backend *backend;
struct uci_list backends;
/* uci runtime flags */
enum uci_flags flags;
char *confdir;
char *savedir;
/* search path for history files */
struct uci_list history_path;
/* private: */
int err;
const char *func;
jmp_buf trap;
bool internal, nested;
char *buf;
int bufsz;
};
struct uci_package
{
struct uci_element e;
struct uci_list sections;
struct uci_context *ctx;
bool has_history;
char *path;
/* private: */
struct uci_backend *backend;
void *priv;
int n_section;
struct uci_list history;
struct uci_list saved_history;
};
struct uci_section
{
struct uci_element e;
struct uci_list options;
struct uci_package *package;
bool anonymous;
char *type;
};
struct uci_option
{
struct uci_element e;
struct uci_section *section;
enum uci_option_type type;
union {
struct uci_list list;
char *string;
} v;
};
enum uci_command {
UCI_CMD_ADD,
UCI_CMD_REMOVE,
UCI_CMD_CHANGE,
UCI_CMD_RENAME,
UCI_CMD_LIST_ADD,
};
struct uci_history
{
struct uci_element e;
enum uci_command cmd;
char *section;
char *value;
};
struct uci_ptr
{
enum uci_type target;
enum {
UCI_LOOKUP_DONE = (1 << 0),
UCI_LOOKUP_COMPLETE = (1 << 1),
UCI_LOOKUP_EXTENDED = (1 << 2),
} flags;
struct uci_package *p;
struct uci_section *s;
struct uci_option *o;
struct uci_element *last;
const char *package;
const char *section;
const char *option;
const char *value;
};
/* linked list handling */
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
* @type: the type of the container struct this is embedded in.
* @member: the name of the member within the struct.
*/
#define container_of(ptr, type, member) \
((type *) ((char *)ptr - offsetof(type,member)))
/**
* uci_list_entry: casts an uci_list pointer to the containing struct.
* @_type: config, section or option
* @_ptr: pointer to the uci_list struct
*/
#define list_to_element(ptr) \
container_of(ptr, struct uci_element, list)
/**
* uci_foreach_entry: loop through a list of uci elements
* @_list: pointer to the uci_list struct
* @_ptr: iteration variable, struct uci_element
*
* use like a for loop, e.g:
* uci_foreach(&list, p) {
* ...
* }
*/
#define uci_foreach_element(_list, _ptr) \
for(_ptr = list_to_element((_list)->next); \
&_ptr->list != (_list); \
_ptr = list_to_element(_ptr->list.next))
/**
* uci_foreach_entry_safe: like uci_foreach_safe, but safe for deletion
* @_list: pointer to the uci_list struct
* @_tmp: temporary variable, struct uci_element *
* @_ptr: iteration variable, struct uci_element *
*
* use like a for loop, e.g:
* uci_foreach(&list, p) {
* ...
* }
*/
#define uci_foreach_element_safe(_list, _tmp, _ptr) \
for(_ptr = list_to_element((_list)->next), \
_tmp = list_to_element(_ptr->list.next); \
&_ptr->list != (_list); \
_ptr = _tmp, _tmp = list_to_element(_ptr->list.next))
/**
* uci_list_empty: returns true if a list is empty
* @list: list head
*/
#define uci_list_empty(list) ((list)->next == (list))
/* wrappers for dynamic type handling */
#define uci_type_backend UCI_TYPE_BACKEND
#define uci_type_history UCI_TYPE_HISTORY
#define uci_type_package UCI_TYPE_PACKAGE
#define uci_type_section UCI_TYPE_SECTION
#define uci_type_option UCI_TYPE_OPTION
/* element typecasting */
#ifdef UCI_DEBUG_TYPECAST
static const char *uci_typestr[] = {
[uci_type_backend] = "backend",
[uci_type_history] = "history",
[uci_type_package] = "package",
[uci_type_section] = "section",
[uci_type_option] = "option",
};
static void uci_typecast_error(int from, int to)
{
fprintf(stderr, "Invalid typecast from '%s' to '%s'\n", uci_typestr[from], uci_typestr[to]);
}
#define BUILD_CAST(_type) \
static inline struct uci_ ## _type *uci_to_ ## _type (struct uci_element *e) \
{ \
if (e->type != uci_type_ ## _type) { \
uci_typecast_error(e->type, uci_type_ ## _type); \
} \
return (struct uci_ ## _type *) e; \
}
BUILD_CAST(backend)
BUILD_CAST(history)
BUILD_CAST(package)
BUILD_CAST(section)
BUILD_CAST(option)
#else
#define uci_to_backend(ptr) container_of(ptr, struct uci_backend, e)
#define uci_to_history(ptr) container_of(ptr, struct uci_history, e)
#define uci_to_package(ptr) container_of(ptr, struct uci_package, e)
#define uci_to_section(ptr) container_of(ptr, struct uci_section, e)
#define uci_to_option(ptr) container_of(ptr, struct uci_option, e)
#endif
/**
* uci_alloc_element: allocate a generic uci_element, reserve a buffer and typecast
* @ctx: uci context
* @type: {package,section,option}
* @name: string containing the name of the element
* @datasize: additional buffer size to reserve at the end of the struct
*/
#define uci_alloc_element(ctx, type, name, datasize) \
uci_to_ ## type (uci_alloc_generic(ctx, uci_type_ ## type, name, sizeof(struct uci_ ## type) + datasize))
#define uci_dataptr(ptr) \
(((char *) ptr) + sizeof(*ptr))
#endif

View File

@@ -0,0 +1,3 @@
#define UCI_PLUGIN_SUPPORT 1
#undef UCI_DEBUG
#undef UCI_DEBUG_TYPECAST

View File

@@ -0,0 +1,45 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Provided by fon.com
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
*/
#include <stdio.h>
#include <syslog.h>
#include <stdarg.h>
static int daemonize = 0;
void log_start(int daemon)
{
daemonize = daemon;
openlog("lucittpd", 0, 0);
}
void log_printf(char *fmt, ...)
{
char p[256];
va_list ap;
va_start(ap, fmt);
vsnprintf(p, 256, fmt, ap);
va_end(ap);
if(daemonize)
syslog(10, p);
else
printf(p);
}

View File

@@ -0,0 +1,383 @@
/*
* luaplugin - fast lua plugin indexing
* Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <sys/types.h>
#include <sys/time.h>
#include <sys/cdefs.h>
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE /* XXX: portability hack for timestamp */
#endif
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <limits.h>
#include <glob.h>
#include <lualib.h>
#include <lauxlib.h>
#include <lib/list.h>
#include <lib/luaplugin.h>
//#define DEBUG 1
#ifdef DEBUG
#define DPRINTF(...) fprintf(stderr, __VA_ARGS__)
#else
#define DPRINTF(...) do {} while (0)
#endif
/**
* list_for_each_offset - iterate over a list, start with the provided pointer
* @pos: the &struct list_head to use as a loop cursor.
* @head: the head for your list.
*/
#define list_for_each_offset(pos, head, offset) \
for (pos = (offset)->next; pos != (offset); \
pos = ((pos->next == (head)) && ((offset) != (head)) ? (head)->next : pos->next))
static char pbuf[PATH_MAX];
static void load_module(struct luaplugin_ctx *ctx, struct luaplugin_entry *e);
static struct luaplugin_entry *
find_entry(struct luaplugin_ctx *ctx, const char *name, bool modname)
{
struct list_head *p;
if (!ctx->last)
ctx->last = &ctx->entries;
list_for_each_offset(p, &ctx->entries, ctx->last) {
struct luaplugin_entry *e;
const char *cmp;
e = container_of(p, struct luaplugin_entry, list);
if (modname)
cmp = e->module;
else
cmp = e->name;
if (!strcmp(cmp, name))
return e;
}
return NULL;
}
static struct luaplugin_entry *
new_entry(struct luaplugin_ctx *ctx, const char *name, const char *modname)
{
struct luaplugin_entry *e;
char *c;
e = malloc(sizeof(struct luaplugin_entry));
if (!e)
goto error;
memset(e, 0, sizeof(struct luaplugin_entry));
INIT_LIST_HEAD(&e->list);
e->ctx = ctx;
e->loaded = false;
e->name = strdup(name);
if (!e->name)
goto error1;
e->module = strdup(modname);
if (!e->module)
goto error2;
/* strip filename extension */
c = strrchr(e->module, '.');
if (c)
*c = 0;
/* lua namespace: replace / with . */
c = e->module;
while ((c = strchr(c, '/')) != NULL) {
*c = '.';
}
return e;
error2:
free(e->name);
error1:
free(e);
error:
return NULL;
}
static const char *module_loader =
"loader = function (newgt, filename)\n"
" setmetatable(newgt, { __index = _G })\n"
" local f = loadfile(filename)\n"
" if (type(f) == \"function\") then\n"
" setfenv(f, newgt)\n"
" f()\n"
" else\n"
" error(f)\n"
" end\n"
"end\n";
static void
access_plugin_table (lua_State *L, const char *modname, bool set)
{
const char *e;
lua_pushvalue(L, LUA_GLOBALSINDEX);
do {
bool _set = true;
e = strchr(modname, '.');
if (e == NULL) {
e = modname + strlen(modname);
_set = set;
}
lua_pushlstring(L, modname, e - modname);
lua_rawget(L, -2);
if (lua_isnil(L, -1) ||
/* no such field or last field */
(lua_istable(L, -1) && (*e != '.'))) {
lua_pop(L, 1); /* remove this result */
if (_set) {
if (*e != '.')
lua_pushvalue(L, -2); /* use table from given index */
else
lua_createtable(L, 0, 1); /* new table for field */
}
lua_pushlstring(L, modname, e - modname);
if (_set) {
lua_pushvalue(L, -2);
lua_settable(L, -4); /* set new table into field */
} else {
lua_gettable(L, -2);
}
}
else if (!lua_istable(L, -1)) { /* field has a non-table value? */
lua_pop(L, 2 + !!set); /* remove table and values */
return;
}
lua_remove(L, -2); /* remove previous table */
modname = e + 1;
} while (*e == '.');
if (set)
lua_pop(L, 2);
}
static void
load_module(struct luaplugin_ctx *ctx, struct luaplugin_entry *e)
{
lua_State *L = ctx->L;
int ret;
/* grab the loader wrapper function */
ret = luaL_dostring(L, module_loader);
if (ret)
return;
lua_getglobal(L, "loader");
lua_pushnil(L);
lua_setglobal(L, "loader");
e->loaded = true;
e->reload = false;
/* new environment table for function call */
lua_newtable(L);
/* register the table globally */
lua_pushvalue(L, -1);
access_plugin_table(L, e->module, true);
lua_pushstring(L, e->name);
if (lua_pcall(L, 2, 0, 0) != 0) {
const char *err = "unknown error";
if (lua_isstring(L, -1))
err = lua_tostring(L, -1);
fprintf(stderr, err);
}
}
static void
free_entry(struct luaplugin_ctx *ctx, struct luaplugin_entry *e)
{
lua_State *L = ctx->L;
if (e->loaded && L) {
/* allow the gc to free the module */
lua_pushnil(L);
access_plugin_table(L, e->module, true);
}
list_del(&e->list);
free(e->name);
free(e->module);
free(e);
}
static void
__luaplugin_scan(struct luaplugin_ctx *ctx, int base_len, int rec)
{
int gl_flags = GLOB_NOESCAPE | GLOB_NOSORT | GLOB_MARK;
glob_t gl;
int i;
strncpy(pbuf + base_len, "*.lua", PATH_MAX - base_len);
if (glob(pbuf, gl_flags, NULL, &gl) < 0) {
globfree(&gl);
return;
}
for (i = 0; i < gl.gl_pathc; i++) {
const char *entry = gl.gl_pathv[i];
struct luaplugin_entry *e;
struct stat st;
int elen;
elen = strlen(entry);
/* should not happen */
if ((elen <= base_len) || (strncmp(entry, pbuf, base_len) != 0)) {
fprintf(stderr, "[%s] sanity check failed in %s(%d)!\n", __FILE__, __func__, __LINE__);
continue;
}
/* descend into subdirectories */
if (entry[elen - 1] == '/') {
strncpy(pbuf + base_len, entry + base_len, PATH_MAX - base_len);
__luaplugin_scan(ctx, base_len, rec + 1);
pbuf[base_len] = '\0';
continue;
}
if (stat(gl.gl_pathv[i], &st))
continue;
if ((st.st_mode & S_IFMT) != S_IFREG)
continue;
e = find_entry(ctx, entry + base_len, false);
if (!e) {
e = new_entry(ctx, entry, entry + base_len);
list_add_tail(&e->list, &ctx->entries);
}
if (!e)
continue;
e->checked = ctx->checked;
e->reload = (e->timestamp < st.st_mtime);
e->timestamp = st.st_mtime;
}
globfree(&gl);
}
int
luaplugin_call(struct luaplugin_entry *e, int narg)
{
struct luaplugin_ctx *ctx = e->ctx;
lua_State *L = ctx->L;
const char *func;
int ret;
func = luaL_checkstring(L, -1 - narg);
/* grab a reference to the plugin's table */
access_plugin_table(L, e->module, false);
lua_getfield(L, -1, func);
if (!lua_isfunction(L, -1)) {
lua_pop(L, narg + 1);
ret = -ENOENT;
goto done;
}
/* replace function name with a ref to the function */
lua_replace(L, -3 - narg);
/* pop the table */
lua_pop(L, 1);
ret = lua_pcall(L, narg, 0, 0);
if (ret != 0) {
fprintf(stderr, lua_tostring(L, -1));
}
done:
return ret;
}
void
luaplugin_scan(struct luaplugin_ctx *ctx)
{
struct list_head *tmp, *p;
sprintf(pbuf, "%s/", ctx->path);
ctx->checked++;
__luaplugin_scan(ctx, strlen(pbuf), 0);
/* expire old entries */
list_for_each_safe(p, tmp, &ctx->entries) {
struct luaplugin_entry *e = container_of(p, struct luaplugin_entry, list);
if (e->checked < ctx->checked)
free_entry(ctx, e);
else if (e->reload)
load_module(ctx, e);
}
}
int
luaplugin_init(struct luaplugin_ctx *ctx, const char *path)
{
memset(ctx, 0, sizeof(struct luaplugin_ctx));
INIT_LIST_HEAD(&ctx->entries);
ctx->path = path;
ctx->L = luaL_newstate();
if (!ctx->L)
return -ENOMEM;
luaL_openlibs(ctx->L);
/* disable the module functionality, a plugin is restricted to its own environment */
/*
lua_pushcfunction(ctx->L, luaplugin_module);
lua_setfield(ctx->L, LUA_GLOBALSINDEX, "module");
*/
return 0;
}
void
luaplugin_done(struct luaplugin_ctx *ctx)
{
struct list_head *p, *tmp;
lua_close(ctx->L);
ctx->L = NULL;
list_for_each_safe(p, tmp, &ctx->entries) {
struct luaplugin_entry *e;
e = container_of(p, struct luaplugin_entry, list);
free_entry(ctx, e);
}
}

View File

@@ -0,0 +1,52 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Provided by fon.com
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <lib/log.h>
void handler_INT(int signo)
{
log_printf("away we go\n");
exit(0);
}
void handler_CHLD(int signo)
{
while(waitpid(-1, NULL, WNOHANG) > 0);
}
void setup_signals(void)
{
struct sigaction s1, s2, s3;
s1.sa_handler = handler_INT;
s1.sa_flags = 0;
sigaction(SIGINT, &s1, NULL);
s2.sa_handler = handler_INT;
s2.sa_flags = 0;
sigaction(SIGTERM, &s2, NULL);
s3.sa_handler = handler_CHLD;
s3.sa_flags = SA_RESTART;
sigaction(SIGCHLD, &s3, NULL);
}

206
libs/lucittpd/src/lib/uci.c Normal file
View File

@@ -0,0 +1,206 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
*/
#include <string.h>
#include <stdlib.h>
#include <uci.h>
#include <lib/list.h>
#include <lib/log.h>
#include <lib/uci.h>
static struct uci_ptr ptr;
static struct uci_package *p = NULL;
static inline int ucix_get_ptr(struct uci_context *ctx, const char *p, const char *s, const char *o, const char *t)
{
memset(&ptr, 0, sizeof(ptr));
ptr.package = p;
ptr.section = s;
ptr.option = o;
ptr.value = t;
return uci_lookup_ptr(ctx, &ptr, NULL, true);
}
struct uci_context* ucix_init(const char *config_file)
{
struct uci_context *ctx = uci_alloc_context();
uci_add_history_path(ctx, "/var/state");
uci_set_savedir(ctx, "/var/state/");
if(uci_load(ctx, config_file, &p) != UCI_OK)
{
log_printf("%s/%s is missing or corrupt\n", ctx->savedir, config_file);
return NULL;
}
return ctx;
}
struct uci_context* ucix_init_path(const char *path, const char *config_file)
{
struct uci_context *ctx = uci_alloc_context();
if(path)
uci_set_confdir(ctx, path);
if(uci_load(ctx, config_file, NULL) != UCI_OK)
{
log_printf("%s/%s is missing or corrupt\n", ctx->savedir, config_file);
return NULL;
}
return ctx;
}
void ucix_cleanup(struct uci_context *ctx)
{
uci_free_context(ctx);
}
void ucix_save(struct uci_context *ctx)
{
uci_set_savedir(ctx, "/tmp/.uci");
uci_save(ctx, p);
}
void ucix_save_state(struct uci_context *ctx)
{
uci_save(ctx, p);
}
int ucix_get_option_list(struct uci_context *ctx, const char *p,
const char *s, const char *o, struct list_head *l)
{
struct uci_element *e = NULL;
if(ucix_get_ptr(ctx, p, s, o, NULL))
return 1;
if (!(ptr.flags & UCI_LOOKUP_COMPLETE))
return 1;
e = ptr.last;
switch (e->type)
{
case UCI_TYPE_OPTION:
switch(ptr.o->type) {
case UCI_TYPE_LIST:
uci_foreach_element(&ptr.o->v.list, e)
{
struct ucilist *ul = malloc(sizeof(struct ucilist));
ul->val = strdup((e->name)?(e->name):(""));
INIT_LIST_HEAD(&ul->list);
list_add(&ul->list, l);
}
break;
default:
break;
}
break;
default:
return 1;
}
return 0;
}
const char* ucix_get_option(struct uci_context *ctx, const char *p, const char *s, const char *o)
{
struct uci_element *e = NULL;
const char *value = NULL;
if(ucix_get_ptr(ctx, p, s, o, NULL))
return NULL;
if (!(ptr.flags & UCI_LOOKUP_COMPLETE))
return NULL;
e = ptr.last;
switch (e->type)
{
case UCI_TYPE_SECTION:
value = uci_to_section(e)->type;
break;
case UCI_TYPE_OPTION:
switch(ptr.o->type) {
case UCI_TYPE_STRING:
value = ptr.o->v.string;
break;
default:
value = NULL;
break;
}
break;
default:
return 0;
}
return value;
}
int ucix_get_option_int(struct uci_context *ctx, const char *p, const char *s, const char *o, int def)
{
const char *tmp = ucix_get_option(ctx, p, s, o);
int ret = def;
if (tmp)
ret = atoi(tmp);
return ret;
}
void ucix_add_section(struct uci_context *ctx, const char *p, const char *s, const char *t)
{
if(ucix_get_ptr(ctx, p, s, NULL, t))
return;
uci_set(ctx, &ptr);
}
void ucix_add_option(struct uci_context *ctx, const char *p, const char *s, const char *o, const char *t)
{
if(ucix_get_ptr(ctx, p, s, o, (t)?(t):("")))
return;
uci_set(ctx, &ptr);
}
void ucix_add_option_int(struct uci_context *ctx, const char *p, const char *s, const char *o, int t)
{
char tmp[64];
snprintf(tmp, 64, "%d", t);
ucix_add_option(ctx, p, s, o, tmp);
}
void ucix_del(struct uci_context *ctx, const char *p, const char *s, const char *o)
{
if(!ucix_get_ptr(ctx, p, s, o, NULL))
uci_delete(ctx, &ptr);
}
void ucix_revert(struct uci_context *ctx, const char *p, const char *s, const char *o)
{
if(!ucix_get_ptr(ctx, p, s, o, NULL))
uci_revert(ctx, &ptr);
}
void ucix_for_each_section_type(struct uci_context *ctx,
const char *p, const char *t,
void (*cb)(const char*, void*), void *priv)
{
struct uci_element *e;
if(ucix_get_ptr(ctx, p, NULL, NULL, NULL))
return;
uci_foreach_element(&ptr.p->sections, e)
if (!strcmp(t, uci_to_section(e)->type))
cb(e->name, priv);
}
int ucix_commit(struct uci_context *ctx, const char *p)
{
if(ucix_get_ptr(ctx, p, NULL, NULL, NULL))
return 1;
return uci_commit(ctx, &ptr.p, false);
}

333
libs/lucittpd/src/main.c Normal file
View File

@@ -0,0 +1,333 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#include <signal.h>
#include <features.h>
#include <lib/uci.h>
#include <lib/log.h>
#include <lib/signal.h>
#include <lib/luaplugin.h>
#ifndef __UCLIBC__
#include <sys/sendfile.h>
#endif
#define BACKLOG 10
static int port = 0;
static const char *plugin_path = NULL;
static struct luaplugin_ctx ctx;
static struct luaplugin_entry *e;
static struct timeval timeout;
static void load_config(void)
{
timeout.tv_usec = 0;
static struct uci_context* uci = 0;
uci = ucix_init("lucittpd");
if(uci)
{
plugin_path = ucix_get_option(uci, "lucittpd", "lucittpd", "path");
port = ucix_get_option_int(uci, "lucittpd", "lucittpd", "port", 80);
timeout.tv_sec = ucix_get_option_int(uci, "lucittpd", "lucittpd", "timeout", 90);
} else {
port = 8080;
timeout.tv_sec = 90;
}
if(!plugin_path)
plugin_path = strdup("/usr/lib/lucittpd/plugins/");
// ToDo: Check why below command segfaults in uci_free_context
//ucix_cleanup(uci);
}
static int webuci_read(lua_State *L)
{
int len = luaL_checkinteger(L, 1);
if (len <= 0) {
return luaL_argerror(L, 1, "too low");
}
char *buffer = malloc(len);
if (!buffer) {
return luaL_error(L, "malloc() failed");
}
int sockfd = lua_tointeger(L, lua_upvalueindex(1));
len = read(sockfd, buffer, len);
if (len > 0) {
lua_pushlstring(L, buffer, len);
free(buffer);
} else {
free(buffer);
lua_pushnil(L);
lua_pushinteger(L, (len == 0) ? 0 : errno);
return 2;
}
/* fprintf(stderr, "%s:%s[%d] %d %d\n", __FILE__, __func__, __LINE__, sockfd, len); */
return 1;
}
static int webuci_close(lua_State *L)
{
int sockfd = lua_tointeger(L, lua_upvalueindex(1));
int result = shutdown(sockfd, SHUT_RDWR);
close(sockfd);
/*log_printf("%s:%s[%d] %d %d\n", __FILE__, __func__, __LINE__, sockfd, result);*/
if (result < 0) {
lua_pushnil(L);
lua_pushinteger(L, errno);
return 2;
} else {
lua_pushboolean(L, 1);
return 1;
}
}
static int webuci_write(lua_State *L)
{
luaL_checktype(L, 1, LUA_TSTRING);
size_t len;
const char *data = lua_tolstring(L, 1, &len);
int sockfd = lua_tointeger(L, lua_upvalueindex(1));
len = send(sockfd, data, len, 0);
/*log_printf("%s:%s[%d] %d %d - %s\n", __FILE__, __func__, __LINE__, sockfd, len, data);*/
if (len < 0) {
lua_pushnil(L);
lua_pushinteger(L, errno);
return 2;
} else {
lua_pushinteger(L, len);
return 1;
}
}
static int webuci_sendfile(lua_State *L)
{
FILE **fp = (FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE);
if (*fp == NULL) {
return luaL_error(L, "attempt to use a closed file");
}
off_t offset = luaL_checkinteger(L, 2);
size_t size = luaL_checkinteger(L, 3);
int sockfd = lua_tointeger(L, lua_upvalueindex(1));
int cork = 1;
setsockopt(sockfd, SOL_TCP, TCP_CORK, &cork, sizeof(cork));
#ifdef __UCLIBC__
// uclibc is teh sux, it does not implement sendfile correctly
char tmp[1024];
size_t c, toread = size, oldpos = ftell(*fp);
fseek(*fp, offset, SEEK_SET);
while(toread > 0 && (c = fread(tmp, 1, (toread < 1024) ? toread : 1024, *fp)) > 0)
{
size += c;
toread -= c;
write(sockfd, tmp, c);
}
fseek(*fp, oldpos, SEEK_SET);
#else
size = sendfile(sockfd, fileno(*fp), &offset, size);
/*log_printf("%s:%s[%d] %d %d - %d\n", __FILE__, __func__, __LINE__, sockfd, fileno(*fp), size);*/
#endif
cork = 0;
setsockopt(sockfd, SOL_TCP, TCP_CORK, &cork, sizeof(cork));
if (size < 1) {
lua_pushnil(L);
lua_pushinteger(L, errno);
} else {
lua_pushinteger(L, size);
lua_pushinteger(L, offset);
}
return 2;
}
static void load_luci(const char *plugindir)
{
luaplugin_init(&ctx, plugindir);
luaplugin_scan(&ctx);
list_for_each_entry(e, &ctx.entries, list)
{
lua_pushstring(ctx.L, "initialize");
luaplugin_call(e, 0);
}
list_for_each_entry(e, &ctx.entries, list)
{
lua_pushstring(ctx.L, "register");
luaplugin_call(e, 0);
}
list_for_each_entry(e, &ctx.entries, list)
{
lua_pushstring(ctx.L, "filter");
luaplugin_call(e, 0);
}
}
static void run_luci(int sockfd)
{
lua_pushinteger(ctx.L, sockfd);
lua_pushcclosure(ctx.L, webuci_read, 1);
lua_setfield(ctx.L, LUA_GLOBALSINDEX, "webuci_read");
lua_pushinteger(ctx.L, sockfd);
lua_pushcclosure(ctx.L, webuci_write, 1);
lua_setfield(ctx.L, LUA_GLOBALSINDEX, "webuci_write");
lua_pushinteger(ctx.L, sockfd);
lua_pushcclosure(ctx.L, webuci_close, 1);
lua_setfield(ctx.L, LUA_GLOBALSINDEX, "webuci_close");
lua_pushinteger(ctx.L, sockfd);
lua_pushcclosure(ctx.L, webuci_sendfile, 1);
lua_setfield(ctx.L, LUA_GLOBALSINDEX, "webuci_sendfile");
list_for_each_entry(e, &ctx.entries, list)
{
lua_pushstring(ctx.L, "accept");
luaplugin_call(e, 0);
}
}
static void cleanup_luci(void)
{
luaplugin_done(&ctx);
}
int main(int argc, char **argv)
{
int sockfd, new_fd;
struct sockaddr_storage their_addr;
socklen_t sin_size;
int yes = 1;
struct sockaddr_in myaddr;
log_start(1);
load_config();
setup_signals();
/* used by sdk to override plugin dir */
if(argc != 2)
{
load_luci(plugin_path);
} else {
load_luci(argv[1]);
port = 8080;
}
myaddr.sin_family = AF_INET;
myaddr.sin_port = htons(port);
//inet_pton(AF_INET, "63.161.169.137", &myaddr.sin_addr.s_addr);
myaddr.sin_addr.s_addr = INADDR_ANY;
sockfd = socket(PF_INET, SOCK_STREAM, 0);
if(sockfd == -1)
{
perror("server: socket");
exit(1);
}
if(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1)
{
perror("setsockopt");
exit(1);
}
if(bind(sockfd, (struct sockaddr *)&myaddr, sizeof(myaddr)) == -1)
{
close(sockfd);
perror("server: bind");
exit(1);
}
if(listen(sockfd, BACKLOG) == -1)
{
perror("listen");
exit(1);
}
/*log_printf("server: waiting for connections...\n");*/
while(1)
{
sin_size = sizeof their_addr;
new_fd = accept(sockfd, (struct sockaddr *)&their_addr, &sin_size);
if(new_fd == -1)
{
perror("accept");
continue;
}
/*inet_ntop(their_addr.ss_family,
(void*)&((struct sockaddr_in*)&their_addr)->sin_addr, s, sizeof s);
log_printf("server: got connection from %s\n", s);*/
if(!fork())
{
/* child */
close(sockfd);
setsockopt(new_fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
setsockopt(new_fd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));
run_luci(new_fd);
cleanup_luci();
close(new_fd);
exit(0);
}
close(new_fd);
}
return 0;
}

View File

@@ -0,0 +1,29 @@
function initialize()
pcall(function()
local SYSROOT = os.getenv("LUCI_SYSROOT")
require "uci"
require "luci.model.uci".cursor = function(config, save)
return uci.cursor(config or SYSROOT .. "/etc/config", save or SYSROOT .. "/tmp/.uci")
end
local x = require "luci.uvl".UVL.__init__
require "luci.uvl".UVL.__init__ = function(self, schemedir)
x(self, schemedir or SYSROOT .. "/lib/uci/schema")
end
require("luci.sys")
luci.sys.user.checkpasswd = function() return true end
require "luci.dispatcher"
require "luci.uvl"
require "luci.cbi"
require "luci.template"
require "luci.json"
end)
end
-- Initialize LuCI
function register()
local lucihnd = require "luci.ttpd.handler.luci"
httpd.server:get_default_vhost():set_handler("/luci", lucihnd.Luci())
end

View File

@@ -0,0 +1,92 @@
--[[
HTTP server implementation for LuCI - luci handler
(c) 2008 Steven Barth <steven@midlink.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
local dsp = require "luci.dispatcher"
local util = require "luci.util"
local http = require "luci.http"
local ltn12 = require "luci.ltn12"
local mod = require "luci.ttpd.module"
local table = require "table"
local coroutine = require "coroutine"
module "luci.ttpd.handler.luci"
Luci = util.class(mod.Handler)
Response = mod.Response
function Luci.__init__(self, limit)
mod.Handler.__init__(self)
end
function Luci.handle_head(self, ...)
return (self:handle_get(...))
end
function Luci.handle_post(self, ...)
return self:handle_get(...)
end
function Luci.handle_get(self, request, sourcein, sinkerr)
local r = http.Request(
request.env,
sourcein,
sinkerr
)
local res, id, data1, data2 = true, 0, nil, nil
local headers = {}
local status = 200
local active = true
local x = coroutine.create(dsp.httpdispatch)
while not id or id < 3 do
res, id, data1, data2 = coroutine.resume(x, r)
if not res then
status = 500
headers["Content-Type"] = "text/plain"
local err = {id}
return Response( status, headers ), function() return table.remove(err) end
end
if id == 1 then
status = data1
elseif id == 2 then
headers[data1] = data2
end
end
local function iter()
local res, id, data = coroutine.resume(x)
if not res then
return nil, id
elseif not id or not active then
return true
elseif id == 5 then
active = false
while (coroutine.resume(x)) do
end
return nil
elseif id == 4 then
return data
end
if coroutine.status(x) == "dead" then
return nil
end
end
return Response(status, headers), iter
end

View File

@@ -1,22 +0,0 @@
#!/bin/sh /etc/rc.common
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/luci-httpd
NAME=luci-httpd
DESC="HTTP server"
START=49
test -x $DAEMON || exit 0
set -e
start() {
echo -n "Starting $DESC: $NAME"
start-stop-daemon -S -b -q -x $DAEMON
echo "."
}
stop() {
echo -n "Stopping $DESC: $NAME"
start-stop-daemon -K -q -x $DAEMON
echo "."
}

View File

@@ -1,31 +0,0 @@
#!/usr/bin/lua
require("luci.httpd")
require("luci.httpd.server")
require("luci.httpd.handler.file")
require("luci.httpd.handler.luci")
DOCROOT = "/www"
PORT = 8080
collectgarbage("setpause", 150)
serversocket = luci.httpd.Socket("0.0.0.0", PORT)
server = luci.httpd.server.Server()
vhost = luci.httpd.server.VHost()
server:set_default_vhost(vhost)
filehandler = luci.httpd.handler.file.Simple(DOCROOT)
vhost:set_default_handler(filehandler)
lucihandler = luci.httpd.handler.luci.Luci()
vhost:set_handler("/luci", lucihandler)
io.stderr:write("Starting LuCI HTTPD on port " .. PORT .. "...\n")
io.stderr:write("Point your browser to http://localhost:" .. PORT .. "/luci\n")
luci.httpd.register(serversocket, server:create_daemon_handlers())
luci.httpd.run()

View File

@@ -0,0 +1,17 @@
-- Initialize LuCI
function initialize()
pcall(function()
require "luci.dispatcher"
require "luci.uvl"
require "luci.cbi"
require "luci.template"
require "luci.json"
end)
end
-- Register luci
function register()
local lucihnd = require "luci.ttpd.handler.luci".Luci()
httpd.server:get_default_vhost():set_handler("/luci", lucihnd)
httpd.server:get_default_vhost():set_handler("/cgi-bin/luci", lucihnd)
end

2
libs/uvldoc/Makefile Normal file
View File

@@ -0,0 +1,2 @@
include ../../build/config.mk
include ../../build/module.mk

Some files were not shown because too many files have changed in this diff Show More