Dnsmasq provides network infrastructure for small networks: DNS, DHCP, router advertisement and network boot. It is designed to be
lightweight and have a small footprint, suitable for resource constrained routers and firewalls. It has also been widely used
for tethering on smartphones and portable hotspots, and to support virtual networking in virtualisation frameworks.
Supported platforms include Linux (with glibc and uclibc), Android, *BSD, and Mac OS X. Dnsmasq is included in most
Linux distributions and the ports systems of FreeBSD, OpenBSD and NetBSD. Dnsmasq provides full IPv6 support.
The DNS subsystem provides a local DNS server for the network, with forwarding of all query types to upstream recursive DNS servers and
caching of common record types (A, AAAA, CNAME and PTR, also DNSKEY and DS when DNSSEC is enabled).
Local DNS names can be defined by reading /etc/hosts, by importing names from the DHCP subsystem, or by configuration of a wide range of useful record types.
Upstream servers can be configured in a variety of convenient ways, including dynamic configuration as these change on moving upstream network.
Authoritative DNS mode allows local DNS names may be exported to zone in the global DNS. Dnsmasq acts as authoritative server for this zone, and also provides
zone transfer to secondaries for the zone, if required.
DNSSEC validation may be performed on DNS replies from upstream nameservers, providing security against spoofing and cache poisoning.
Specified sub-domains can be directed to their own upstream DNS servers, making VPN configuration easy.
Internationalised domain names are supported.
The DHCP subsystem supports DHCPv4, DHCPv6, BOOTP and PXE.
Both static and dynamic DHCP leases are supported, along with stateless mode in DHCPv6.
The PXE system is a full PXE server, supporting netboot menus and multiple architecture support. It
includes proxy-mode, where the PXE system co-operates with another DHCP server.
There is a built in read-only TFTP server to support netboot.
Machines which are configured by DHCP have their names automatically
included in the DNS and the names can specified by each machine or
centrally by associating a name with a MAC address or UID in the dnsmasq
configuration file.
The Router Advertisement subsystem provides basic autoconfiguration for IPv6 hosts. It can be used stand-alone or in conjunction with DHCPv6.
The M and O bits are configurable, to control hosts' use of DHCPv6.
Router advertisements can include the RDNSS option.
There is a mode which uses name information from DHCPv4 configuration to provide DNS entries
for autoconfigured IPv6 addresses which would otherwise be anonymous.
For extra compactness, unused features may be omitted at compile time.
Get code.
Download dnsmasq here.
The tarball includes this documentation, source, and manpage.
There is also a CHANGELOG and a FAQ.
Dnsmasq has a git repository which contains the complete release
history of version 2 and development history from 2.60. You can
browse
the repo, or get a copy using git protocol with the command
Dnsmasq is mainly written and maintained by Simon Kelley. For most of its life, dnsmasq has been a spare-time project.
These days I'm working on it as my main activity.
I don't have an employer or anyone who pays me regularly to work on dnsmasq. If you'd like to make
a contribution towards my expenses, please use the donation button below.
dnsmasq-2.90/contrib/ 0000775 0001750 0001750 00000000000 14562671533 012750 5 ustar srk srk dnsmasq-2.90/contrib/Solaris10/ 0000775 0001750 0001750 00000000000 14562671533 014525 5 ustar srk srk dnsmasq-2.90/contrib/Solaris10/README 0000664 0001750 0001750 00000002010 14562671533 015376 0 ustar srk srk From: David Connelly
Date: Mon, Apr 7, 2008 at 3:31 AM
Subject: Solaris 10 service manifest
To: dnsmasq-discuss@lists.thekelleys.org.uk
I've found dnsmasq much easier to set up on my home server running Solaris
10 than the stock dhcp/dns server, which is probably overkill anyway for my
simple home network needs. Since Solaris now uses SMF (Service Management
Facility) to manage services I thought I'd create a simple service manifest
for the dnsmasq service. The manifest currently assumes that dnsmasq has
been installed in '/usr/local/sbin/dnsmasq' and the configuration file in
'/usr/local/etc/dnsmasq.conf', so you may have to adjust these paths for
your local installation. Here are the steps I followed to install and enable
the dnsmasq service:
# svccfg import dnsmasq.xml
# svcadm enable dnsmasq
To confirm that the service is enabled and online:
# svcs -l dnsmasq
I've just started learning about SMF so if anyone has any
corrections/feedback they are more than welcome.
Thanks,
David
dnsmasq-2.90/contrib/Solaris10/dnsmasq.xml 0000664 0001750 0001750 00000003570 14562671533 016722 0 ustar srk srk
dnsmasq server
dnsmasq - A lightweight DHCP and caching DNS server.
dnsmasq-2.90/contrib/Solaris10/README-sparc 0000664 0001750 0001750 00000000477 14562671533 016523 0 ustar srk srk Hi Simon,
I just wanted to let you know that I have built a Solaris .pkg install package of your dnsmasq utility for people to use. Feel free to point them in my direction if you have people who want this sort of thing.
http://ejesconsulting.wordpress.com/2010/05/12/gnu-dnsmasq-for-opensolaris-sparc/
Thanks
-evan
dnsmasq-2.90/contrib/Solaris10/create_package 0000664 0001750 0001750 00000005025 14562671533 017370 0 ustar srk srk #!/bin/sh
#
# For our package, and for the SMF script, we need to define where we
# want things to go...
#
BIN_DIR="/usr/sbin"
CONF_DIR="/etc"
MAN_DIR="/usr/share/man/man8"
PACKAGE_NAME="dnsmasq"
#
# Since we know we are in the contrib directory we can work out where
# the rest of the tree is...
#
BASEDIR="`dirname $0`/../.."
#
# We need a version number to use for the package creation...
#
if [ $# != 1 ]; then
echo "Usage: $0 " >&2
exit 1
fi
VERSION="$1"
#
# First thing we do is fix-up the smf file to use the paths we prefer...
#
if [ ! -f "${BASEDIR}/contrib/Solaris10/dnsmasq.xml" ]; then
echo "$0: unable to find contrib/Solaris10/dnsmasq.xml" >&2
exit 1
fi
echo "Fixing up smf file ... \c"
cat "${BASEDIR}/contrib/Solaris10/dnsmasq.xml" | \
sed -e "s%/usr/local/etc%${CONF_DIR}%" \
-e "s%/usr/local/sbin%${BIN_DIR}%" \
-e "s%/usr/local/man%${MAN_DIR}%" > ${BASEDIR}/contrib/Solaris10/dnsmasq-pkg.xml
echo "done."
echo "Creating packaging file ... \c"
cat <${BASEDIR}/contrib/Solaris10/dnsmasq_package.inc
#
# header
#
set name=pkg.name value="dnsmasq"
set name=pkg.description value="dnsmasq daemon - dns, dhcp, tftp etc"
set name=pkg.detailed_url value="http://www.thekelleys.org.uk/dnsmasq/doc.html"
set name=info.maintainer value="TBD (tbd@tbd.com)"
set name=info.upstream value="dnsmasq-discuss@lists.thekelleys.org.uk"
set name=info.upstream_url value="http://www.thekelleys.org.uk/dnsmasq/doc.html"
#
# dependencies ... none?
#
#
# directories
#
dir mode=0755 owner=root group=bin path=${BIN_DIR}/
dir mode=0755 owner=root group=sys path=${CONF_DIR}/
dir mode=0755 owner=root group=sys path=${MAN_DIR}/
dir mode=0755 owner=root group=sys path=/var/
dir mode=0755 owner=root group=sys path=/var/svc
dir mode=0755 owner=root group=sys path=/var/svc/manifest
dir mode=0755 owner=root group=sys path=/var/svc/manifest/network
#
# files
#
file ${BASEDIR}/src/dnsmasq mode=0555 owner=root group=bin path=${BIN_DIR}/dnsmasq
file ${BASEDIR}/man/dnsmasq.8 mode=0555 owner=root group=bin path=${MAN_DIR}/dnsmasq.8
file ${BASEDIR}/dnsmasq.conf.example mode=0644 owner=root group=sys path=${CONF_DIR}/dnsmasq.conf preserve=strawberry
file ${BASEDIR}/contrib/Solaris10/dnsmasq-pkg.xml mode=0644 owner=root group=sys path=/var/svc/manifest/network/dnsmasq.xml restart_fmri=svc:/system/manifest-import:default
EOF
echo "done."
echo "Creating package..."
eval `pkgsend open ${PACKAGE_NAME}@${VERSION}`
pkgsend include ${BASEDIR}/contrib/Solaris10/dnsmasq_package.inc
if [ "$?" = 0 ]; then
pkgsend close
else
echo "Errors"
fi
dnsmasq-2.90/contrib/Solaris10/README.create_package 0000664 0001750 0001750 00000002116 14562671533 020322 0 ustar srk srk Ok, script attached ... seems to be working ok for me,
tried to install and remove a few times. It does the
right thing with the smf when installing, you can then
simply enable the service. Upon removal it cleans up the
files but won't clean up the services (I think until
a reboot) ... I've only started looking at the new
packages stuff in the last day or two, so I could be
missing something, but I can't find any way to force
a proper cleanup.
It requires that you have a writable repository setup
as per the docs on the opensolaris website and it will
create a dnsmasq package (package name is a variable
in the script). The script takes a version number for
the package and assumes that it's in the contrib/Solaris10
directory, it then works out the base tree directory
from $0.
i.e. $ contrib/Solaris10/create_package 2.52-1
or $ cd contrib/Solaris10; ./create_package 2.52-1
It's a bit more complex than it could be because I
prefer putting the daemon in /usr/sbin and the config
in /etc, so the script will actually create a new
version of the existing contrib dnsmasq.xml.
dnsmasq-2.90/contrib/webmin/ 0000775 0001750 0001750 00000000000 14562671533 014231 5 ustar srk srk dnsmasq-2.90/contrib/webmin/README 0000664 0001750 0001750 00000004254 14562671533 015116 0 ustar srk srk
This is the README for the Dnsmasq webmin module.
Problems:
1) There's only basic error checking - if you enter some bad
addresses or names, they will go straight into the config file
although we do check for things like IP addresses being of
the correct form (no letters, 4 groups of up to 3 digits
separated by dots etc). One thing that ISN'T CHECKED FOR is
that IP dotted quads are all numbers < 256. Another is that
netmasks are logical (you could enter a netmask of 255.0.255.0
for example). Essentially, if it'll pass the config file
regex scanner (and the above examples will), it won't be
flagged as "bad" even if it is a big no-no for dnsmasq itself.
2) Code is ugly and a kludge - I ain't a programmer! There are probably
a lot of things that could be done to tidy up the code - eg,
it probably wouldn't hurt to move some common stuff into the lib file.
3) I've used the %text hash and written an english lang file, but
I am mono-lingual so no other language support as yet.
4) for reasons unknown to me, the icon does not appear properly
on the servers page of webmin (at least it doesn't for me!)
5) icons have been shamelessly stolen from the ipfilter module,
specifically the up and down arrows.
6) if you delete an item, the config file will contain
an otherwise empty, but commented line. This means that if
you add some new stuff, then delete it, the config file
will have a number of lines at the end that are just comments.
Therefore, the config file could possibly grow quite large.
7) NO INCLUDE FILES!
if you use an include file, it'll be flagged as an error.
OK if the include file line is commented out though.
8) deprecated lines not supported (eg user and group) - they
may produce an error! (user and group don't, but you can't change
them)
IOW, it works, it's just not very elegant and not very robust.
Hope you find it useful though - I do, as I prevents me having to ever
wade through the config file and man pages again.
If you modify it, or add a language file, and you have a spare moment,
please e-mail me - I won't be upset at all if you fix my poor coding!
(rather the opposite - I'd be pleased someone found it useful)
Cheers,
Neil Fisher
dnsmasq-2.90/contrib/webmin/dnsmasq.wbm 0000664 0001750 0001750 00000524000 14562671533 016407 0 ustar srk srk dnsmasq/ 0000755 0000000 0000000 00000000000 10512645440 011223 5 ustar root root dnsmasq/config.info 0000644 0000000 0000000 00000000132 10505663743 013351 0 ustar root root config_file=Full path to DNSmasq config file,0
restart=Shell script to re-start DNSmasq,0
dnsmasq/config 0000644 0000000 0000000 00000000061 10505663767 012426 0 ustar root root config_file=/etc/dnsmasq.conf
restart=restart.sh
dnsmasq/images/ 0000755 0000000 0000000 00000000000 10506375201 012466 5 ustar root root dnsmasq/images/icon.gif 0000644 0000000 0000000 00000000616 10505632635 014116 0 ustar root root GIF89a0 0 ccc , 0 0 I8k;`xqBY~b
vq*W^9\HCG!ŏD ?+ -p P j:@o1~9~mz{~}m y|D-@VQb,P'VOr^Vjxz;[f^zøȰ ܞħL}1O`By{{H@0E1F,D)~dH!%̑rґYm_61ɓgw4+3&,;\ZTEL{Z
5jS?Έ ; dnsmasq/images/template.gif 0000644 0000000 0000000 00000003560 06771443034 015005 0 ustar root root GIF89a0 UUU 999rrr!Made with GIMP , 0 8AZdiӠhksh߶L|G,rY̥q0 Ԓ0-]%6AkX=Q}~T{M oa-W~~x,vuc&$xa4e Syu`g$bͽ~ʣ `lˁj\QԸꪀ>"{9ۗFḃYWͳ?QdƌJf)hcv'w+ #1|XgO-ahB(`DZڄU.EbP FKD[B <
[Ŝ "JÞi0*a-VI@
\(I
/*!0@*>Lhp20:v6V.᧲.Ԛa&9M$bE\
d"uKw;_a_J]6㰣'yDt3WA3i6In:&Q,~tj'-W{!ϵ 71w^w P 8hY
2T\mS|FG]څGEvM1%!U.#pGDeV+.ע>>Y68duZ&8\GM}gMY{U.٢XX)kpKL(XF1M\J h#Ma&qrYF*]AhF9hT)L\]1lfj`\㩝pyV*M֪|8tY.$>\)(vJ:(܆N۬n/{'^yySU洦gj5ۃ-,䮳%K5;[~,|ӌJ:uzAd^8)W1ʩz)nj. zÇ9scm%Z[=Sy\ So]5E_]K[+uO5Sn3
bM Ēܶэ5rmBN!-?58Ŕ
hOk~
}3^Q8Yκi{=8'r;+pڛͻz*r4[0k&<#/$q;֜ tŅ" C
Mtv0_+PI 7 >$*F,N|H}t>YxT7s=X!ZÓJsؿd;v尋F`%-xG#6..O8xdH! D춨XjXϢV>q7c @<2_V1X^F p\2)Ѹ'OEf'$Gce˲eҐٛD/rI4ڥ@,+'6dlTT(7!@*:!,&ɴ< } h&iRUiџηibkCfPM~O('%Sfxy:5v*_I6m=Hn$z4Z(Q\e>5
DnRۘj4W百5%&Gi:fXJQ-IXq":xFS|`Hɔj-- {
DGjRv-[rzhhGKҚiWֺ6{lgKڢ ͭnwk\
pEr=ߒ:}t+R5.K ; dnsmasq/images/up.gif 0000644 0000000 0000000 00000000147 10506373750 013612 0 ustar root root GIF89a rrr !Made with GIMP !
, &
|'Io|b%eRG;Ssf ; dnsmasq/images/down.gif 0000644 0000000 0000000 00000000154 10506373750 014133 0 ustar root root GIF89a rrr !Made with GIMP !
, +@"IUieJbAIm.dN ; dnsmasq/images/gap.gif 0000644 0000000 0000000 00000000111 10506375201 013715 0 ustar root root GIF89a !Made with GIMP !
, ڋ> ; dnsmasq/module.info 0000644 0000000 0000000 00000000142 10501433425 013356 0 ustar root root name=DNSMasq
desc=DNSMasq integrated DNS & DHCP servers
os_support=
depends=0.77
category=servers
dnsmasq/index.cgi 0000755 0000000 0000000 00000007531 10512641067 013030 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - index.cgi; basic DNS config
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
&header($text{'index_title'}, "", "intro", 1, 1, undef,
"Written by Neil Fisher Author Home://page");
# uses the index_title entry from ./lang/en or appropriate
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
# output as web page
&header( "DNSMasq settings", "" );
&parse_config_file( \%config, \$config_file );
print "\n";
if( $config{errors} > 0 )
{
print "
WARNING: found ";
print $config{errors};
print "errors in config file!
\n";
print &ui_submit( $text{'save_button'} );
print &ui_form_end( );
print "";
print "";
print $text{'servers_config'};
print " ";
print "";
print $text{'iface_config'};
print " ";
print "";
print $text{'alias_config'};
print " ";
print "";
print "";
print $text{'DHCP_config'};
print " ";
print "";
print "";
print $text{'restart'};
print " ";
&footer("/", $text{'index'});
# uses the index entry in /lang/en
## if subroutines are not in an extra file put them here
### END of index.cgi ###.
dnsmasq/acl_security.pl 0000644 0000000 0000000 00000000561 07000420647 014246 0 ustar root root
# acl_security_form(&options)
# Output HTML for editing security options for the apache module
sub acl_security_form
{
## Here you have to fill in the code for output
}
# acl_security_save(&options)
# Parse the form for security options for the apache module
sub acl_security_save
{
## here you have to fill in the handling code for the saving the ACL
}
### END. dnsmasq/lang/ 0000755 0000000 0000000 00000000000 10512641175 012145 5 ustar root root dnsmasq/lang/en 0000644 0000000 0000000 00000007666 10512637344 012514 0 ustar root root
lang=en
author=Neil Fisher
module_author=Neil Fisher
homepage=www.nonexistent.invalid
copyright=(C) 2006 by Neil Fisher
license=GPL
index_title=DNSMasq - integrated DNS and DHCP servers
DNS_settings=Basic DNS settings
DHCP_settings=DHCP settings
DNS_servers=DNS Upstream Servers Configuration
iface_settings=Network Interface Settings
alias_settings=Alias / Redirect Settings
local_domain=Local domain name
domain_needed=Only forward names with a domain part
expand_hosts=Add local domain name to DHCP leases & hosts in /etc/hosts
bogus_priv=Allow unresolved reverse lookups on local network to propogate out
filterwin2k=Prevent windows SOA & SRV requests propogating out
resolv=Read /etc/resolv.conf
poll=poll resolv.conf file
resolv_file_explicit=Use non-standard resolv.conf file
resolv_file=non-standard resolv.conf file to use
strict_order=Always use nameservers in order provided
hosts=Read /etc/hosts file
xhosts=Use additional hosts file
xhostsfile=File to use for additional hosts
neg_cache=Cache negative responses
log_queries=Log each DNS lookup
cache_size=Use custom cache size
cust_cache_size=Custom cache size to use
local_ttl=Use specified local Time-To-Live
ttl=Local TTL
dynamic=Defined in resolv.conf file
domain=For domain
address=IP address
in_use=In use
used=In Use
not_used=Defined only (not used)
in_file=Defined in config file
new_dns_serv=Add new upstream server to config file
save_button=Save
servers_config=Configure upstream DNS Servers
alias_config=Configure Forced Domains and Alias responses
iface_config=Configure network interfaces
DHCP_config=Configure DHCP
restart=Restart DNSmasq
restarting=Trying to restart DNSmasq. Script messages are:
srv_edit=Edit upstream DNS server
srv_named=For specific domain
srv_name=Specific domain
srv_addr=Server address
delet=Delete
iface=Interface
xiface=Except Interface
listen=Listen on
new_iface=Add new interface
iface_listen=Interface to listen on
xiface_listen=Except interfaces
listen_addr=Listen Address
new_addr=Add new address
edit_iface=Edit interface
iface_name=Interface name
edit_xiface=Edit except interface
listen_name=Listen address
edit_listen=Edit listen address
xiface_name=Except interface name
bind_iface=Bind to individual interfaces instead of wildcard address
forced=Forced domain responses
nx=Forced NXDOMAIN IP addresses
alias=Aliased IP addresses
forced_domain=Domain name
forced_ip=To IP address
forced_from=From IP address
forced_mask=Netmask
forced_mask_used=Use a netmask
forced_add=Add new forced domain
alias_add=Add new alias
nx_add=Add new forced NXDOMAIN
forced_edit=Edit forced domain reponse
alias_edit=Edit IP address alias
nx_edit=Edit Forced NXDOMAIN response
net_id=Network/Client ID
timed=Use a lease time
leasetime=Lease time
dhcp_range=DHCP IP address ranges
range_edit=Edit DHCP range
range_add=Add new DHCP range
ided=Network ID
id=Network ID to use
hosts=Specific Hosts
host_add=Add a new host specification
vendor_classes=Vendor Class Specification
user_classes=User Class Specification
vendor=Vendor
user=User
class=Class
vend_add=Add new vendor class
user_add=Add new user class
read_ethers=Read /etc/ethers for lease info
misc=Miscellaneous DHCP options
dhcp_options=Non-standard DHCP options
dhcp_option=Option
dhcp_add=Add new option
edit_host=Edit DHCP host specification
edit_opt=Edit DHCP options
opt_spec=DHCP option specification
use_bootp=Use BOOTP (network boot)
bootp_host=Hostname
bootp_file=File
bootp_address=IP Address
max_leases=Maximum number of leases to grant
leasefile=Use a nonstandard lease file
lfikletouse=Nonstandard leasefile to use
error_heading=Warning - ERROR!!!!
err_line=Error in line:
err_type=Type of error is:
err_help=Try going back and retyping the offending information
err_notip=Not a valid IP address
err_notmask=Not a valid netmask
err_nottime=not a valid time
err_configbad=Configuration file has an error
err_filebad=Bad file name
err_hostbad=Bad host name
err_numbbad=Bad number
err_domainbad=Bad domain
err_namebad=Bad name
dnsmasq/lang/en~ 0000644 0000000 0000000 00000000344 07076651262 012702 0 ustar root root
lang=en
author=Name of language file author here
module_author=Writers name here
homepage=modules homepage url here
copyright=(C) YYYY by author
license=GPL
your_message=here you have to write your messages
dnsmasq/.index.cgi.swp 0000644 0000000 0000000 00000030000 10475225557 013710 0 ustar root root b0VIM 6.3 R+DB # staff upstairs.localnet ~staff/template/index.cgi 3210#"! U tp I ad $ \ I V U
R
Q
=
7
] B A 5 4
~
z
w
u
t
_
E
C
x w v \ ### END of### END of index.cgi ###. ## if subroutines are not in an extra file put them here # uses the index entry in /lang/en &footer("/", $text{'index'}); &header( "DNSmasq configuration", "" ); } print "$key = $config{$key} "; { foreach my $key (%config) # output as web page } } } $config{"$line"}=1; { else } $config{"$1"}=$2; { if ($line =~ /(.*)\=(.*)/) next if( $line =~ /^\#/ ); { if (defined ($line)) { foreach my $line (@$config_file) my %config; # pass into data structure $config_file = &read_file_lines( "/etc/dnsmasq.conf" ); # read config file ## Insert Output code here # uses the index_title entry from ./lang/en or appropriate "Written by Neil Fisher Author Home://page"); &header($text{'index_title'}, "", "intro", 1, 1, undef, ## sanity checks ## put in ACL checks here if needed %access=&get_module_acl; &init_config("MODULENAME"); $|=1; do '../web-lib.pl'; # This module inherited from the Webmin Module Template 0.79.1 by tn # # GNU General Public License for more details. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # but WITHOUT ANY WARRANTY; without even the implied warranty of # This program is distributed in the hope that it will be useful, # # (at your option) any later version. # the Free Software Foundation; either version 2 of the License, or # it under the terms of the GNU General Public License as published by # This program is free software; you can redistribute it and/or modify # # Copyright (C) 2006 by Neil Fisher # DNSMasq Webmin Module # #!/usr/bin/perl dnsmasq/srv_edit.cgi 0000755 0000000 0000000 00000004503 10512323643 013531 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - dns_edit.cgi; upstream server edit
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
";
print &ui_columns_start( [ $text{domain}, $text{address},
$text{in_use}, "" ], 100 );
foreach my $server ( @{$config{servers}} )
{
local ( $mover, $edit );
if( $count == @{$config{servers}}-1 )
{
$mover="";
}
else
{
$mover = "";
}
if( $count == 0 )
{
$mover.="";
}
else
{
$mover .= "";
}
$edit = "".$$server{address}."";
print &ui_columns_row( [ $$server{domain}, $edit,
($$server{used})?$text{used}:$text{not_used}, $mover ],
[ "width=30%", "width=30%", "width=30%", "width=10%" ] );
$count++;
}
print &ui_columns_end();
print " ".
$text{new_dns_serv}."";
print " " . &ui_submit( $text{'save_button'} );
print &ui_form_end();
print "";
print "";
print $text{'DNS_settings'};
print " ";
print "";
print $text{'iface_config'};
print " ";
print "";
print $text{'alias_config'};
print " ";
print "";
print "";
print $text{'DHCP_config'};
print " ";
&footer("/", $text{'index'});
# uses the index entry in /lang/en
## if subroutines are not in an extra file put them here
### END of servers.cgi ###.
dnsmasq/iface.cgi 0000755 0000000 0000000 00000007117 10512345430 012763 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - iface.cgi; network interfaces
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
&header($text{'index_title'}, "", "intro", 1, 1, undef,
"Written by Neil Fisher Author Home://page");
# uses the index_title entry from ./lang/en or appropriate
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
# output as web page
my $count=0;
&header( "DNSMasq settings", "" );
&parse_config_file( \%config, \$config_file );
print "
";
$count=0;
print &ui_columns_start( [ $text{listen_addr}, $text{in_use} ], 100 );
foreach my $iface ( @{$config{listen_on}} )
{
my $edit = "".$$iface{address}."";
print &ui_columns_row( [ $edit, ($$iface{used})?$text{used}:$text{not_used} ],
[ "width=30%", "width=30%", "width=30%" ] );
$count++;
}
print &ui_columns_end();
print " ";
print " ".
$text{new_addr}." ";
print &ui_form_start( 'iface_apply.cgi', "post" );
print $text{bind_iface};
print &ui_yesno_radio( "bind_iface", ($config{bind_interfaces}{used})?1:0 );
print " ".&ui_submit( $text{save_button} );
print &ui_form_end();
print " ".$text{'DNS_settings'}." ";
print "".$text{'servers_config'}." ";
print "".$text{'alias_config'}." ";
print "";
print "";
print $text{'DHCP_config'};
print " ";
&footer("/", $text{'index'});
# uses the index entry in /lang/en
## if subroutines are not in an extra file put them here
### END of iface.cgi ###.
dnsmasq/iface_edit.cgi 0000755 0000000 0000000 00000004061 10512324451 013763 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - iface_edit.cgi; edit interface
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
DNSmasq is an integrated DNS caching proxy server and DHCP server designed
to run on a host that is masquerading a local private network to the rest
of the internet.
Configuring DNSmasq
In most cases, all you'll need to change will be the local domain name. Under
some circumstances, you may want to change how DNSmasq resolves names to
allow for other local nameservers (if for example you are using a VPN
tunnel to another location).
All the functionality of DNSmasq is beyond the scope of this help file -
please read the man pages!
Limitations
Please read the README file.
In Short, this is a quick and dirty implementation with virtually
no error checking. Therefore, it assumes you
know what you are doing!
Use with care!
If you enter a name where a IP address
should be (for example) then you may need to edit the config file
manually to remove or edit the offending line. YOU HAVE BEEN WARNED!
dnsmasq/alias.cgi 0000755 0000000 0000000 00000007540 10512627251 013011 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - alias.cgi; aliasing and redirection
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
# output as web page
&parse_config_file( \%config, \$config_file );
if( $config{errors} > 0 )
{
my $line="error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
&header($text{'index_title'}, "", "intro", 1, 1, undef,
"Written by Neil Fisher Author Home://page");
print "\n";
# uses the index_title entry from ./lang/en or appropriate
print " \n";
print "
\n";
print "";
print $text{'DNS_settings'};
print " ";
print "";
print $text{'DNS_servers'};
print " ";
print "";
print $text{'iface_config'};
print " ";
print "";
print "";
print $text{'DHCP_config'};
print " ";
&footer("/", $text{'index'});
# uses the index entry in /lang/en
## if subroutines are not in an extra file put them here
### END of alias.cgi ###.
dnsmasq/dhcp.cgi 0000755 0000000 0000000 00000013060 10512347345 012633 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - dhcp.cgi; DHCP config
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
&header($text{'index_title'}, "", "intro", 1, 1, undef,
"Written by Neil Fisher Author Home://page");
# uses the index_title entry from ./lang/en or appropriate
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
# output as web page
&header( "DNSMasq settings", "" );
&parse_config_file( \%config, \$config_file );
print "\n";
if( $config{errors} > 0 )
{
print "
WARNING: found ";
print $config{errors};
print "errors in config file!
\n";
}
print " \n";
print "
$text{'DHCP_settings'}
";
print " \n";
my $count;
my $width;
$count=0;
$width="width=33%";
print "
".&ui_submit( $text{'save_button'} );
print &ui_form_end( );
print " ";
print $text{'DNS_settings'};
print " ";
&footer("/", $text{'index'});
# uses the index entry in /lang/en
## if subroutines are not in an extra file put them here
### END of dhcp.cgi ###.
dnsmasq/restart.cgi 0000755 0000000 0000000 00000003005 10507123056 013372 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - restart.cgi; restart DNSmasq
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
&header($text{'index_title'}, "", "intro", 1, 1, undef,
"Written by Neil Fisher Author Home://page");
# uses the index_title entry from ./lang/en or appropriate
## Insert Output code here
# output as web page
my $line=$config{restart};
&header( "DNSMasq settings", "" );
print $text{restarting} . " ";
print `$line`;
print " ";
print $text{DNS_settings};
print "";
&footer("/", $text{'index'});
# uses the index entry in /lang/en
## if subroutines are not in an extra file put them here
### END of restart.cgi ###.
dnsmasq/srv_apply.cgi 0000755 0000000 0000000 00000004153 10512642213 013727 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - srv_apply.cgi; update DNS server info
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line = "error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# check for input data errors
if( ($in{resolv_std}) && ($in{resolv_file} !~ /^$FILE$/) )
{
my $line = "error.cgi?line=".$text{resolv_file};
$line .= "&type=".$text{err_filebad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
# use resolv.conf?
#
&update( $config{no_resolv}{line}, "no-resolv",
$config_file, ( $in{resolv} == 0 ) );
#
# standard location for resolv.conf?
#
&update( $config{resolv_file}{line}, "resolv-file=".$in{resolv_file},
$config_file, ( $in{resolv_std} == 1 ) );
#
# servers in order provided?
#
&update( $config{strict_order}{line}, "strict-order",
$config_file, ( $in{strict} == 1 ) );
#
# poll resolv.conf?
#
&update( $config{no_poll}{line}, "no-poll",
$config_file, ( $in{poll} == 0 ) );
#
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "servers.cgi" );
#
# sub-routines
#
### END of srv_apply.cgi ###.
dnsmasq/restart.sh 0000755 0000000 0000000 00000000340 10506066357 013252 0 ustar root root #!/bin/bash
echo "killing existing process PID is "
cat /var/run/dnsmasq.pid
kill -9 `cat /var/run/dnsmasq.pid`
echo "done. Starting new process..."
/usr/local/sbin/dnsmasq
echo "Done. New PID is "
cat /var/run/dnsmasq.pid
dnsmasq/srv_move.cgi 0000755 0000000 0000000 00000004045 10507102723 013551 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - dns_move.cgi; move server
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
my $selected=$config{servers}[$in{idx}]{line};
if( $in{dir} eq "up" )
{
$config{servers}[$in{idx}]{line}=$config{servers}[$in{idx}-1]{line};
$config{servers}[$in{idx}-1]{line}=$selected;
}
else
{
$config{servers}[$in{idx}]{line}=$config{servers}[$in{idx}+1]{line};
$config{servers}[$in{idx}+1]{line}=$selected;
}
foreach my $server (@{$config{servers}})
{
$line= ($$server{domain_used}) ?
"server=/".$$server{domain}."/".$$server{address} :
"server=".$$server{address};
&update( $$server{line}, $line,
$config_file, ($$server{used}) );
}
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "servers.cgi" );
#
# sub-routines
#
### END of dns_move.cgi ###.
dnsmasq/srv_edit_apply.cgi 0000755 0000000 0000000 00000003646 10512642225 014745 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - srv_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line = "error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# check for input data errors
if( $in{addr} !~ /^$IPADDR$/ )
{
my $line = "error.cgi?line=".$text{srv_addr};
$line .= "&type=".$text{err_notip};
&redirect( $line );
exit;
}
if( ($in{named}) && ($in{name} !~ /^$NAME$/) )
{
my $line = "error.cgi?line=".$text{srv_name};
$line .= "&type=".$text{err_domainbad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="server=";
$line .= ($in{named})?"/".$in{name}."/":"";
$line .= $in{addr};
&update( $config{servers}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "servers.cgi" );
#
# sub-routines
#
### END of srv_edit_apply.cgi ###.
dnsmasq/delete.cgi 0000755 0000000 0000000 00000002654 10512627424 013165 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - delete.cgi; delete a line
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line="error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
#
&update( $config{$in{what}}[$in{idx}]{line}, "",
$config_file, 0 );
&flush_file_lines();
&redirect( $in{where} );
#
# sub-routines
#
### END of delete.cgi ###.
dnsmasq/xiface_edit.cgi 0000755 0000000 0000000 00000004104 10512343715 014155 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - xiface_edit.cgi; edit except interface
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
" . &ui_submit( $text{'save_button'} )." ";
print &ui_form_end();
print "".
$text{delet}."";
print " < a href=iface.cgi>".$text{iface_config}."";
&footer( "/", $text{'index'});
#
#
# sub-routines
#
### END of xiface_edit.cgi ###.
dnsmasq/listen_edit.cgi 0000755 0000000 0000000 00000004070 10512324553 014215 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - listen_edit.cgi; edit listen on
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
" . &ui_submit( $text{'save_button'} )." ";
print &ui_form_end();
print "".$text{delet}."";
print " ".$text{iface_config}."";
&footer( "/", $text{'index'});
#
#
# sub-routines
#
### END of listen_edit.cgi ###.
dnsmasq/nx_edit.cgi 0000755 0000000 0000000 00000004025 10512324660 013343 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - nx_edit.cgi; edit forced NXDOMAIN
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
" . &ui_submit( $text{'save_button'} )." ";
print &ui_form_end();
print "".$text{delet}."";
print " ".$text{alias_config}."";
&footer( "/", $text{'index'});
#
#
# sub-routines
#
### END of nx_edit.cgi ###.
dnsmasq/add.cgi 0000755 0000000 0000000 00000002650 10512627117 012446 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - add.cgi; add a line
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line="error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
push @{$config_file}, "#".$in{what};
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( $in{where} );
#
# sub-routines
#
### END of add.cgi ###.
dnsmasq/README 0000644 0000000 0000000 00000004255 10512644024 012106 0 ustar root root
This is the README for the DNSmasq webmin module.
Problems:
1) There's only basic error checking - if you enter some bad
addresses or names, they will go straight into the config file
although we do check for things like IP addresses being of
the correct form (no letters, 4 groups of up to 3 digits
separated by dots etc). One thing that ISN'T CHECKED FOR is
that IP dotted quads are all numbers < 256. Another is that
netmasks are logical (you could enter a netmask of 255.0.255.0
for example). Essentially, if it'll pass the config file
regex scanner (and the above examples will), it won't be
flagged as "bad" even if it is a big no-no for dnsmasq itself.
2) Code is ugly and a kludge - I ain't a programmer! There are probably
a lot of things that could be done to tidy up the code - eg,
it probably wouldn't hurt to move some common stuff into the lib file.
3) I've used the %text hash and written an english lang file, but
I am mono-lingual so no other language support as yet.
4) for reasons unknown to me, the icon does not appear properly
on the servers page of webmin (at least it doesn't for me!)
5) icons have been shamelessly stolen from the ipfilter module,
specifically the up and down arrows.
6) if you delete an item, the config file will contain
an otherwise empty, but commented line. This means that if
you add some new stuff, then delete it, the config file
will have a number of lines at the end that are just comments.
Therefore, the config file could possibly grow quite large.
7) NO INCLUDE FILES!
if you use an include file, it'll be flagged as an error.
OK if the include file line is commented out though.
8) deprecated lines not supported (eg user and group) - they
may produce an error! (user and group don't, but you can't change
them)
IOW, it works, it's just not very elegant and not very robust.
Hope you find it useful though - I do, as I prevents me having to ever
wade through the config file and man pages again.
If you modify it, or add a language file, and you have a spare moment,
please e-mail me - I won't be upset at all if you fix my poor coding!
(rather the opposite - I'd be pleased someone found it usefull)
Cheers,
Neil Fisher
dnsmasq/iface_edit_apply.cgi 0000755 0000000 0000000 00000003040 10512633233 015165 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - iface_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line = "error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="interface=".$in{iface};
&update( $config{interface}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "iface.cgi" );
#
# sub-routines
#
### END of iface_edit_apply.cgi ###.
dnsmasq/xiface_edit_apply.cgi 0000755 0000000 0000000 00000003055 10512640306 015362 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - xiface_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line = "error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="except-interface=".$in{iface};
&update( $config{ex_interface}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "iface.cgi" );
#
# sub-routines
#
### END of _xiface_edit_apply.cgi ###.
dnsmasq/listen_edit_apply.cgi 0000755 0000000 0000000 00000003325 10512642154 015424 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - listen_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line= "error.cgi?line=x&type=".$text{listen_addr};
&redirect( $line );
exit;
}
# check for input data errors
if( $in{addr} !~ /^$IPADDR$/ )
{
my $line= "error.cgi?line=".$text{listen_addr};
$line .= "&type=".$text{err_notip};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="listen-address=".$in{addr};
&update( $config{listen_on}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "iface.cgi" );
#
# sub-routines
#
### END of listen_edit_apply.cgi ###.
dnsmasq/range_edit_apply.cgi 0000755 0000000 0000000 00000005352 10512642203 015217 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - range_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line = "error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# check for input data errors
if( $in{from} !~ /^$IPADDR$/ )
{
my $line = "error.cgi?line=".$text{forced_from};
$line .= "&type=".$text{err_notip};
&redirect( $line );
exit;
}
if( $in{to} !~ /^$IPADDR$/ )
{
my $line = "error.cgi?line=".$text{forced_ip};
$line .= "&type=".$text{err_notip};
&redirect( $line );
exit;
}
if( ($in{masked}) && ($in{mask} !~ /^$IPADDR$/) )
{
my $line = "error.cgi?line=".$text{forced_mask};
$line .= "&type=".$text{err_notmask};
&redirect( $line );
exit;
}
if( ($in{timed}) && ($in{'time'} !~ /^$TIME$/) )
{
my $line = "error.cgi?line=".$text{leasetime};
$line .= "&type=".$text{err_nottime};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="dhcp-range=";
$line .= $in{id}."," if $in{ided};
$line .= $in{from}.",".$in{to};
$line .= $in{mask} if $in{masked};
$line .= $in{'time'} if $in{timed};
&update( $config{dhcp_range}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "dhcp.cgi" );
#
# sub-routines
#
### END of range_edit_apply.cgi ###.
# adjust everything to what we got
#
my $line="dhcp-range=";
$line .= $in{id}."," if $in{ided};
$line .= $in{from}.",".$in{to};
$line .= $in{mask} if $in{masked};
$line .= $in{'time'} if $in{timed};
&update( $config{dhcp_range}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "dhcp.cgi" );
#
# sub-routines
#
### END of range_edit_apply.cgi ###.
dnsmasq/host_edit.cgi 0000755 0000000 0000000 00000004057 10512351537 013703 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - host_edit.cgi; edit DHCP host
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
" . &ui_submit( $text{'save_button'} )." ";
print &ui_form_end();
print "".$text{delet}."";
print " ".$text{DHCP_settings}."";
&footer( "/", $text{'index'});
#
#
# sub-routines
#
### END of host_edit.cgi ###.
dnsmasq/range_edit.cgi 0000755 0000000 0000000 00000005413 10512347165 014021 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - range_edit.cgi; DHCP range edit
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
" . &ui_submit( $text{'save_button'} )." ";
print &ui_form_end();
print "".$text{delet}."";
print " ".$text{DHCP_settings}."";
&footer( "/", $text{'index'});
#
#
# sub-routines
#
### END of range_edit.cgi ###.
dnsmasq/option_edit.cgi 0000755 0000000 0000000 00000004076 10512351517 014235 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - option_edit.cgi; edit DHCP option
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
" . &ui_submit( $text{'save_button'} )." ";
print &ui_form_end();
print "".$text{delet}."";
print " ".$text{DHCP_settings}."";
&footer( "/", $text{'index'});
#
#
# sub-routines
#
### END of option_edit.cgi ###.
dnsmasq/host_edit_apply.cgi 0000755 0000000 0000000 00000003032 10512633002 015066 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - host_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line="error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="dhcp-host=".$in{host};
&update( $config{dhcp_host}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "dhcp.cgi" );
#
# sub-routines
#
### END of host_edit_apply.cgi ###.
dnsmasq/iface_apply.cgi 0000755 0000000 0000000 00000003002 10512633156 014162 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - iface_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line = "error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
&update( $config{bind_interfaces}{line}, "bind-interfaces",
$config_file, ( $in{bind_iface} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "iface.cgi" );
#
# sub-routines
#
### END of iface_apply.cgi ###.
dnsmasq/forced_edit.cgi 0000755 0000000 0000000 00000004230 10512324260 014152 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - forced_edit.cgi; forced domain response edit
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
" . &ui_submit( $text{'save_button'} )." ";
print &ui_form_end();
print "".$text{delet}."";
print " ".$text{alias_config}."";
&footer( "/", $text{'index'});
#
#
# sub-routines
#
### END of forced_edit.cgi ###.
dnsmasq/alias_edit.cgi 0000755 0000000 0000000 00000004350 10512627345 014016 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - alias_edit.cgi; IP alias edit
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line="error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
" . &ui_submit( $text{'save_button'} )." ";
print &ui_form_end();
print "".$text{delet}."";
print " ".$text{alias_config}."";
&footer( "/", $text{'index'});
#
#
# sub-routines
#
### END of alias_edit.cgi ###.
dnsmasq/option_edit_apply.cgi 0000755 0000000 0000000 00000003040 10512633571 015433 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - option_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line= "error.cgi?line=x&type=".$text{listen_addr};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="dhcp-option=".$in{host};
&update( $config{dhcp_option}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "dhcp.cgi" );
#
# sub-routines
#
### END of option_edit_apply.cgi ###.
dnsmasq/basic_apply.cgi 0000755 0000000 0000000 00000007200 10512642037 014176 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - dns_apply.cgi; update basic DNS info
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line = "error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# check user input for obvious errors
if( $in{local_domain} !~ /^$FILE$/ )
{
my $line = "error.cgi?line=".$text{local_domain};
$line .= "&type=".$text{err_domainbad};
&redirect( $line );
exit;
}
if( ($in{xhosts}) && ($in{addn_hosts} !~ /^$FILE$/) )
{
my $line = "error.cgi?line=".$text{xhostsfile};
$line .= "&type=".$text{err_filebad};
&redirect( $line );
exit;
}
if( ($in{cache_size}) && ($in{cust_cache_size} !~ /^$NUMBER/) )
{
my $line = "error.cgi?line=".$text{cust_cache_size};
$line .= "&type=".$text{err_numbbad};
&redirect( $line );
exit;
}
if( ($in{local_ttl}) && ($in{ttl} !~ /^$NUMBER/) )
{
my $line = "error.cgi?line=".$text{ttl};
$line .= "&type=".$text{err_numbbad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
#our local domain
#
&update( $config{domain}{line}, "domain=".$in{local_domain},
$config_file, 1 );
#
# need domains for forwarded lookups?
#
&update( $config{domain_needed}{line}, "domain-needed",
$config_file, ( $in{domain_needed} == 1 ) );
#
# add local domain to local hosts?
#
&update( $config{expand_hosts}{line}, "expand-hosts",
$config_file, ( $in{expand_hosts} == 1 ) );
#
# reverse lookups of local subnets propogating?
#
# NOTE: reversed logic in question!
&update( $config{bogus_priv}{line}, "bogus-priv",
$config_file, ( $in{bogus_priv} == 0 ) );
#
# reverse lookups of local subnets propogating?
#
&update( $config{filterwin2k}{line}, "filterwin2k",
$config_file, ( $in{filterwin2k} == 1 ) );
#
# read /etc/hosts?
#
# NOTE: reverse logic in config file
&update( $config{no_hosts}{line}, "no-hosts",
$config_file, ( $in{hosts} == 0 ) );
#
# read extra hosts file?
#
&update( $config{addn_hosts}{line}, "addn-hosts=".$in{addn_hosts},
$config_file, ( $in{xhosts} == 1 ) );
#
# negative caching?
#
# NOTE: reverse logic in config file
&update( $config{neg_cache}{line}, "no-negcache",
$config_file, ( $in{neg_cache} == 0 ) );
#
# custom cache size?
#
&update( $config{cache_size}{line}, "cache-size=".$in{cust_cache_size},
$config_file, ( $in{cache_size} == 1 ) );
#
# log all lookups?
#
&update( $config{log_queries}{line}, "log-queries",
$config_file, ( $in{log_queries} == 1 ) );
#
# cache size?
#
&update( $config{local_ttl}{line}, "local-ttl=".$in{ttl},
$config_file, ( $in{local_ttl} == 1) );
#
#
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "index.cgi" );
#
# sub-routines
#
### END of dns_apply.cgi ###.
dnsmasq/alias_edit_apply.cgi 0000755 0000000 0000000 00000004073 10512641777 015232 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - alias_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line="error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# check user input for obvious errors
if( $in{from} !~ /^$IPADDR$/ )
{
my $line="error.cgi?line=".$text{forced_from};
$line .= "&type=".$text{err_notip};
&redirect( $line );
exit;
}
if( $in{to} !~ /^$IPADDR$/ )
{
my $line="error.cgi?line=".$text{forced_ip};
$line .= "&type=".$text{err_notip};
&redirect( $line );
exit;
}
if( ($in{mask}) && ($in{netmask} !~ /^$IPADDR$/) )
{
my $line="error.cgi?line=".$text{forced_mask};
$line .= "&type=".$text{err_notip};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="alias=".$in{from}.",".$in{to};
$line .= ",".$in{netmask} if $in{mask};
&update( $config{alias}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "alias.cgi" );
#
# sub-routines
#
### END of alias_edit_apply.cgi ###.
dnsmasq/forced_edit_apply.cgi 0000755 0000000 0000000 00000003571 10512642101 015363 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - forced_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line="error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# check for input data errors
if( $in{domain} !~ /^$NAME$/ )
{
my $line="error.cgi?line=".$text{forced_domain};
$line .= "&type=".$text{err_domainbad};
&redirect( $line );
exit;
}
if( $in{to} !~ /^$IPADDR$/ )
{
my $line="error.cgi?line=".$text{forced_domain};
$line .= "&type=".$text{err_domainbad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="address=/".$in{domain}."/".$in{to};
&update( $config{forced}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "alias.cgi" );
#
# sub-routines
#
### END of forced_edit_apply.cgi ###.
dnsmasq/nx_edit_apply.cgi 0000755 0000000 0000000 00000003311 10512642170 014544 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - nx_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line= "error.cgi?line=x&type=".$text{listen_addr};
&redirect( $line );
exit;
}
# check for input data errors
if( $in{from} !~ /^$IPADDR$/ )
{
my $line= "error.cgi?line=".$text{forced_from};
$line .= "&type=".$text{err_notip};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="bogus-nxdomain=".$in{from};
&update( $config{bogus}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "alias.cgi" );
#
# sub-routines
#
### END of nx_edit_apply.cgi ###.
dnsmasq/user_edit.cgi 0000755 0000000 0000000 00000004171 10512343452 013676 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - vend_edit.cgi; edit user class
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
" . &ui_submit( $text{'save_button'} )." ";
print &ui_form_end();
print "".$text{delet}."";
print " ".$text{DHCP_config}."";
&footer( "/", $text{'index'});
#
#
# sub-routines
#
### END of user_edit.cgi ###.
dnsmasq/vend_edit.cgi 0000755 0000000 0000000 00000004210 10512343567 013655 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - vend_edit.cgi; edit vendor class
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
&header( "DNSMasq settings", "" );
print "
";
print $text{warn_errors};
print $config{errors};
print $text{didnt_apply};
print "\n";
&footer( "/", $text{'index'});
exit;
}
# adjust everything to what we got
#
&header( "DNSMasq settings", "" );
print "
" . &ui_submit( $text{'save_button'} )." ";
print &ui_form_end();
print "".
$text{delet}."";
print " ".$text{DHCP_config}."";
&footer( "/", $text{'index'});
#
#
# sub-routines
#
### END of vend_edit.cgi ###.
dnsmasq/dhcp_apply.cgi 0000755 0000000 0000000 00000005362 10512642064 014042 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - dhcp_apply.cgi; update misc DHCP info
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line="error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# check for input data errors
if( $in{bootp_addr} !~ /^$IPADDR$/ )
{
my $line="error.cgi?line=".$text{bootp_address};
$line .= "&type=".$text{err_notip};
&redirect( $line );
exit;
}
if( $in{bootp_file} !~ /^$FILE$/ )
{
my $line="error.cgi?line=".$text{bootp_file};
$line .= "&type=".$text{err_filebad};
&redirect( $line );
exit;
}
if( $in{bootp_host} !~ /^$NAME$/ )
{
my $line="error.cgi?line=".$text{bootp_host};
$line .= "&type=".$text{err_hostbad};
&redirect( $line );
exit;
}
if( $in{max_leases} !~ /^$NUMBER$/ )
{
my $line="error.cgi?line=".$text{max_leases};
$line .= "&type=".$text{err_numbbad};
&redirect( $line );
exit;
}
if( $in{leasefile} !~ /^$FILE$/ )
{
my $line="error.cgi?line=".$text{leasefile};
$line .= "&type=".$text{err_filebad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
# read /etc/ethers
#
&update( $config{dhcp_ethers}{line}, "read-ethers",
$config_file, ($in{ethers} == 1) );
#
# bootp
#
my $line="dhcp-boot=".$in{bootp_file}.",".$in{bootp_host};
$line .= ",".$in{bootp_addr};
&update( $config{dhcp_boot}{line}, $line,
$config_file, ($in{bootp} == 1) );
#
# max leases
#
&update( $config{dhcp_leasemax}{line}, "dhcp-lease-max=".$in{max_leases},
$config_file, ($in{max_leases} != 150) );
#
# leases file
#
&update( $config{dhcp_leasefile}{line}, "dhcp-leasefile=".$in{leasefile},
$config_file, ($in{useleasefile} == 1) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "dhcp.cgi" );
#
# sub-routines
#
### END of dhcp_apply.cgi ###.
dnsmasq/user_edit_apply.cgi 0000755 0000000 0000000 00000003557 10512642234 015112 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - user_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line = "error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# check for input data errors
if( $in{class} !~ /^$NAME$/ )
{
my $line = "error.cgi?line=".$text{class};
$line .= "&type=".$text{err_namebad};
&redirect( $line );
exit;
}
if( $in{user} !~ /^$NAME$/ )
{
my $line = "error.cgi?line=".$text{user};
$line .= "&type=".$text{err_namebad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="dhcp-userclass=".$in{class}.",".$in{user};
&update( $config{user_class}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "dhcp.cgi" );
#
# sub-routines
#
### END of user_edit_apply.cgi ###.
dnsmasq/vend_edit_apply.cgi 0000755 0000000 0000000 00000003573 10512642243 015066 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - vend_edit_apply.cgi; do the update
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
## Insert Output code here
# read config file
$config_file = &read_file_lines( $config{config_file} );
# pass into data structure
&parse_config_file( \%config, \$config_file );
# read posted data
&ReadParse();
# check for errors in read config
if( $config{errors} > 0 )
{
my $line = "error.cgi?line=xx&type=".$text{err_configbad};
&redirect( $line );
exit;
}
# check for input data errors
if( $in{class} !~ /^$NAME$/ )
{
my $line = "error.cgi?line=".$text{class};
$line .= "&type=".$text{err_namebad};
&redirect( $line );
exit;
}
if( $in{vendor} !~ /^$NAME$/ )
{
my $line = "error.cgi?line=".$text{vendor};
$line .= "&type=".$text{err_namebad};
&redirect( $line );
exit;
}
# adjust everything to what we got
#
my $line="dhcp-vendorclass=".$in{class}.",".$in{vendor};
&update( $config{vendor_class}[$in{idx}]{line}, $line,
$config_file, ( $in{used} == 1 ) );
#
# write file!!
&flush_file_lines();
#
# re-load basic page
&redirect( "dhcp.cgi" );
#
# sub-routines
#
### END of vend_edit_apply.cgi ###.
dnsmasq/error.cgi 0000755 0000000 0000000 00000003026 10511350547 013044 0 ustar root root #!/usr/bin/perl
#
# DNSMasq Webmin Module - error.cgi; report errors
# Copyright (C) 2006 by Neil Fisher
#
# 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.
#
# This module inherited from the Webmin Module Template 0.79.1 by tn
do '../web-lib.pl';
do '../ui-lib.pl';
do 'dnsmasq-lib.pl';
$|=1;
&init_config("DNSMasq");
%access=&get_module_acl;
## put in ACL checks here if needed
## sanity checks
&header($text{'index_title'}, "", "intro", 1, 1, undef,
"Written by Neil Fisher Author Home://page");
# uses the index_title entry from ./lang/en or appropriate
## Insert Output code here
# output as web page
&ReadParse();
print "