- Update to 2.0
This commit is contained in:
parent
71500be553
commit
194b764b07
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=220555
4 changed files with 28 additions and 25 deletions
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
|
||||
PORTNAME= dhcprelya
|
||||
PORTVERSION= 1.3
|
||||
PORTVERSION= 2.0
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= http://people.yandex-team.ru/~sem/
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
MD5 (dhcprelya-1.3.tar.gz) = e6f0d9ced49041f51e1e4226049cdc40
|
||||
SHA256 (dhcprelya-1.3.tar.gz) = 527c1385eb50141351c186afe9d186dd18665361dcfded98c473578343e00faa
|
||||
SIZE (dhcprelya-1.3.tar.gz) = 9275
|
||||
MD5 (dhcprelya-2.0.tar.gz) = bee5ecc651f24deec1a46db7ee065ee1
|
||||
SHA256 (dhcprelya-2.0.tar.gz) = ed8a4f0ebfad3e3165614e16e105fd5bb54849497b25e61a15c9425ec2d3c950
|
||||
SIZE (dhcprelya-2.0.tar.gz) = 10307
|
||||
|
|
|
@ -6,28 +6,40 @@
|
|||
# Add the following line to /etc/rc.conf to enable dhcrelay:
|
||||
#
|
||||
# dhcprelya_enable="YES"
|
||||
#
|
||||
# dhcprelya_config="/path/to/config.file"
|
||||
# or
|
||||
# dhcprelya_servers="<your_dhcp_server>..."
|
||||
# dhcprelya_ifaces="<if1>..."
|
||||
#
|
||||
|
||||
# override these variables in /etc/rc.conf
|
||||
dhcprelya_enable=${dhcprelya_enable:-"NO"}
|
||||
dhcprelya_config=${dhcprelya_config:-}
|
||||
dhcprelya_servers=${dhcprelya_servers:-} # dhcprelya server(s)
|
||||
dhcprelya_ifaces=${dhcprelya_ifaces:-} # ethernet interface(s)
|
||||
|
||||
dhcprelya_precmd ()
|
||||
{
|
||||
if [ -z "${dhcprelya_ifaces}" -o -z "${dhcprelya_servers}" ]; then
|
||||
echo "Both dhcprelya_ifaces and dhcprelya_servers must be set in /etc/rc.conf"
|
||||
if [ -z "${dhcprelya_config}" ]; then
|
||||
if [ -z "${dhcprelya_ifaces}" -o -z "${dhcprelya_servers}" ]; then
|
||||
echo "Either dhcprelya_config or both dhcprelya_ifaces and dhcprelya_servers must be set in /etc/rc.conf"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
ifaces=
|
||||
for iface in ${dhcprelya_ifaces}; do
|
||||
ifaces=
|
||||
for iface in ${dhcprelya_ifaces}; do
|
||||
ifaces="${ifaces} -i ${iface}"
|
||||
done
|
||||
done
|
||||
|
||||
rc_flags="${rc_flags} ${ifaces} ${dhcprelya_servers}"
|
||||
rc_flags="${rc_flags} ${ifaces} ${dhcprelya_servers}"
|
||||
else
|
||||
rc_flags="${rc_flags} -f ${dhcprelya_config}"
|
||||
fi
|
||||
}
|
||||
|
||||
dhcprelya_postcmd() {
|
||||
rm -f ${pidfile}
|
||||
}
|
||||
|
||||
. %%RC_SUBR%%
|
||||
|
@ -35,9 +47,10 @@ dhcprelya_precmd ()
|
|||
name=dhcprelya
|
||||
rcvar=$(set_rcvar)
|
||||
pidfile=/var/run/${name}.pid
|
||||
command=/usr/local/sbin/${name}
|
||||
command=%%PREFIX%%/sbin/${name}
|
||||
|
||||
start_precmd=${name}_precmd
|
||||
stop_postcmd=${name}_postcmd
|
||||
|
||||
load_rc_config ${name}
|
||||
run_rc_command "$1"
|
||||
|
|
|
@ -1,21 +1,11 @@
|
|||
dhcprelya is a light DHCP relay agent written for Yandex company for
|
||||
high loaded routers with tens interfaces and thousands hosts behind them.
|
||||
|
||||
It's fast and does not depend on any side library. Some ideas was
|
||||
taken from Edwin's dhcprelay (net/dhcprelay) which has some shortages.
|
||||
It's fast, independed from any side libraries, and it does not turn on
|
||||
a promisc mode for listen interfaces.
|
||||
|
||||
It's distributed under BSD license.
|
||||
|
||||
How to run:
|
||||
|
||||
dhcprelya [-d] [-p<pidfile>] -i<if1>... -i<ifN> <server1>... <serverN>
|
||||
|
||||
-d - do not demonize and output debugging info onto terminal.
|
||||
-p - use not default pid file. You can run more than one copy of
|
||||
dhcprelya.
|
||||
-i - an interfaces list these should be listened.
|
||||
server - a servers list where request will be forward to.
|
||||
|
||||
Any questions, bug reports and feature requests are welcome.
|
||||
Read README file for instructions.
|
||||
|
||||
Sergey Matveychuk <sem@FreeBSD.org>
|
||||
|
|
Loading…
Reference in a new issue