diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2010-01-22 20:16:09 +0000 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2012-01-05 17:31:15 +0000 |
commit | 316e2730acfc439c6bb12beb7c286daffb3cac4e (patch) | |
tree | 6cc34f1b137b5c39f2df2bfbe6276725a1e323d3 /contrib | |
parent | 1f15b81d610eb7c9612814603221d25871927833 (diff) | |
download | dnsmasq-316e2730acfc439c6bb12beb7c286daffb3cac4e.tar.gz |
import of dnsmasq-2.52.tar.gzv2.52
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/CPE-WAN/README | 36 | ||||
-rw-r--r-- | contrib/MacOSX-launchd/launchd-README.txt | 38 | ||||
-rw-r--r-- | contrib/MacOSX-launchd/uk.org.thekelleys.dnsmasq.plist | 17 | ||||
-rw-r--r-- | contrib/Solaris10/README.create_package | 25 | ||||
-rw-r--r-- | contrib/Solaris10/create_package | 87 | ||||
-rwxr-xr-x | contrib/dnsmasq_MacOSX-pre10.4/DNSmasq (renamed from contrib/dnsmasq_MacOSX/DNSmasq) | 0 | ||||
-rw-r--r-- | contrib/dnsmasq_MacOSX-pre10.4/README.rtf (renamed from contrib/dnsmasq_MacOSX/README.rtf) | 0 | ||||
-rw-r--r-- | contrib/dnsmasq_MacOSX-pre10.4/StartupParameters.plist (renamed from contrib/dnsmasq_MacOSX/StartupParameters.plist) | 0 |
8 files changed, 203 insertions, 0 deletions
diff --git a/contrib/CPE-WAN/README b/contrib/CPE-WAN/README new file mode 100644 index 0000000..4d56347 --- /dev/null +++ b/contrib/CPE-WAN/README @@ -0,0 +1,36 @@ +Dnsmasq from version 2.52 has a couple of rather application-specific +features designed to allow for implementation of the DHCP part of CPE +WAN management protocol. + +http://www.broadband-forum.org/technical/download/TR-069_Amendment-2.pdf +http://en.wikipedia.org/wiki/TR-069 + +The relevant sections are F.2.1 "Gateway Requirements" and F.2.5 "DHCP +Vendor Options". + +First, dnsmasq checks for DHCP requests which contain an option-125 +vendor-class option which in turn holds a vendor section for IANA +enterprise number 3561 which contains sub-options codes 1 and 2. If +this is present then the network-tag "cpewan-id" is set. +This allows dnsmasq to be configured to reply with the correct +GatewayManufacturerOUI, GatewaySerialNumber and GatewayProductClass like this: + +dhcp-option=cpewan-id,vi-encap:3561,4,"<GatewayManufacturerOUI>" +dhcp-option=cpewan-id,vi-encap:3561,5,"<SerialNumber>" +dhcp-option=cpewan-id,vi-encap:3561,6,"<ProductClass>" + +Second, the received sub-options 1, 2, and 3 are passed to the DHCP +lease-change script as the environment variables DNSMASQ_CPEWAN_OUI, +DNSMASQ_CPEWAN_SERIAL, and DNSMASQ_CPEWAN_CLASS respectively. This allows +the script to be used to maintain a ManageableDevice table as +specified in F.2.1. Note that this data is not retained in dnsmasq's +internal DHCP lease database, so it is not available on every call to +the script (this is the same as some other data such as vendor and +user classes). It will however be available for at least the "add" +call, and should be stored then against the IP address as primary +key for future use. + + +This feature was added to dnsmasq under sponsorship from Ericsson. + + diff --git a/contrib/MacOSX-launchd/launchd-README.txt b/contrib/MacOSX-launchd/launchd-README.txt new file mode 100644 index 0000000..4783221 --- /dev/null +++ b/contrib/MacOSX-launchd/launchd-README.txt @@ -0,0 +1,38 @@ +This is a launchd item for Mac OS X and Mac OS X Server. +For more information about launchd, the +"System wide and per-user daemon/agent manager", see the launchd +man page, or the wikipedia page: http://en.wikipedia.org/wiki/Launchd + +This launchd item uses the following flags: +--keep-in-foreground - this is crucial for use with launchd +--log-queries - this is optional and you can remove it +--log-facility=/var/log/dnsmasq.log - again optional instead of system.log + +To use this launchd item for dnsmasq: + +If you don't already have a folder /Library/LaunchDaemons, then create one: +sudo mkdir /Library/LaunchDaemons +sudo chown root:admin /Library/LaunchDaemons +sudo chmod 775 /Library/LaunchDaemons + +Copy uk.org.thekelleys.dnsmasq.plist there and then set ownership/permissions: +sudo cp uk.org.thekelleys.dnsmasq.plist /Library/LaunchDaemons/ +sudo chown root:admin /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist +sudo chmod 644 /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist + +Optionally, edit your dnsmasq configuration file to your liking. + +To start the launchd job, which starts dnsmaq, reboot or use the command: +sudo launchctl load /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist + +To stop the launchd job, which stops dnsmasq, use the command: +sudo launchctl unload /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist + +If you want to permanently stop the launchd job, so it doesn't start the job even after a reboot, use the following command: +sudo launchctl unload -w /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist + +If you make a change to the configuration file, you should relaunch dnsmasq; +to do this unload and then load again: + +sudo launchctl unload /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist +sudo launchctl load /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist diff --git a/contrib/MacOSX-launchd/uk.org.thekelleys.dnsmasq.plist b/contrib/MacOSX-launchd/uk.org.thekelleys.dnsmasq.plist new file mode 100644 index 0000000..fa99176 --- /dev/null +++ b/contrib/MacOSX-launchd/uk.org.thekelleys.dnsmasq.plist @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>uk.org.thekelleys.dnsmasq</string> + <key>ProgramArguments</key> + <array> + <string>/usr/local/sbin/dnsmasq</string> + <string>--keep-in-foreground</string> + <string>--log-queries</string> + <string>--log-facility=/var/log/dnsmasq.log</string> + </array> + <key>RunAtLoad</key> + <true/> +</dict> +</plist> diff --git a/contrib/Solaris10/README.create_package b/contrib/Solaris10/README.create_package new file mode 100644 index 0000000..676899a --- /dev/null +++ b/contrib/Solaris10/README.create_package @@ -0,0 +1,25 @@ +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. diff --git a/contrib/Solaris10/create_package b/contrib/Solaris10/create_package new file mode 100644 index 0000000..fd3fc84 --- /dev/null +++ b/contrib/Solaris10/create_package @@ -0,0 +1,87 @@ +#!/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/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 <package_version_number>" >&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 <<EOF >${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 diff --git a/contrib/dnsmasq_MacOSX/DNSmasq b/contrib/dnsmasq_MacOSX-pre10.4/DNSmasq index 6b62118..6b62118 100755 --- a/contrib/dnsmasq_MacOSX/DNSmasq +++ b/contrib/dnsmasq_MacOSX-pre10.4/DNSmasq diff --git a/contrib/dnsmasq_MacOSX/README.rtf b/contrib/dnsmasq_MacOSX-pre10.4/README.rtf index da48411..da48411 100644 --- a/contrib/dnsmasq_MacOSX/README.rtf +++ b/contrib/dnsmasq_MacOSX-pre10.4/README.rtf diff --git a/contrib/dnsmasq_MacOSX/StartupParameters.plist b/contrib/dnsmasq_MacOSX-pre10.4/StartupParameters.plist index 454bda0..454bda0 100644 --- a/contrib/dnsmasq_MacOSX/StartupParameters.plist +++ b/contrib/dnsmasq_MacOSX-pre10.4/StartupParameters.plist |