PKG_NAME:=db47
PKG_VERSION:=$(BASE_VERSION).4.NC
-PKG_RELEASE:=2
+PKG_RELEASE:=3
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/db-$(BASE_VERSION).NC
+PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(BASE_VERSION).NC
PKG_SOURCE:=db-$(BASE_VERSION).NC.tar.gz
PKG_SOURCE_URL:=http://download.oracle.com/berkeley-db/
PKG_MD5SUM:=073ab7f20d24b3872a51ca762f5090e7
include $(INCLUDE_DIR)/package.mk
-define Package/libdb47/Default
+define Package/libdb47
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libxml2
- PROVIDES:=libdb47
+ TITLE:=Berkeley DB library (4.7)
URL:=http://www.oracle.com/us/products/database/berkeley-db
-endef
-
-define Package/libdb47/Default/description
- Berkeley DB library (4.7).
-endef
-
-define Package/libdb47
-$(call Package/libdb47/Default)
- VARIANT:=small
- TITLE:=Berkeley DB library (4.7) (without statistics etc. support)
+ PROVIDES:=libdb47-full
endef
define Package/libdb47/description
-$(call Package/libdb47/Default/description)
- This package is not built with statistics etc. support.
-endef
-
-define Package/libdb47-full
-$(call Package/libdb47/Default)
- VARIANT:=full
- TITLE:=Berkeley DB library (4.7) (with statistics etc. support)
-endef
-
-define Package/libdb47-full/description
-$(call Package/libdb47/Default/description)
- This package is built with statistics etc. support.
+ Berkeley DB library (4.7).
endef
-define Package/libdb47xx/Default
+define Package/libdb47xx
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libdb47 $(CXX_DEPENDS)
+ TITLE:=Berkeley DB library (4.7) for C++
URL:=http://www.oracle.com/us/products/database/berkeley-db
-endef
-
-define Package/libdb47xx/Default/description
- Berkeley DB library (4.7). C++ wrapper.
-endef
-
-define Package/libdb47xx
-$(call Package/libdb47xx/Default)
- VARIANT:=small
- TITLE:=Berkeley DB library (4.7) for C++ (without statistics etc. support)
+ PROVIDES:=libdb47xx-full
endef
define Package/libdb47xx/description
-$(call Package/libdb47xx/Default/description)
- This package is not built with statistics etc. support.
-endef
-
-define Package/libdb47xx-full
-$(call Package/libdb47xx/Default)
- VARIANT:=full
- TITLE:=Berkeley DB library (4.7) for C++ (with statistics etc. support)
-endef
-
-define Package/libdb47xx-full/description
-$(call Package/libdb47xx/Default/description)
- This package is built with statistics etc. support.
+ Berkeley DB library (4.7). C++ wrapper.
endef
CONFIGURE_PATH = build_unix
--disable-rpc \
--enable-compat185 \
--disable-debug \
- --enable-cryptography \
$(if $(CONFIG_PACKAGE_libdb47xx),--enable-cxx,--disable-cxx)
-ifeq ($(BUILD_VARIANT),small)
- CONFIGURE_ARGS += --enable-smallbuild
-endif
-
TARGET_CFLAGS += $(FPIC)
define Build/Compile
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb-*.so $(1)/usr/lib/
endef
-define Package/libdb47-full/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb-*.so $(1)/usr/lib/
-endef
-
define Package/libdb47xx/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb_cxx-*.so $(1)/usr/lib/
endef
-define Package/libdb47xx-full/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb_cxx-*.so $(1)/usr/lib/
-endef
-
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/db.h $(1)/usr/include/
endef
$(eval $(call BuildPackage,libdb47))
-$(eval $(call BuildPackage,libdb47-full))
$(eval $(call BuildPackage,libdb47xx))
-$(eval $(call BuildPackage,libdb47xx-full))
PKG_NAME:=bogofilter
PKG_VERSION:=1.2.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILE:=COPYING
define Package/bogofilter
SECTION:=mail
CATEGORY:=Mail
- DEPENDS:=+libdb47-full
+ DEPENDS:=+libdb47
TITLE:=bogofilter
MAINTAINER:=W. Michael Petullo <mike@flyn.org>
URL:=http://bogofilter.sourceforge.net/
include $(TOPDIR)/rules.mk
PKG_NAME:=ffmpeg
-PKG_VERSION:=2.3.4
+PKG_VERSION:=2.4.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://ffmpeg.org/releases/
-PKG_MD5SUM:=d6a0c7f0827a2446ca2bed11ac9bf608
+PKG_MD5SUM:=9e6163b09b7b9331b834d80874c2c0ff
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
define Package/libffmpeg-custom
$(call Package/libffmpeg/Default)
TITLE+= (custom)
- DEPENDS+= @DEVEL +libopus +libspeex
+ DEPENDS+= @DEVEL @!ALL +libopus +libspeex
VARIANT:=custom
MENU:=1
endef
include $(TOPDIR)/rules.mk
PKG_NAME:=shairport
-PKG_VERSION:=2014-08-22
+PKG_VERSION:=2014-10-28
PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
config shairport main
+ option disabled '1'
+ option respawn '1'
option bname 'AirPort'
option password ''
option port '5002'
- option buffer '256'
- option log ''
+ option buffer ''
+ option log_file ''
+ option err_file ''
+ option meta_dir ''
option cmd_start ''
option cmd_stop ''
- option cmd_wait ''
+ option cmd_wait '0'
option audio_output 'alsa'
option mdns 'avahi'
option mixer_type ''
option mixer_control ''
option mixer_index ''
+
+ # options for ao output
+ option ao_driver ''
+ option ao_name ''
+ option ao_id ''
+ option ao_options ''
+
+ # options for pipe output
+ option output_fifo ''
+
+ # options for pulse output
+ option pulse_server ''
+ option pulse_sink ''
+ option pulse_appname ''
start_instance() {
local cfg="$1"
- local ao dev
+ local ao dev aux
+
+ config_get_bool aux "$cfg" 'disabled' '0'
+ [ "$aux" = 1 ] && return 1
procd_open_instance
procd_set_param command /usr/bin/shairport
append_arg "$cfg" bname "-a" "AirPort"
- append_arg "$cfg" log "-l"
- append_arg "$cfg" buffer "-b" "256"
- append_arg "$cfg" port "-p" "5002"
+ append_arg "$cfg" log_file "-l"
+ append_arg "$cfg" err_file "-e"
+ append_arg "$cfg" meta_dir "-M"
+ append_arg "$cfg" buffer "-b"
+ append_arg "$cfg" port "-p"
append_arg "$cfg" password "-k"
append_arg "$cfg" mdns "-m"
append_arg "$cfg" mixer_control "-c"
append_arg "$cfg" mixer_index "-i"
fi
+ elif [ "$ao" = "ao" ]; then
+ config_get dev "$cfg" ao_driver ""
+ if [ -n "$dev" ]; then
+ procd_append_param command "--"
+ append_arg "$cfg" ao_driver "-d"
+ append_arg "$cfg" ao_id "-i"
+ append_arg "$cfg" ao_name "-n"
+ append_arg "$cfg" ao_options "-o"
+ fi
+ elif [ "$ao" = "pipe" ]; then
+ config_get dev "$cfg" output_fifo ""
+ if [ -n "$dev" ]; then
+ procd_append_param command "--"
+ append_arg "$cfg" output_fifo ""
+ fi
+ elif [ "$ao" = "pulse" ]; then
+ config_get dev "$cfg" pulse_server ""
+ if [ -n "$dev" ]; then
+ procd_append_param command "--"
+ append_arg "$cfg" pulse_server "-a"
+ append_arg "$cfg" pulse_sink "-s"
+ append_arg "$cfg" pulse_appname "-n"
+ fi
fi
+ config_get_bool aux "$cfg" 'respawn' '0'
+ [ "$aux" = 1 ] && procd_set_param respawn
+
procd_close_instance
}
--- /dev/null
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=kismet
+PKG_VERSION:=2013-03-R1b
+PKG_RELEASE:=1
+
+PKG_LICENSE:=LGPLv2.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.kismetwireless.net/code
+PKG_MD5SUM:=6cdcd78baf2e15edbe8a9de3c5493f02
+
+PKG_BUILD_DEPENDS:=libpcap libncurses libpcre
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/kismet/Default
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Kismet
+ MAINTAINER:=Sebastian Wendel <packages@sourceindex.de>
+ DEPENDS:= $(CXX_DEPENDS) +libnl
+ URL:=http://www.kismetwireless.net/
+ SUBMENU:=wireless
+endef
+
+define Package/kismet/Default/description
+ An 802.11 layer2 wireless network detector, sniffer, and intrusion
+ detection system.
+endef
+
+define Package/kismet-client/conffiles
+/etc/kismet/kismet.conf
+endef
+
+define Package/kismet-drone/conffiles
+/etc/kismet/kismet_drone.conf
+endef
+
+define Package/kismet-server/conffiles
+/etc/kismet/kismet.conf
+endef
+
+define Package/kismet-client
+$(call Package/kismet/Default)
+ TITLE+= client
+ DEPENDS+= +libncurses
+endef
+
+define Package/kismet-client/description
+$(call Package/kismet/Default/description)
+ This package contains the kismet text interface client.
+endef
+
+define Package/kismet-drone
+$(call Package/kismet/Default)
+ DEPENDS+= +libpcap +libpcre +libcap +wireless-tools
+ TITLE+= drone
+endef
+
+define Package/kismet-drone/description
+$(call Package/kismet/Default/description)
+ This package contains the kismet remote sniffing.and monitoring drone.
+endef
+
+define Package/kismet-server
+$(call Package/kismet/Default)
+ DEPENDS+= +libpcap +libpcre +libcap +wireless-tools
+ TITLE+= server
+endef
+
+define Package/kismet-server/description
+$(call Package/kismet/Default/description)
+ This package contains the kismet server.
+endef
+
+CONFIGURE_ARGS += \
+ --sysconfdir=/etc/kismet \
+
+CONFIGURE_VARS += \
+ CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \
+ LIBS="-lm" \
+ CLIENTCLIBS="-lm"
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ LD="$(TARGET_CXX)" \
+ all
+endef
+
+define Package/kismet/install
+ $(INSTALL_DIR) $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/kismet $(1)/usr/bin/kismet
+endef
+
+define Package/kismet-client/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_client $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/etc/kismet/
+ $(INSTALL_CONF) ./files/kismet.conf $(1)/etc/kismet/
+endef
+
+define Package/kismet-drone/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_drone $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/etc/kismet/
+ $(INSTALL_CONF) ./files/kismet_drone.conf $(1)/etc/kismet/
+
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) ./files/kismet_drone.config $(1)/etc/config/kismet_drone
+
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/kismet_drone.init $(1)/etc/init.d/kismet_drone
+endef
+
+define Package/kismet-server/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_server $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/etc/kismet/
+ $(INSTALL_CONF) ./files/kismet.conf $(1)/etc/kismet/
+
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) ./files/kismet_server.config $(1)/etc/config/kismet_server
+
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/kismet_server.init $(1)/etc/init.d/kismet_server
+endef
+
+$(eval $(call BuildPackage,kismet-client))
+$(eval $(call BuildPackage,kismet-drone))
+$(eval $(call BuildPackage,kismet-server))
--- /dev/null
+# Kismet config file
+# Most of the "static" configs have been moved to here -- the command line
+# config was getting way too crowded and cryptic. We want functionality,
+# not continually reading --help!
+
+# Version of Kismet config
+version=2009-newcore
+
+# Name of server (Purely for organizational purposes)
+# If commented out, defaults to host name of system
+# servername=Kismet Server
+
+# Prefix of where we log (as used in the logtemplate later)
+logprefix=/tmp
+
+# Do we process the contents of data frames? If this is enabled, data
+# frames will be truncated to the headers only immediately after frame type
+# detection. This will disable IP detection, etc, however it is likely
+# safer (and definitely more polite) if monitoring networks you do not own.
+# hidedata=true
+
+# Do we allow plugins to be used? This will load plugins from the system
+# and user plugin directiories when set to true (See the README for the default
+# plugin locations).
+allowplugins=false
+
+# See the README for full information on the new source format
+# ncsource=interface:options
+# for example:
+# ncsource=wifi0:type=madwifi
+# ncsource=wlan0:name=intel,hop=false,channel=11
+ncsource=wlan0
+
+# Comma-separated list of sources to enable. This is only needed if you defined
+# multiple sources and only want to enable some of them. By default, all defined
+# sources are enabled.
+# For example, if sources with name=prismsource and name=ciscosource are defined,
+# and you only want to enable those two:
+# enablesources=prismsource,ciscosource
+
+# Control which channels we like to spend more time on. By default, the list
+# of channels is pulled from the driver automatically. By setting preferred channels,
+# if they are present in the channel list, they'll be set with a timing delay so that
+# more time is spent on them. Since 1, 6, 11 are the common default channels, it makes
+# sense to spend more time monitoring them.
+# For finer control, see further down in the config for the channellist= directives.
+preferredchannels=1,6,11
+
+# How many channels per second do we hop? (1-10)
+channelvelocity=3
+
+# By setting the dwell time for channel hopping we override the channelvelocity
+# setting above and dwell on each channel for the given number of seconds.
+#channeldwell=10
+
+# Channels are defined as:
+# channellist=name:ch1,ch2,ch3
+# or
+# channellist=name:range-start-end-width-offset,ch,range,ch,...
+#
+# Channels may be a numeric channel or a frequency
+#
+# Channels may specify an additional wait period. For common default channels,
+# an additional wait period can be useful. Wait periods delay for that number
+# of times per second - so a configuration hopping 10 times per second with a
+# channel of 6:3 would delay 3/10ths of a second on channel 6.
+#
+# Channel lists may have up to 256 channels and ranges (combined). For power
+# users scanning more than 256 channels with a single card, ranges must be used.
+#
+# Ranges are meant for "power users" who wish to define a very large number of
+# channels. A range may specify channels or frequencies, and will automatically
+# sort themselves to cover channels in a non-overlapping fashion. An example
+# range for the normal 802.11b/g spectrum would be:
+#
+# range-1-11-3-1
+#
+# which indicates starting at 1, ending at 11, a channel width of 3 channels,
+# incrementing by one. A frequency based definition would be:
+#
+# range-2412-2462-22-5
+#
+# since 11g channels are 22 mhz wide and 5 mhz apart.
+#
+# Ranges have the flaw that they cannot be shared between sources in a non-overlapping
+# way, so multiple sources using the same range may hop in lockstep with each other
+# and duplicate the coverage.
+#
+# channellist=demo:1:3,6:3,11:3,range-5000-6000-20-10
+
+# Default channel lists
+# These channel lists MUST BE PRESENT for Kismet to work properly. While it is
+# possible to change these, it is not recommended. These are used when the supported
+# channel list can not be found for the source; to force using these instead of
+# the detected supported channels, override with channellist= in the source defintion
+#
+# IN GENERAL, if you think you want to modify these, what you REALLY want to do is
+# copy them and use channellist= in the packet source.
+channellist=IEEE80211b:1:3,6:3,11:3,2,7,3,8,4,9,5,10
+channellist=IEEE80211a:36,40,44,48,52,56,60,64,149,153,157,161,165
+channellist=IEEE80211ab:1:3,6:3,11:3,2,7,3,8,4,9,5,10,36,40,44,48,52,56,60,64,149,153,157,161,165
+
+# Client/server listen config
+listen=tcp://127.0.0.1:2501
+#listen=tcp://0.0.0.0:2501
+
+# People allowed to connect, comma seperated IP addresses or network/mask
+# blocks. Netmasks can be expressed as dotted quad (/255.255.255.0) or as
+# numbers (/24)
+allowedhosts=127.0.0.1
+# Maximum number of concurrent GUI's
+maxclients=5
+# Maximum backlog before we start throwing out or killing clients. The
+# bigger this number, the more memory and the more power it will use.
+maxbacklog=5000
+
+# Server + Drone config options. To have a Kismet server export live packets
+# as if it were a drone, uncomment these.
+# dronelisten=tcp://127.0.0.1:3501
+# droneallowedhosts=127.0.0.1
+# dronemaxclients=5
+# droneringlen=65535
+
+# OUI file, expected format 00:11:22<tab>manufname
+# IEEE OUI file used to look up manufacturer info. We default to the
+# wireshark one since most people have that.
+#ouifile=/usr/share/manuf
+
+# Do we have a GPS?
+gps=false
+# Do we use a locally serial attached GPS, or use a gpsd server, or
+# use a fixed virtual gps?
+# (Pick only one)
+gpstype=gpsd
+# Host:port that GPSD is running on. This can be localhost OR remote!
+gpshost=localhost:2947
+
+
+# gpstype=serial
+# What serial device do we look for the GPS on?
+# gpsdevice=/dev/rfcomm0
+
+# gpstype=virtual
+# gpsposition=100,-50
+# gpsaltitude=1234
+
+# Do we lock the mode? This overrides coordinates of lock "0", which will
+# generate some bad information until you get a GPS lock, but it will
+# fix problems with GPS units with broken NMEA that report lock 0
+gpsmodelock=false
+# Do we try to reconnect if we lose our link to the GPS, or do we just
+# let it die and be disabled?
+gpsreconnect=true
+
+# Do we export packets over tun/tap virtual interfaces?
+tuntap_export=false
+# What virtual interface do we use
+tuntap_device=kistap0
+
+# Packet filtering options:
+# filter_tracker - Packets filtered from the tracker are not processed or
+# recorded in any way.
+# filter_export - Controls what packets influence the exported CSV, network,
+# xml, gps, etc files.
+# All filtering options take arguments containing the type of address and
+# addresses to be filtered. Valid address types are 'ANY', 'BSSID',
+# 'SOURCE', and 'DEST'. Filtering can be inverted by the use of '!' before
+# the address. For example,
+# filter_tracker=ANY(!"00:00:DE:AD:BE:EF")
+# has the same effect as the previous mac_filter config file option.
+# filter_tracker=...
+# filter_dump=...
+# filter_export=...
+# filter_netclient=...
+
+# Alerts to be reported and the throttling rates.
+# alert=name,throttle/unit,burst
+# The throttle/unit describes the number of alerts of this type that are
+# sent per time unit. Valid time units are second, minute, hour, and day.
+# Burst describes the number of alerts sent before throttling takes place.
+# For example:
+# alert=FOO,10/min,5
+# Would allow 5 alerts through before throttling is enabled, and will then
+# limit the number of alerts to 10 per minute.
+# A throttle rate of 0 disables throttling of the alert.
+# See the README for a list of alert types.
+alert=ADHOCCONFLICT,5/min,1/sec
+alert=AIRJACKSSID,5/min,1/sec
+alert=APSPOOF,10/min,1/sec
+alert=BCASTDISCON,5/min,2/sec
+alert=BSSTIMESTAMP,5/min,1/sec
+alert=CHANCHANGE,5/min,1/sec
+alert=CRYPTODROP,5/min,1/sec
+alert=DISASSOCTRAFFIC,10/min,1/sec
+alert=DEAUTHFLOOD,5/min,2/sec
+alert=DEAUTHCODEINVALID,5/min,1/sec
+alert=DISCONCODEINVALID,5/min,1/sec
+alert=DHCPNAMECHANGE,5/min,1/sec
+alert=DHCPOSCHANGE,5/min,1/sec
+alert=DHCPCLIENTID,5/min,1/sec
+alert=DHCPCONFLICT,10/min,1/sec
+alert=NETSTUMBLER,5/min,1/sec
+alert=LUCENTTEST,5/min,1/sec
+alert=LONGSSID,5/min,1/sec
+alert=MSFBCOMSSID,5/min,1/sec
+alert=MSFDLINKRATE,5/min,1/sec
+alert=MSFNETGEARBEACON,5/min,1/sec
+alert=NULLPROBERESP,5/min,1/sec
+alert=PROBENOJOIN,5/min,1/sec
+
+# Controls behavior of the APSPOOF alert. SSID may be a literal match (ssid=) or
+# a regex (ssidregex=) if PCRE was available when kismet was built. The allowed
+# MAC list must be comma-separated and enclosed in quotes if there are multiple
+# MAC addresses allowed. MAC address masks are allowed.
+#apspoof=Foo1:ssidregex="(?i:foobar)",validmacs=00:11:22:33:44:55
+#apspoof=Foo2:ssid="Foobar",validmacs="00:11:22:33:44:55,aa:bb:cc:dd:ee:ff"
+
+# Known WEP keys to decrypt, bssid,hexkey. This is only for networks where
+# the keys are already known, and it may impact throughput on slower hardware.
+# Multiple wepkey lines may be used for multiple BSSIDs.
+# wepkey=00:DE:AD:C0:DE:00,FEEDFACEDEADBEEF01020304050607080900
+
+# Is transmission of the keys to the client allowed? This may be a security
+# risk for some. If you disable this, you will not be able to query keys from
+# a client.
+allowkeytransmit=true
+
+# How often (in seconds) do we write all our data files (0 to disable)
+writeinterval=10
+
+# Do we use sound?
+# Not to be confused with GUI sound parameter, this controls wether or not the
+# server itself will play sound. Primarily for headless or automated systems.
+enablesound=false
+# Path to sound player
+soundbin=play
+
+sound=newnet,true
+sound=newcryptnet,true
+sound=packet,true
+sound=gpslock,true
+sound=gpslost,true
+sound=alert,true
+
+# Does the server have speech? (Again, not to be confused with the GUI's speech)
+enablespeech=false
+# Binary used for speech (if not in path, full path must be specified)
+speechbin=flite
+# Specify raw or festival; Flite (and anything else that doesn't need formatting
+# around the string to speak) is 'raw', festival requires the string be wrapped in
+# SayText("...")
+speechtype=raw
+
+# How do we speak? Valid options:
+# speech Normal speech
+# nato NATO spellings (alpha, bravo, charlie)
+# spell Spell the letters out (aye, bee, sea)
+speechencoding=nato
+
+speech=new,"New network detected s.s.i.d. %1 channel %2"
+speech=alert,"Alert %1"
+speech=gpslost,"G.P.S. signal lost"
+speech=gpslock,"G.P.S. signal O.K."
+
+# How many alerts do we backlog for new clients? Only change this if you have
+# a -very- low memory system and need those extra bytes, or if you have a high
+# memory system and a huge number of alert conditions.
+alertbacklog=50
+
+# File types to log, comma seperated. Built-in log file types:
+# alert Text file of alerts
+# gpsxml XML per-packet GPS log
+# nettxt Networks in text format
+# netxml Networks in XML format
+# pcapdump tcpdump/wireshark compatible pcap log file
+# string All strings seen (increases CPU load)
+logtypes=pcapdump,gpsxml,netxml,alert
+
+# Format of the pcap dump (PPI or 80211)
+pcapdumpformat=ppi
+# pcapdumpformat=80211
+
+# Default log title
+logdefault=Kismet
+
+# logtemplate - Filename logging template.
+# This is, at first glance, really nasty and ugly, but you'll hardly ever
+# have to touch it so don't complain too much.
+#
+# %p is replaced by the logging prefix + '/'
+# %n is replaced by the logging instance name
+# %d is replaced by the starting date as Mon-DD-YYYY
+# %D is replaced by the current date as YYYYMMDD
+# %t is replaced by the starting time as HH-MM-SS
+# %i is replaced by the increment log in the case of multiple logs
+# %l is replaced by the log type (pcapdump, strings, etc)
+# %h is replaced by the home directory
+
+logtemplate=%p%n-%D-%t-%i.%l
+
+# Where state info, etc, is stored. You shouldnt ever need to change this.
+# This is a directory.
+configdir=%h/.kismet/
+
--- /dev/null
+# Kismet drone config file
+
+version=newcore.1
+
+# Name of drone server (informational)
+servername=Kismet-Drone
+
+# Drone configuration
+# Protocol, interface, and port to listen on
+dronelisten=tcp://127.0.0.1:2502
+# Hosts allowed to connect, comma separated. May include netmasks.
+# allowedhosts=127.0.0.1,10.10.10.0/255.255.255.0
+droneallowedhosts=127.0.0.1
+# Maximum number of drone clients
+dronemaxclients=10
+droneringlen=65535
+
+# Do we have a GPS?
+gps=true
+# Do we use a locally serial attached GPS, or use a gpsd server?
+# (Pick only one)
+gpstype=gpsd
+# gpstype=serial
+# What serial device do we look for the GPS on?
+gpsdevice=/dev/rfcomm0
+# Host:port that GPSD is running on. This can be localhost OR remote!
+gpshost=localhost:2947
+# Do we lock the mode? This overrides coordinates of lock "0", which will
+# generate some bad information until you get a GPS lock, but it will
+# fix problems with GPS units with broken NMEA that report lock 0
+gpsmodelock=false
+# Do we try to reconnect if we lose our link to the GPS, or do we just
+# let it die and be disabled?
+gpsreconnect=true
+
+# See the README for full information on the new source format
+# ncsource=interface:options
+ncsource=null
+# for example:
+# ncsource=wlan0
+# ncsource=wifi0:type=madwifi
+# ncsource=wlan0:name=intel,hop=false,channel=11
+
+# Special per-source options
+# sourceopts=[sourcename|*]:opt1,opt2
+# sourceopts=*:fuzzycrypt,weakvalidate
+
+# Comma-separated list of sources to enable, if you don't want to enable all
+# the sources you defined.
+# enablesource=source1,source2
+
+# How many channels per second do we hop? (1-10)
+channelvelocity=5
+
+# By setting the dwell time for channel hopping we override the channelvelocity
+# setting above and dwell on each channel for the given number of seconds.
+#channeldwell=10
+
+# Users outside the US might want to use this list:
+# channellist=IEEE80211b:1,7,13,2,8,3,14,9,4,10,5,11,6,12
+channellist=IEEE80211b:1:3,6:3,11:3,2,7,3,8,4,9,5,10
+
+# US IEEE 80211a
+channellist=IEEE80211a:36,40,44,48,52,56,60,64,149,153,157,161,165
+
+# Combo
+channellist=IEEE80211ab:1:3,6:3,11:3,2,7,3,8,4,9,5,10,36,40,44,48,52,56,60,64,149,153,157,161,165
+
+
--- /dev/null
+config kismet_drone
+ option enabled 0
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2013-2014 OpenWrt.org
+
+START=99
+STOP=99
+
+USE_PROCD=1
+PROG=/usr/bin/kismet_drone
+NAME=kismet_drone
+
+kismet_drone_instance() {
+ procd_open_instance
+ procd_set_param command "${PROG}"
+ procd_append_param command -f /etc/kismet/kismet_drone.conf -s
+ procd_set_param respawn
+ procd_close_instance
+}
+
+start_service() {
+ config_load "${NAME}"
+ config_foreach kismet_drone_instance
+}
+
+stop_service() {
+ service_stop "${PROG}"
+}
--- /dev/null
+config kismet_server
+ option enabled 0
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2013-2014 OpenWrt.org
+
+START=99
+STOP=99
+
+USE_PROCD=1
+PROG=/usr/bin/kismet_server
+NAME=kismet_server
+
+kismet_server_instance() {
+ procd_open_instance
+ procd_set_param command "${PROG}"
+ procd_append_param command -f /etc/kismet/kismet.conf -s
+ procd_set_param respawn
+ procd_close_instance
+}
+
+start_service() {
+ config_load "${NAME}"
+ config_foreach kismet_server_instance
+}
+
+stop_service() {
+ service_stop "${PROG}"
+}
--- /dev/null
+diff --git a/configure b/configure
+index 6936a47..9a85269 100755
+--- a/configure
++++ b/configure
+@@ -6980,9 +6980,6 @@ else
+ fi
+
+
+-# Add additional cflags since some distros bury panel.h
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
+-
+ termcontrol="none";
+
+ if test "$wantclient" = "yes"; then
+++ /dev/null
-# Copyright (C) 2014 Nikos Mavrogiannopoulos
-#
-# 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.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# The full GNU General Public License is included in this distribution in
-# the file called "COPYING".
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luci-app-ocserv
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-app-ocserv
- SECTION:=luci
- CATEGORY:=LuCI
- SUBMENU:=3. Applications
- TITLE:= OpenConnect VPN server configuration and status module
- DEPENDS:=+luci-lib-json +luci-lib-nixio +luci-mod-admin-full +ocserv
- MAINTAINER:= Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-endef
-
-define Package/luci-app-ocserv/description
- ocserv web module for LuCi web interface
-endef
-
-define Build/Prepare
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-# Fixme: How can we add <%+ocserv_status%> in view/admin_status/index.htm?
-define Package/luci-app-ocserv/install
- $(CP) ./files/* $(1)/
-endef
-
-$(eval $(call BuildPackage,luci-app-ocserv))
-
+++ /dev/null
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-
-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$
-]]--
-
-module("luci.controller.ocserv", package.seeall)
-
-function index()
- if not nixio.fs.access("/etc/config/ocserv") then
- return
- end
-
- local page
-
- page = entry({"admin", "services", "ocserv"}, alias("admin", "services", "ocserv", "main"),
- _("OpenConnect VPN"))
- page.dependent = true
-
- page = entry({"admin", "services", "ocserv", "main"},
- cbi("ocserv/main"),
- _("Server Settings"), 200)
- page.dependent = true
-
- page = entry({"admin", "services", "ocserv", "users"},
- cbi("ocserv/users"),
- _("User Settings"), 300)
- page.dependent = true
-
- entry({"admin", "services", "ocserv", "status"},
- call("ocserv_status")).leaf = true
-
- entry({"admin", "services", "ocserv", "disconnect"},
- call("ocserv_disconnect")).leaf = true
-
-end
-
-function ocserv_status()
- local ipt = io.popen("/usr/bin/occtl show users");
-
- if ipt then
-
- local fwd = { }
- while true do
-
- local ln = ipt:read("*l")
- if not ln then break end
-
- local id, user, group, vpn_ip, ip, device, time, cipher, status =
- ln:match("^%s*(%d+)%s+([-_%w]+)%s+([%.%*-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+).*")
- if id then
- fwd[#fwd+1] = {
- id = id,
- user = user,
- group = group,
- vpn_ip = vpn_ip,
- ip = ip,
- device = device,
- time = time,
- cipher = cipher,
- status = status
- }
- end
- end
- ipt:close()
- luci.http.prepare_content("application/json")
- luci.http.write_json(fwd)
- end
-end
-
-function ocserv_disconnect(num)
- local idx = tonumber(num)
- local uci = luci.model.uci.cursor()
-
- if idx and idx > 0 then
- luci.sys.call("/usr/bin/occtl disconnect id %d" % idx)
- luci.http.status(200, "OK")
-
- return
- end
- luci.http.status(400, "Bad request")
-end
+++ /dev/null
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-
-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 niulib = require "luci.niulib"
-]]--
-
-local fs = require "nixio.fs"
-local has_ipv6 = fs.access("/proc/net/ipv6_route")
-
-m = Map("ocserv", translate("OpenConnect VPN"))
-
-s = m:section(TypedSection, "ocserv", "OpenConnect")
-s.anonymous = true
-
-s:tab("general", translate("General Settings"))
-s:tab("ca", translate("CA certificate"))
-s:tab("template", translate("Edit Template"))
-
-local e = s:taboption("general", Flag, "enable", translate("Enable server"))
-e.rmempty = false
-e.default = "1"
-
-function m.on_commit(map)
- luci.sys.call("/usr/bin/occtl reload >/dev/null 2>&1")
-end
-
-function e.write(self, section, value)
- if value == "0" then
- luci.sys.call("/etc/init.d/ocserv stop >/dev/null 2>&1")
- luci.sys.call("/etc/init.d/ocserv disable >/dev/null 2>&1")
- else
- luci.sys.call("/etc/init.d/ocserv enable >/dev/null 2>&1")
- luci.sys.call("/etc/init.d/ocserv restart >/dev/null 2>&1")
- end
- Flag.write(self, section, value)
-end
-
-local o
-
-o = s:taboption("general", ListValue, "auth", translate("User Authentication"),
- translate("The authentication method for the users. The simplest is plain with a single username-password pair. Use PAM modules to authenticate using another server (e.g., LDAP, Radius)."))
-o.rmempty = false
-o.default = "plain"
-o:value("plain")
-o:value("PAM")
-
-o = s:taboption("general", Value, "zone", translate("Firewall Zone"),
- translate("The firewall zone that the VPN clients will be set to"))
-o.nocreate = true
-o.default = "lan"
-o.template = "cbi/firewall_zonelist"
-
-s:taboption("general", Value, "port", translate("Port"),
- translate("The same UDP and TCP ports will be used"))
-s:taboption("general", Value, "max_clients", translate("Max clients"))
-s:taboption("general", Value, "max_same", translate("Max same clients"))
-s:taboption("general", Value, "dpd", translate("Dead peer detection time (secs)"))
-
-local pip = s:taboption("general", Flag, "predictable_ips", translate("Predictable IPs"),
- translate("The assigned IPs will be selected deterministically"))
-pip.default = "1"
-
-local udp = s:taboption("general", Flag, "udp", translate("Enable UDP"),
- translate("Enable UDP channel support; this must be enabled unless you know what you are doing"))
-udp.default = "1"
-
-local cisco = s:taboption("general", Flag, "cisco_compat", translate("AnyConnect client compatibility"),
- translate("Enable support for CISCO AnyConnect clients"))
-cisco.default = "1"
-
-ipaddr = s:taboption("general", Value, "ipaddr", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Network-Address"))
-ipaddr.default = "192.168.100.1"
-
-nm = s:taboption("general", Value, "netmask", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Netmask"))
-nm.default = "255.255.255.0"
-nm:value("255.255.255.0")
-nm:value("255.255.0.0")
-nm:value("255.0.0.0")
-
-if has_ipv6 then
- ip6addr = s:taboption("general", Value, "ip6addr", translate("VPN <abbr title=\"Internet Protocol Version 6\">IPv6</abbr>-Network-Address"), translate("<abbr title=\"Classless Inter-Domain Routing\">CIDR</abbr>-Notation: address/prefix"))
-end
-
-
-tmpl = s:taboption("template", Value, "_tmpl",
- translate("Edit the template that is used for generating the ocserv configuration."))
-
-tmpl.template = "cbi/tvalue"
-tmpl.rows = 20
-
-function tmpl.cfgvalue(self, section)
- return nixio.fs.readfile("/etc/ocserv/ocserv.conf.template")
-end
-
-function tmpl.write(self, section, value)
- value = value:gsub("\r\n?", "\n")
- nixio.fs.writefile("/etc/ocserv/ocserv.conf.template", value)
-end
-
-ca = s:taboption("ca", Value, "_ca",
- translate("View the CA certificate used by this server. You will need to save it as 'ca.pem' and import it into the clients."))
-
-ca.template = "cbi/tvalue"
-ca.rows = 20
-
-function ca.cfgvalue(self, section)
- return nixio.fs.readfile("/etc/ocserv/ca.pem")
-end
-
---[[DNS]]--
-
-s = m:section(TypedSection, "dns", translate("DNS servers"),
- translate("The DNS servers to be provided to clients; can be either IPv6 or IPv4"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-s:option(Value, "ip", translate("IP Address")).rmempty = true
-
---[[Routes]]--
-
-s = m:section(TypedSection, "routes", translate("Routing table"),
- translate("The routing table to be provided to clients; you can mix IPv4 and IPv6 routes, the server will send only the appropriate. Leave empty to set a default route"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-s:option(Value, "ip", translate("IP Address")).rmempty = true
-
-o = s:option(Value, "netmask", translate("Netmask (or IPv6-prefix)"))
-o.default = "255.255.255.0"
-o:value("255.255.255.0")
-o:value("255.255.0.0")
-o:value("255.0.0.0")
-
-
-return m
+++ /dev/null
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-
-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 niulib = require "luci.niulib"
-]]--
-
-local fs = require "nixio.fs"
-local has_ipv6 = fs.access("/proc/net/ipv6_route")
-
-m = Map("ocserv", translate("OpenConnect VPN"))
-
-s = m:section(TypedSection, "ocserv", "OpenConnect")
-s.anonymous = true
-
-s:tab("general", translate("General Settings"))
-s:tab("ca", translate("CA certificate"))
-s:tab("template", translate("Edit Template"))
-
-local e = s:taboption("general", Flag, "enable", translate("Enable server"))
-e.rmempty = false
-e.default = "1"
-
-function m.on_commit(map)
- luci.sys.call("/usr/bin/occtl reload >/dev/null 2>&1")
-end
-
-function e.write(self, section, value)
- if value == "0" then
- luci.sys.call("/etc/init.d/ocserv stop >/dev/null 2>&1")
- luci.sys.call("/etc/init.d/ocserv disable >/dev/null 2>&1")
- else
- luci.sys.call("/etc/init.d/ocserv enable >/dev/null 2>&1")
- luci.sys.call("/etc/init.d/ocserv restart >/dev/null 2>&1")
- end
- Flag.write(self, section, value)
-end
-
-local o
-
-o = s:taboption("general", ListValue, "auth", translate("User Authentication"),
- translate("The authentication method for the users. The simplest is plain with a single username-password pair. Use PAM modules to authenticate using another server (e.g., LDAP, Radius)."))
-o.rmempty = false
-o.default = "plain"
-o:value("plain")
-o:value("PAM")
-
-o = s:taboption("general", Value, "zone", translate("Firewall Zone"),
- translate("The firewall zone that the VPN clients will be set to"))
-o.nocreate = true
-o.default = "lan"
-o.template = "cbi/firewall_zonelist"
-
-s:taboption("general", Value, "port", translate("Port"),
- translate("The same UDP and TCP ports will be used"))
-s:taboption("general", Value, "max_clients", translate("Max clients"))
-s:taboption("general", Value, "max_same", translate("Max same clients"))
-s:taboption("general", Value, "dpd", translate("Dead peer detection time (secs)"))
-
-local pip = s:taboption("general", Flag, "predictable_ips", translate("Predictable IPs"),
- translate("The assigned IPs will be selected deterministically"))
-pip.default = "1"
-
-local udp = s:taboption("general", Flag, "udp", translate("Enable UDP"),
- translate("Enable UDP channel support; this must be enabled unless you know what you are doing"))
-udp.default = "1"
-
-local cisco = s:taboption("general", Flag, "cisco_compat", translate("AnyConnect client compatibility"),
- translate("Enable support for CISCO AnyConnect clients"))
-cisco.default = "1"
-
-ipaddr = s:taboption("general", Value, "ipaddr", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Network-Address"))
-ipaddr.default = "192.168.100.1"
-
-nm = s:taboption("general", Value, "netmask", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Netmask"))
-nm.default = "255.255.255.0"
-nm:value("255.255.255.0")
-nm:value("255.255.0.0")
-nm:value("255.0.0.0")
-
-if has_ipv6 then
- ip6addr = s:taboption("general", Value, "ip6addr", translate("VPN <abbr title=\"Internet Protocol Version 6\">IPv6</abbr>-Network-Address"), translate("<abbr title=\"Classless Inter-Domain Routing\">CIDR</abbr>-Notation: address/prefix"))
-end
-
-
-tmpl = s:taboption("template", Value, "_tmpl",
- translate("Edit the template that is used for generating the ocserv configuration."))
-
-tmpl.template = "cbi/tvalue"
-tmpl.rows = 20
-
-function tmpl.cfgvalue(self, section)
- return nixio.fs.readfile("/etc/ocserv/ocserv.conf.template")
-end
-
-function tmpl.write(self, section, value)
- value = value:gsub("\r\n?", "\n")
- nixio.fs.writefile("/etc/ocserv/ocserv.conf.template", value)
-end
-
-ca = s:taboption("ca", Value, "_ca",
- translate("View the CA certificate used by this server. You will need to save it as 'ca.pem' and import it into the clients."))
-
-ca.template = "cbi/tvalue"
-ca.rows = 20
-
-function ca.cfgvalue(self, section)
- return nixio.fs.readfile("/etc/ocserv/ca.pem")
-end
-
---[[DNS]]--
-
-s = m:section(TypedSection, "dns", translate("DNS servers"),
- translate("The DNS servers to be provided to clients; can be either IPv6 or IPv4"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-s:option(Value, "ip", translate("IP Address")).rmempty = true
-
---[[Routes]]--
-
-s = m:section(TypedSection, "routes", translate("Routing table"),
- translate("The routing table to be provided to clients; you can mix IPv4 and IPv6 routes, the server will send only the appropriate. Leave empty to set a default route"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-s:option(Value, "ip", translate("IP Address")).rmempty = true
-
-o = s:option(Value, "netmask", translate("Netmask (or IPv6-prefix)"))
-o.default = "255.255.255.0"
-o:value("255.255.255.0")
-o:value("255.255.0.0")
-o:value("255.0.0.0")
-
-
-return m
+++ /dev/null
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-
-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 nixio = require "nixio"
-
-m = Map("ocserv", translate("OpenConnect VPN"))
-
-if m.uci:get("ocserv", "config", "auth") == "plain" then
-
---[[Users]]--
-
-function m.on_commit(map)
- luci.sys.call("/etc/init.d/ocserv restart >/dev/null 2>&1")
-end
-
-s = m:section(TypedSection, "ocservusers", translate("Available users"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-s:option(Value, "name", translate("Name")).rmempty = true
-s:option(DummyValue, "group", translate("Group")).rmempty = true
-pwd = s:option(Value, "password", translate("Password"))
-pwd.password = false
-
-function pwd.write(self, section, value)
- local pass
- if string.match(value, "^\$%d\$.*") then
- pass = value
- else
- local t = tonumber(nixio.getpid()*os.time())
- local salt = "$5$" .. t .. "$"
- pass = nixio.crypt(value, salt)
- end
- Value.write(self, section, pass)
-end
-
---[[if plain]]--
-end
-
-local lusers = { }
-local fd = io.popen("/usr/bin/occtl show users", "r")
-if fd then local ln
- repeat
- ln = fd:read("*l")
- if not ln then break end
-
- local id, user, group, vpn_ip, ip, device, time, cipher, status =
- ln:match("^%s*(%d+)%s+([-_%w]+)%s+([%.%*-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+).*")
- if id then
- table.insert(lusers, {id, user, group, vpn_ip, ip, device, time, cipher, status})
- end
- until not ln
- fd:close()
-end
-
-
---[[Active Users]]--
-
-local s = m:section(Table, lusers, translate("Active users"))
-s.anonymous = true
-s.rmempty = true
-s.template = "cbi/tblsection"
-
-s:option(DummyValue, 1, translate("ID"))
-s:option(DummyValue, 2, translate("Username"))
-s:option(DummyValue, 3, translate("Group"))
-s:option(DummyValue, 4, translate("IP"))
-s:option(DummyValue, 5, translate("VPN IP"))
-s:option(DummyValue, 6, translate("Device"))
-s:option(DummyValue, 7, translate("Time"))
-s:option(DummyValue, 8, translate("Cipher"))
-s:option(DummyValue, 9, translate("Status"))
-
-return m
+++ /dev/null
-<%+ocserv_status%>
+++ /dev/null
-<script type="text/javascript">//<![CDATA[
-
- function ocserv_disconnect(idx) {
- XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ocserv", "disconnect")%>/' + idx, null,
- function(x)
- {
- var tb = document.getElementById('ocserv_status_table');
- if (tb && (idx < tb.rows.length))
- tb.rows[0].parentNode.removeChild(tb.rows[idx]);
- }
- );
- }
-
- XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "ocserv", "status")%>', null,
- function(x, st)
- {
- var tb = document.getElementById('ocserv_status_table');
- if (st && tb)
- {
- /* clear all rows */
- while( tb.rows.length > 1 )
- tb.deleteRow(1);
-
- for( var i = 0; i < st.length; i++ )
- {
- var tr = tb.insertRow(-1);
- tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
-
- tr.insertCell(-1).innerHTML = st[i].user;
- tr.insertCell(-1).innerHTML = st[i].group;
- tr.insertCell(-1).innerHTML = st[i].vpn_ip;
- tr.insertCell(-1).innerHTML = st[i].ip;
- tr.insertCell(-1).innerHTML = st[i].device;
- tr.insertCell(-1).innerHTML = st[i].time;
- tr.insertCell(-1).innerHTML = st[i].cipher;
- tr.insertCell(-1).innerHTML = st[i].status;
-
- tr.insertCell(-1).innerHTML = String.format(
- '<input class="cbi-button cbi-input-remove" type="button" value="<%:Disconnect%>" onclick="ocserv_disconnect(%d)" />',
- st[i].id
- );
- }
-
- if( tb.rows.length == 1 )
- {
- var tr = tb.insertRow(-1);
- tr.className = 'cbi-section-table-row';
-
- var td = tr.insertCell(-1);
- td.colSpan = 5;
- td.innerHTML = '<em><br /><%:There are no active users.%></em>';
- }
- }
- }
- );
-//]]></script>
-
-<fieldset class="cbi-section">
- <legend><%:Active OpenConnect Users%></legend>
- <table class="cbi-section-table" id="ocserv_status_table">
- <tr class="cbi-section-table-titles">
- <th class="cbi-section-table-cell"><%:User%></th>
- <th class="cbi-section-table-cell"><%:Group%></th>
- <th class="cbi-section-table-cell"><%:IP Address%></th>
- <th class="cbi-section-table-cell"><%:VPN IP Address%></th>
- <th class="cbi-section-table-cell"><%:Device%></th>
- <th class="cbi-section-table-cell"><%:Time%></th>
- <th class="cbi-section-table-cell"><%:Cipher%></th>
- <th class="cbi-section-table-cell"><%:Status%></th>
- <th class="cbi-section-table-cell"> </th>
- </tr>
- <tr class="cbi-section-table-row">
- <td colspan="5"><em><br /><%:Collecting data...%></em></td>
- </tr>
- </table>
-</fieldset>
+++ /dev/null
-# Copyright (C) 2014 Nikos Mavrogiannopoulos
-#
-# 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.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# The full GNU General Public License is included in this distribution in
-# the file called "COPYING".
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=luci-proto-openconnect
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/luci-proto-openconnect
- SECTION:=luci
- CATEGORY:=LuCI
- SUBMENU:=6. Protocols
- TITLE:= OpenConnect VPN protocol configuration
- DEPENDS:=+luci-mod-admin-full +luci-lib-nixio +openconnect
- MAINTAINER:= Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
-endef
-
-define Package/luci-proto-openconnect/description
- openconnect web module for LuCi web interface
-endef
-
-define Build/Prepare
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-# Fixme: How can we add <%+openconnect_status%> in view/admin_status/index.htm?
-define Package/luci-proto-openconnect/install
- $(CP) ./files/* $(1)/
-endef
-
-$(eval $(call BuildPackage,luci-proto-openconnect))
-
+++ /dev/null
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nikos Mavrogiannopoulos <nmav@gnutls.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
-]]--
-
-local map, section, net = ...
-
-local server, username, password, cert, ca
-local oc_cert_file, oc_key_file, oc_ca_file
-
-local ifc = net:get_interface():name()
-
-oc_cert_file = "/etc/openconnect/user-cert-" .. ifc .. ".pem"
-oc_key_file = "/etc/openconnect/user-key-" .. ifc .. ".pem"
-oc_ca_file = "/etc/openconnect/ca-" .. ifc .. ".pem"
-
-server = section:taboption("general", Value, "server", translate("VPN Server"))
-server.datatype = "host"
-
-port = section:taboption("general", Value, "port", translate("VPN Server port"))
-port.placeholder = "443"
-port.datatype = "port"
-
-section:taboption("general", Value, "serverhash", translate("VPN Server's certificate SHA1 hash"))
-
-section:taboption("general", Value, "authgroup", translate("AuthGroup"))
-
-username = section:taboption("general", Value, "username", translate("Username"))
-password = section:taboption("general", Value, "password", translate("Password"))
-password.password = true
-
-
-cert = section:taboption("advanced", Value, "usercert", translate("User certificate (PEM encoded)"))
-cert.template = "cbi/tvalue"
-cert.rows = 10
-
-function cert.cfgvalue(self, section)
- return nixio.fs.readfile(oc_cert_file)
-end
-
-function cert.write(self, section, value)
- value = value:gsub("\r\n?", "\n")
- nixio.fs.writefile(oc_cert_file, value)
-end
-
-cert = section:taboption("advanced", Value, "userkey", translate("User key (PEM encoded)"))
-cert.template = "cbi/tvalue"
-cert.rows = 10
-
-function cert.cfgvalue(self, section)
- return nixio.fs.readfile(oc_key_file)
-end
-
-function cert.write(self, section, value)
- value = value:gsub("\r\n?", "\n")
- nixio.fs.writefile(oc_key_file, value)
-end
-
-
-ca = section:taboption("advanced", Value, "ca", translate("CA certificate; if empty it will be saved after the first connection."))
-ca.template = "cbi/tvalue"
-ca.rows = 10
-
-function ca.cfgvalue(self, section)
- return nixio.fs.readfile(oc_ca_file)
-end
-
-function ca.write(self, section, value)
- value = value:gsub("\r\n?", "\n")
- nixio.fs.writefile(oc_ca_file, value)
-end
+++ /dev/null
---[[
-LuCI - Network model - dhcpv6 protocol extension
-
-Copyright 2012 David Woodhouse
-
-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
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-]]--
-
-local netmod = luci.model.network
-local interface = luci.model.network.interface
-local proto = netmod:register_protocol("openconnect")
-
-function proto.get_i18n(self)
- return luci.i18n.translate("OpenConnect (CISCO AnyConnect)")
-end
-
-function proto.ifname(self)
- return "vpn-" .. self.sid
-end
-
-function proto.get_interface(self)
- return interface(self:ifname(), self)
-end
-
-function proto.opkg_package(self)
- return "openconnect"
-end
-
-function proto.is_installed(self)
- return nixio.fs.access("/lib/netifd/proto/openconnect.sh")
-end
-
-function proto.is_floating(self)
- return true
-end
-
-function proto.is_virtual(self)
- return true
-end
-
-function proto.get_interfaces(self)
- return nil
-end
-
-function proto.contains_interface(self, ifc)
- return (netmod:ifnameof(ifc) == self:ifname())
-
-end
-
-netmod:register_pattern_virtual("^vpn-%w")
$(call Build/Configure/Default,$(CONFIGURE_ARGS))
endef
+KCFLAGS=
+ifeq ($(CONFIG_GCC_VERSION_4_9),y)
+KCFLAGS:=-Wno-error=date-time
+endif
+
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
ARCH="$(LINUX_KARCH)" \
SUBDIRS="$(PKG_BUILD_DIR)/datapath/linux" \
PATH="$(TARGET_PATH)" \
- KCFLAGS="-Wno-error=date-time" \
+ KCFLAGS="$(KCFLAGS)" \
KCC="$(KERNEL_CC)"
endef
--- /dev/null
+commit 2ea824143172e38b4387ef23b8685cebaee21c69
+Author: Pravin B Shelar <pshelar@nicira.com>
+Date: Tue Sep 24 18:42:43 2013 -0700
+
+ datapath: Backport __ip_select_ident() function
+
+ definition of __ip_select_ident() changed in newer kernel and
+ it is backported to stable kernel, Therefore adding configure
+ check to detect the new function.
+
+ Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
+ Acked-by: Andy Zhou <azhou@nicira.com>
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 7e036e5..b0794d2 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -284,6 +284,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
+ OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_set_encap_proto])
+
+ OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [ipv4_is_multicast])
++ OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [__ip_select_ident.*dst_entry],
++ [OVS_DEFINE([HAVE_IP_SELECT_IDENT_USING_DST_ENTRY])])
+
+ OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro])
+ OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats])
+diff --git a/datapath/linux/compat/ip_tunnels_core.c b/datapath/linux/compat/ip_tunnels_core.c
+index d650be2..a70aefc 100644
+--- a/datapath/linux/compat/ip_tunnels_core.c
++++ b/datapath/linux/compat/ip_tunnels_core.c
+@@ -70,7 +70,12 @@ int iptunnel_xmit(struct rtable *rt,
+ iph->daddr = dst;
+ iph->saddr = src;
+ iph->ttl = ttl;
++
++#ifdef HAVE_IP_SELECT_IDENT_USING_DST_ENTRY
+ __ip_select_ident(iph, &rt_dst(rt), (skb_shinfo(skb)->gso_segs ?: 1) - 1);
++#else
++ __ip_select_ident(iph, skb_shinfo(skb)->gso_segs ?: 1);
++#endif
+
+ err = ip_local_out(skb);
+ if (unlikely(net_xmit_eval(err)))
#
-# Copyright (C) 2007-2011 OpenWrt.org
+# Copyright (C) 2007-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=wget
-PKG_VERSION:=1.15
+PKG_VERSION:=1.16
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=7a279d5ac5594919124d5526e7143e28
+PKG_MD5SUM:=fe102975ab3a6c049777883f1bb9ad07
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_LICENSE:=GPL-3.0+
$(eval $(call BuildPlugin,processes,process status input,processes,))
$(eval $(call BuildPlugin,protocols,network protocols input,protocols,))
$(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1))
-$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors @BROKEN))
+$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors))
$(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp))
$(eval $(call BuildPlugin,syslog,syslog output,syslog,))
$(eval $(call BuildPlugin,tail,tail input,tail,))
--- /dev/null
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luci-app-lxc
+PKG_RELEASE:=20141012
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luci-app-lxc
+ SECTION:=luci
+ CATEGORY:=LuCI
+ SUBMENU:=3. Applications
+ TITLE:=LXC management Web UI
+ DEPENDS:=+luci-mod-admin-full +lxc +liblxc +rpcd-mod-lxc
+ MAINTAINER:=Petar Koretic <petar.koretic@sartura.hr>
+endef
+
+define Package/luci-app-lxc/description
+ This package will install LXC management Web UI.
+endef
+
+define Build/Prepare
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/luci-app-lxc/install
+ $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/
+ $(INSTALL_BIN) \
+ ./files/controller/lxc.lua \
+ $(1)/usr/lib/lua/luci/controller/
+
+ $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/
+ $(INSTALL_DATA) \
+ ./files/view/lxc.htm \
+ $(1)/usr/lib/lua/luci/view/
+
+ $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/
+ $(INSTALL_BIN) \
+ ./files/model/cbi/lxc.lua \
+ $(1)/usr/lib/lua/luci/model/cbi/
+
+ $(INSTALL_DIR) $(1)/etc/config/
+ $(INSTALL_DATA) \
+ ./files/lxc.config \
+ $(1)/etc/config/lxc
+
+ $(INSTALL_DIR) $(1)/www
+ $(CP) -R \
+ ./files/www/* \
+ $(1)/www
+endef
+
+$(eval $(call BuildPackage,luci-app-lxc))
--- /dev/null
+--[[
+
+LuCI LXC module
+
+Copyright (C) 2014, Cisco Systems, Inc.
+
+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
+
+Author: Petar Koretic <petar.koretic@sartura.hr>
+
+]]--
+
+module("luci.controller.lxc", package.seeall)
+
+require "ubus"
+local conn = ubus.connect()
+if not conn then
+ error("Failed to connect to ubus")
+end
+
+
+function fork_exec(command)
+ local pid = nixio.fork()
+ if pid > 0 then
+ return
+ elseif pid == 0 then
+ -- change to root dir
+ nixio.chdir("/")
+
+ -- patch stdin, out, err to /dev/null
+ local null = nixio.open("/dev/null", "w+")
+ if null then
+ nixio.dup(null, nixio.stderr)
+ nixio.dup(null, nixio.stdout)
+ nixio.dup(null, nixio.stdin)
+ if null:fileno() > 2 then
+ null:close()
+ end
+ end
+
+ -- replace with target command
+ nixio.exec("/bin/sh", "-c", command)
+ end
+end
+
+function index()
+ page = node("admin", "services", "lxc")
+ page.target = cbi("lxc")
+ page.title = _("LXC Containers")
+ page.order = 70
+
+ page = entry({"admin", "services", "lxc_create"}, call("lxc_create"), nil)
+ page.leaf = true
+
+ page = entry({"admin", "services", "lxc_action"}, call("lxc_action"), nil)
+ page.leaf = true
+
+ page = entry({"admin", "services", "lxc_configuration_get"}, call("lxc_configuration_get"), nil)
+ page.leaf = true
+
+ page = entry({"admin", "services", "lxc_configuration_set"}, call("lxc_configuration_set"), nil)
+ page.leaf = true
+
+end
+
+function lxc_create(lxc_name, lxc_template)
+ luci.http.prepare_content("text/plain")
+
+ local uci = require("uci").cursor()
+
+ local url = uci:get("lxc", "lxc", "url")
+
+ if not pcall(dofile, "/etc/openwrt_release") then
+ return luci.http.write("1")
+ end
+
+ local target = _G.DISTRIB_TARGET:match('([^/]+)')
+
+ local res = os.execute("lxc-create -t download -n " .. lxc_name .. " -- --server=" .. url .. " --no-validate --dist " .. lxc_template .. " --release bb --arch " .. target)
+
+ luci.http.write(tostring(res))
+end
+
+function lxc_action(lxc_action, lxc_name)
+ luci.http.prepare_content("application/json")
+
+ local data, ec = conn:call("lxc", lxc_action, lxc_name and { name = lxc_name} or {} )
+
+ luci.http.write_json(ec and {} or data)
+end
+
+function lxc_configuration_get(lxc_name)
+ luci.http.prepare_content("text/plain")
+
+ local f = io.open("/lxc/" .. lxc_name .. "/config", "r")
+ local content = f:read("*all")
+ f:close()
+
+ luci.http.write(content)
+end
+
+function lxc_configuration_set(lxc_name)
+ luci.http.prepare_content("text/plain")
+
+ local lxc_configuration = luci.http.formvalue("lxc_configuration")
+
+ if lxc_configuration == nil then
+ return luci.http.write("1")
+ end
+
+ local f, err = io.open("/lxc/" .. lxc_name .. "/config","w+")
+ if not f then
+ return luci.http.write("2")
+ end
+
+ f:write(lxc_configuration)
+ f:close()
+
+ luci.http.write("0")
+end
+
--- /dev/null
+#
+# lxc uci configuration
+#
+
+config lxc 'lxc'
+ option url 'virtualwrt.org/containers/'
--- /dev/null
+--[[
+
+LuCI LXC module
+
+Copyright (C) 2014, Cisco Systems, Inc.
+
+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
+
+Author: Petar Koretic <petar.koretic@sartura.hr>
+
+]]--
+
+local fs = require "nixio.fs"
+
+m = Map("lxc", translate("LXC Containers"))
+
+if fs.access("/etc/config/lxc") then
+ m:section(SimpleSection).template = "lxc"
+
+ s = m:section(TypedSection, "lxc", translate("Options"))
+ s.anonymous = true
+ s.addremove = false
+
+ s:option(Value, "url", translate("Containers URL"))
+end
+
+return m
--- /dev/null
+<%#
+
+LuCI LXC module
+
+Copyright (C) 2014, Cisco Systems, Inc.
+
+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
+
+Author: Petar Koretic <petar.koretic@sartura.hr>
+
+-%>
+
+<fieldset class="cbi-section">
+ <legend><%:Available Containers%></legend>
+ <div class="cbi-section-node">
+ <table id="t_lxc_list" class="cbi-section-table">
+ <tr class="cbi-section-table-titles">
+ <th class="cbi-section-table-cell"><%:Name%></th>
+ <th class="cbi-section-table-cell"><%:Status%></th>
+ <th class="cbi-section-table-cell"><%:Actions%></th>
+ </tr>
+ </table>
+ </div>
+</fieldset>
+
+<fieldset class="cbi-section">
+ <span id="lxc-list-output"></span>
+</fieldset>
+
+<hr/>
+<fieldset class="cbi-section">
+ <legend><%:Create New Container%></legend>
+ <div class="cbi-section-node">
+ <table id="t_lxc_create" class="cbi-section-table">
+ <tr class="cbi-section-table-titles">
+ <th class="cbi-section-table-cell"><%:Name%></th>
+ <th class="cbi-section-table-cell"><%:Template%></th>
+ <th class="cbi-section-table-cell"><%:Actions%></th>
+ </tr>
+ <tr id="tr_holder">
+ <td>
+ <input type="text" id="tx_name" placeholder="<%:Enter new name%>" value='' />
+ </td>
+ <td>
+ <select id="s_template" class="cbi-input-select cbi-button">
+ <option value="openwrt">OpenWrt</option>
+ </select>
+ </td>
+ <td>
+ <input type="button" id="bt_create" value="<%:Create%>" onclick="lxc_create(tr_holder)" class="cbi-button cbi-button-add" />
+ <span id="lxc-add-loader" style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>
+ </td>
+ </tr>
+ </table>
+ </div>
+</fieldset>
+
+<fieldset class="cbi-section">
+ <span id="lxc-add-output"></span>
+</fieldset>
+
+<hr/>
+
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+
+ window.img = { "red" : "<%=resource%>/cbi/red.gif", "green" : "<%=resource%>/cbi/green.gif", "purple" : "<%=resource%>/cbi/purple.gif" }
+ window.states = { "STOPPED" : "red", "RUNNING" : "green", "FROZEN" : "purple"}
+
+ var t_lxc_list = document.getElementById('t_lxc_list');
+ var loader_html = '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" width="16" height="16" style="vertical-align:middle" /> ';
+ var timeout_msg = 0
+ var output_list = document.getElementById("lxc-list-output")
+ var output_add = document.getElementById("lxc-add-output")
+ var loader_add = document.getElementById("lxc-add-loader")
+
+ function lxc_create(tr)
+ {
+ var lxc_name = tr.querySelector("#tx_name").value.trim()
+ var lxc_template = tr.querySelector("#s_template").value
+ var bt_create = tr.querySelector("#bt_create")
+
+ if (t_lxc_list.querySelector("[data-id='" + lxc_name + "']") != null)
+ return info_message(output_add, "Container with that name already exists!", 4000)
+
+ bt_create.disabled = true
+ output_add.innerHTML = ''
+
+ if (!lxc_name || !lxc_name.length)
+ {
+ bt_create.disabled = false
+ return info_message(output_add, "Name cannot be empty!", 4000)
+ }
+
+ loading(loader_add)
+
+ new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_create/' + '%h/%h'.format(lxc_name, lxc_template) , null,
+ function(x)
+ {
+ bt_create.disabled = false
+ loading(loader_add, 0)
+
+ if (!x)
+ info_message(output_add, "Container creation failed!")
+ })
+ }
+
+ function lxc_create_template(lxc_name, lxc_state)
+ {
+ var info_row = t_lxc_list.querySelector("#empty")
+ if (info_row)
+ t_lxc_list.deleteRow(1)
+
+ var actions = ''
+ actions += '<input type="button" onclick="action_handler(this)" data-action="start" value="<%:Start%>" class="cbi-button cbi-button-apply" />'
+ actions+= '<input type="button" onclick="action_handler(this)" data-action="stop" value="<%:Stop%>" class="cbi-button cbi-button-reset" />'
+ actions+= '<input type="button" onclick="action_handler(this)" data-action="destroy" value="<%:Delete%>" class="cbi-button cbi-button-remove" />'
+ actions+= ' <select class="cbi-input-select cbi-button" onchange="action_more_handler(this)">\
+ <option selected disabled>more</option>\
+ <option>configure</option>\
+ <option>freeze</option>\
+ <option>unfreeze</option>\
+ <option>reboot</option>\
+ </select>'
+ actions+= '<span data-loader style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>'
+
+ var row = t_lxc_list.insertRow(-1)
+ var cell = row.insertCell(-1)
+ cell.innerHTML = '%q%h%q'.format("<strong>", lxc_name, "</strong>")
+ cell.width = "30%"
+ cell.setAttribute("data-id", lxc_name)
+
+ cell = row.insertCell(-1)
+ cell.width = "20%"
+ cell.innerHTML = "<img src='"+window.img[lxc_state]+"'/>"
+
+ cell = row.insertCell(-1)
+ cell.width = "50%"
+ cell.innerHTML = actions
+ }
+
+ function action_handler(self)
+ {
+ var action = self.getAttribute("data-action");
+
+ var bt_action = self
+ var lxc_name = self.parentNode.parentNode.children[0].getAttribute('data-id')
+ var status_img = self.parentNode.parentNode.querySelector('img')
+ var loader = self.parentNode.querySelector('[data-loader]')
+
+ bt_action.disabled = true
+
+ if (action == "stop")
+ {
+ loading(loader)
+
+ new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null,
+ function(x, ec)
+ {
+ loading(loader, 0)
+ bt_action.disabled = false
+
+ if (!x || ec)
+ return info_message(output_list,"Action failed!")
+
+ set_status(status_img, "red")
+
+ });
+ }
+
+ else if (action == "start")
+ {
+ loading(loader)
+
+ new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null,
+ function(x, data)
+ {
+ loading(loader, 0)
+ bt_action.disabled = false
+
+ //FIXME: uncomment after fixing 'lxc-start'
+ if (!x /*|| ec */)
+ return info_message(output_list,"Action failed!")
+
+ //FIXME: uncomment after fixing 'lxc-start'
+ //set_status(status_img, "green")
+ });
+ }
+
+ else if (action == "destroy")
+ {
+ if (!confirm("This will completely remove LXC container from the disk. Are you sure? (container will be stopped if running)"))
+ return
+
+ loading(loader)
+
+ new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null,
+ function(x, ec)
+ {
+ loading(loader, 0)
+ bt_action.disabled = false
+
+ if (!x || ec)
+ return info_message(output_list,"Action failed!")
+
+ var row = self.parentNode.parentNode
+ row.parentNode.removeChild(row)
+
+ });
+ }
+ }
+
+ function lxc_configure_handler(self)
+ {
+ var td = self.parentNode
+ var textarea = td.querySelector('[data-id]')
+ var lxc_name = textarea.getAttribute('data-id')
+ var lxc_configuration = textarea.value
+
+ new XHR().post('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_set/' + lxc_name, "lxc_configuration=" + encodeURIComponent(lxc_configuration) ,
+ function(x)
+ {
+ if (!x || x.responseText != "0")
+ return info_message(output_list,"Action failed!")
+
+ info_message(output_list,"LXC configuration updated")
+ var row = td.parentNode
+ row.parentNode.removeChild(row)
+ })
+ }
+
+ function lxc_rename_template(lxc_name)
+ {
+ var h = '\
+ <input data-id="'+ lxc_name + '" type="text" placeholder="Enter new name" /> \
+ <input data-id="bt_confirm" onclick="lxc_rename_handler(this)" type="button" class="cbi-button" value="Confirm" />'
+
+ return h
+ }
+
+ function lxc_configure_template(lxc_name, lxc_configuration)
+ {
+ var h = '\
+ <textarea data-id="'+ lxc_name + '" rows="20" style="width:100%">'+ lxc_configuration +'</textarea> \
+ <input data-id="bt_confirm" onclick="lxc_configure_handler(this)" type="button" class="cbi-button" value="Confirm" />'
+
+ return h
+ }
+
+ function action_more_handler(self)
+ {
+ var lxc_name = self.parentNode.parentNode.querySelector('[data-id]').getAttribute('data-id')
+ var loader = self.parentNode.parentNode.querySelector('[data-loader]')
+
+ var option = self.options[self.selectedIndex].text
+
+ self.value = "more"
+
+ switch (option)
+ {
+ case "configure":
+ var tr = document.createElement('tr')
+ var row = self.parentNode.parentNode
+ var next_row = row.nextSibling
+ if (next_row && next_row.getAttribute('data-action') !== null)
+ row.parentNode.removeChild(next_row)
+
+ new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_get/' + lxc_name, null,
+ function(x)
+ {
+ tr.innerHTML="<td colspan='" + row.cells.length + "'>" + lxc_configure_template(lxc_name, x.responseText) + "</td>"
+ tr.setAttribute('data-action','')
+ row.parentNode.insertBefore(tr, row.nextSibling)
+ })
+
+ break
+
+ case "freeze":
+ var tr = self.parentNode.parentNode
+ var img = tr.querySelector('img')
+ if(img.getAttribute('src') != window.img["green"])
+ return info_message(output_list,"Container is not running!")
+
+ loading(loader)
+ new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null,
+ function(x, ec)
+ {
+ loading(loader, 0)
+ if (!x || ec)
+ return info_message(output_list,"Action failed!")
+
+ set_status(img, "purple")
+ })
+
+ break
+
+ case "unfreeze":
+ var tr = self.parentNode.parentNode
+ var img = tr.querySelector('img')
+
+ if(img.getAttribute('src') != window.img["purple"])
+ return info_message(output_list,"Container is not frozen!")
+
+ loading(loader)
+ new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null,
+ function(x, ec)
+ {
+ loading(loader, 0)
+ if (!x || ec)
+ return info_message(output_list,"Action failed!")
+
+ set_status(img, "green")
+ })
+
+ break
+
+ case "reboot":
+ var tr = self.parentNode.parentNode
+ var img = tr.querySelector('img')
+ if(img.getAttribute('src') != window.img["green"])
+ return info_message(output_list,"Container is not running!")
+
+ if (!confirm("Are you sure?"))
+ return
+
+ loading(loader)
+ new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null,
+ function(x, ec)
+ {
+ loading(loader, 0)
+ if (!x || ec)
+ return info_message(output_list,"Action failed!")
+
+ info_message(output_list,"LXC rebooted")
+ })
+ break
+ }
+
+ }
+
+ function set_empty(t_lxc_list)
+ {
+ if (document.getElementById('empty') !== null)
+ return
+
+ var row_count = t_lxc_list.rows.length;
+ while(--row_count) t_lxc_list.deleteRow(row_count);
+
+ var row = t_lxc_list.insertRow(-1);
+ row.id = 'empty'
+ var cell = row.insertCell(0);
+ cell.colSpan = 4;
+ cell.innerHTML = '<em><br />There are no containers available yet.</em>';
+ }
+
+ function lxc_list_update()
+ {
+ XHR.poll(4, '<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/list', null,
+ function(x, data)
+ {
+ if (!x) return;
+
+ var lxc_count = Object.keys(data).length
+ if (!data || !lxc_count)
+ return set_empty(t_lxc_list)
+
+ if (document.getElementById('empty') !== null)
+ t_lxc_list.deleteRow(1);
+
+ var lxcs = t_lxc_list.querySelectorAll('td[data-id]')
+ var lxc_name_table = {}
+ for (var i = 0, len = lxcs.length; i < len; i++)
+ {
+ var lxc_name = lxcs[i].getAttribute('data-id')
+ if (!(lxc_name in data))
+ {
+ var row = t_lxc_list.querySelector("[data-id='" + lxc_name + "']").parentNode
+ row.parentNode.removeChild(row)
+ continue
+ }
+
+ lxc_name_table[lxc_name] = lxcs[i].parentNode.querySelector('img')
+ }
+
+ for(var key in data)
+ {
+ var lxc_name = key
+ var state = window.states[data[key]]
+
+ if (!(lxc_name in lxc_name_table))
+ lxc_create_template(lxc_name, state)
+
+ else if (state != get_status(lxc_name_table[lxc_name]))
+ set_status(lxc_name_table[lxc_name], state)
+ }
+
+ })
+ }
+
+ function loading(elem, state)
+ {
+ state = (typeof state === 'undefined') ? 1 : state
+
+ if (state === 1)
+ elem.innerHTML = loader_html
+ else
+ setTimeout(function() { elem.innerHTML = ''}, 1000)
+ }
+
+ function set_status(elem, state)
+ {
+ state = (typeof state === 'undefined') ? 1 : state
+
+ setTimeout(function() { elem.setAttribute('src', window.img[state])}, 300)
+ }
+
+ function get_status(elem)
+ {
+ var src = elem.getAttribute('src')
+
+ for (var i in img)
+ {
+ if (img[i] == src)
+ return i
+ }
+ }
+
+ function info_message(output, msg, timeout)
+ {
+ timeout = timeout || 3000
+ output.innerHTML = msg
+ clearTimeout(timeout_msg)
+ timeout_msg = setTimeout(function(){ output.innerHTML=""}, timeout);
+ }
+
+ lxc_list_update()
+//]]></script>
--- /dev/null
+--- a/templates/lxc-download.in
++++ b/templates/lxc-download.in
+@@ -479,15 +479,7 @@ fi
+ # Unpack the rootfs
+ echo "Unpacking the rootfs"
+
+-EXCLUDES=""
+-excludelist=$(relevant_file excludes)
+-if [ -f "${excludelist}" ]; then
+- while read line; do
+- EXCLUDES="$EXCLUDES --exclude=$line"
+- done < $excludelist
+-fi
+-
+-tar --anchored ${EXCLUDES} --numeric-owner -xpJf \
++tar --numeric-owner -xpJf \
+ ${LXC_CACHE_PATH}/rootfs.tar.xz -C ${LXC_ROOTFS}
+
+ mkdir -p ${LXC_ROOTFS}/dev/pts/
+++ /dev/null
---- a/templates/lxc-download.in
-+++ b/templates/lxc-download.in
-@@ -479,15 +479,7 @@ fi
- # Unpack the rootfs
- echo "Unpacking the rootfs"
-
--EXCLUDES=""
--excludelist=$(relevant_file excludes)
--if [ -f "${excludelist}" ]; then
-- while read line; do
-- EXCLUDES="$EXCLUDES --exclude=$line"
-- done < $excludelist
--fi
--
--tar --anchored ${EXCLUDES} --numeric-owner -xpJf \
-+tar --numeric-owner -xpJf \
- ${LXC_CACHE_PATH}/rootfs.tar.xz -C ${LXC_ROOTFS}
-
- mkdir -p ${LXC_ROOTFS}/dev/pts/
+++ /dev/null
---- /dev/null
-+++ b/config/templates/openwrt.common.conf.in
-@@ -0,0 +1,56 @@
-+# Default mount entries
-+lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
-+lxc.mount.entry = sysfs sys sysfs defaults 0 0
-+
-+# Default console settings
-+lxc.devttydir = lxc
-+lxc.tty = 4
-+lxc.pts = 1024
-+
-+# Default capabilities
-+lxc.cap.drop = mac_admin
-+lxc.cap.drop = mac_override
-+lxc.cap.drop = sys_admin
-+lxc.cap.drop = sys_module
-+lxc.cap.drop = sys_nice
-+lxc.cap.drop = sys_pacct
-+lxc.cap.drop = sys_ptrace
-+lxc.cap.drop = sys_rawio
-+lxc.cap.drop = sys_resource
-+lxc.cap.drop = sys_time
-+lxc.cap.drop = sys_tty_config
-+lxc.cap.drop = syslog
-+lxc.cap.drop = wake_alarm
-+
-+# Default cgroups - all denied except those whitelisted
-+lxc.cgroup.devices.deny = a
-+## /dev/null and zero
-+lxc.cgroup.devices.allow = c 1:3 rwm
-+lxc.cgroup.devices.allow = c 1:5 rwm
-+## consoles
-+lxc.cgroup.devices.allow = c 5:0 rwm
-+lxc.cgroup.devices.allow = c 5:1 rwm
-+## /dev/{,u}random
-+lxc.cgroup.devices.allow = c 1:8 rwm
-+lxc.cgroup.devices.allow = c 1:9 rwm
-+## /dev/pts/*
-+lxc.cgroup.devices.allow = c 5:2 rwm
-+lxc.cgroup.devices.allow = c 136:* rwm
-+## rtc
-+lxc.cgroup.devices.allow = c 254:0 rm
-+## fuse
-+lxc.cgroup.devices.allow = c 10:229 rwm
-+## tun
-+lxc.cgroup.devices.allow = c 10:200 rwm
-+## dev/tty0
-+lxc.cgroup.devices.allow = c 4:0 rwm
-+## dev/tty1
-+lxc.cgroup.devices.allow = c 4:1 rwm
-+
-+## To use loop devices, copy the following line to the container's
-+## configuration file (uncommented).
-+#lxc.cgroup.devices.allow = b 7:* rwm
-+
-+# Blacklist some syscalls which are not safe in privileged
-+# containers
-+lxc.seccomp = /usr/share/lxc/config/common.seccomp
---- a/configure.ac
-+++ b/configure.ac
-@@ -579,6 +579,7 @@ AC_CONFIG_FILES([
- config/templates/ubuntu.common.conf
- config/templates/ubuntu.lucid.conf
- config/templates/ubuntu.userns.conf
-+ config/templates/openwrt.common.conf
- config/yum/Makefile
-
- doc/Makefile
---- a/config/templates/Makefile.am
-+++ b/config/templates/Makefile.am
-@@ -22,4 +22,5 @@ templatesconfig_DATA = \
- ubuntu-cloud.userns.conf \
- ubuntu.common.conf \
- ubuntu.lucid.conf \
-- ubuntu.userns.conf
-+ ubuntu.userns.conf \
-+ openwrt.common.conf
--- /dev/null
+From bdeafb7bc4857e80dbca5192a751eedcf7b69abd Mon Sep 17 00:00:00 2001
+From: Luka Perkov <luka@openwrt.org>
+Date: Mon, 27 Oct 2014 21:49:46 +0100
+Subject: [PATCH] utils: remove unnecessary check of mystat.st_dev
+
+The check is not needed and it breaks lxc-destroy when container is installed
+on top of overlayfs. More information why this is a problem on overlayfs can be
+found here:
+
+https://kernel.googlesource.com/pub/scm/linux/kernel/git/mszeredi/vfs/+/overlayfs.current/Documentation/filesystems/overlayfs.txt
+
+Signed-off-by: Luka Perkov <luka@openwrt.org>
+---
+ src/lxc/utils.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+--- a/src/lxc/utils.c
++++ b/src/lxc/utils.c
+@@ -46,7 +46,7 @@
+
+ lxc_log_define(lxc_utils, lxc);
+
+-static int _recursive_rmdir_onedev(char *dirname, dev_t pdev)
++static int _recursive_rmdir_onedev(char *dirname)
+ {
+ struct dirent dirent, *direntp;
+ DIR *dir;
+@@ -82,10 +82,8 @@ static int _recursive_rmdir_onedev(char
+ failed=1;
+ continue;
+ }
+- if (mystat.st_dev != pdev)
+- continue;
+ if (S_ISDIR(mystat.st_mode)) {
+- if (_recursive_rmdir_onedev(pathname, pdev) < 0)
++ if (_recursive_rmdir_onedev(pathname) < 0)
+ failed=1;
+ } else {
+ if (unlink(pathname) < 0) {
+@@ -119,7 +117,7 @@ extern int lxc_rmdir_onedev(char *path)
+ return -1;
+ }
+
+- return _recursive_rmdir_onedev(path, mystat.st_dev);
++ return _recursive_rmdir_onedev(path);
+ }
+
+ static int mount_fs(const char *source, const char *target, const char *type)
--- /dev/null
+--- /dev/null
++++ b/config/templates/openwrt.common.conf.in
+@@ -0,0 +1,56 @@
++# Default mount entries
++lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
++lxc.mount.entry = sysfs sys sysfs defaults 0 0
++
++# Default console settings
++lxc.devttydir = lxc
++lxc.tty = 4
++lxc.pts = 1024
++
++# Default capabilities
++lxc.cap.drop = mac_admin
++lxc.cap.drop = mac_override
++lxc.cap.drop = sys_admin
++lxc.cap.drop = sys_module
++lxc.cap.drop = sys_nice
++lxc.cap.drop = sys_pacct
++lxc.cap.drop = sys_ptrace
++lxc.cap.drop = sys_rawio
++lxc.cap.drop = sys_resource
++lxc.cap.drop = sys_time
++lxc.cap.drop = sys_tty_config
++lxc.cap.drop = syslog
++lxc.cap.drop = wake_alarm
++
++# Default cgroups - all denied except those whitelisted
++lxc.cgroup.devices.deny = a
++## /dev/null and zero
++lxc.cgroup.devices.allow = c 1:3 rwm
++lxc.cgroup.devices.allow = c 1:5 rwm
++## consoles
++lxc.cgroup.devices.allow = c 5:0 rwm
++lxc.cgroup.devices.allow = c 5:1 rwm
++## /dev/{,u}random
++lxc.cgroup.devices.allow = c 1:8 rwm
++lxc.cgroup.devices.allow = c 1:9 rwm
++## /dev/pts/*
++lxc.cgroup.devices.allow = c 5:2 rwm
++lxc.cgroup.devices.allow = c 136:* rwm
++## rtc
++lxc.cgroup.devices.allow = c 254:0 rm
++## fuse
++lxc.cgroup.devices.allow = c 10:229 rwm
++## tun
++lxc.cgroup.devices.allow = c 10:200 rwm
++## dev/tty0
++lxc.cgroup.devices.allow = c 4:0 rwm
++## dev/tty1
++lxc.cgroup.devices.allow = c 4:1 rwm
++
++## To use loop devices, copy the following line to the container's
++## configuration file (uncommented).
++#lxc.cgroup.devices.allow = b 7:* rwm
++
++# Blacklist some syscalls which are not safe in privileged
++# containers
++lxc.seccomp = /usr/share/lxc/config/common.seccomp
+--- a/configure.ac
++++ b/configure.ac
+@@ -579,6 +579,7 @@ AC_CONFIG_FILES([
+ config/templates/ubuntu.common.conf
+ config/templates/ubuntu.lucid.conf
+ config/templates/ubuntu.userns.conf
++ config/templates/openwrt.common.conf
+ config/yum/Makefile
+
+ doc/Makefile
+--- a/config/templates/Makefile.am
++++ b/config/templates/Makefile.am
+@@ -22,4 +22,5 @@ templatesconfig_DATA = \
+ ubuntu-cloud.userns.conf \
+ ubuntu.common.conf \
+ ubuntu.lucid.conf \
+- ubuntu.userns.conf
++ ubuntu.userns.conf \
++ openwrt.common.conf