Commit bc182b29 authored by Mike Hibler's avatar Mike Hibler

Enable passing of multicast port range to subbosses.

parent 044c33bd
......@@ -830,6 +830,8 @@ null_init(char *opts)
/*
* Options:
* mcaddr=A.B.C.D MC base address
* mcportbase=N MC base portnum (0 for any ephem)
* mcportnum=N Number of MC ports (0 for all above base)
* bandwidth=NNNNNNNN Max bandwidth of a server
* dynamicbw=(1|0) Use dynamic bandwidth control
* maxlinger=N Server lingers for N seconds after last req
......@@ -861,6 +863,10 @@ null_init(char *opts)
*cp = 0;
if (strcmp(opt, "mcaddr") == 0)
DEFAULT_MCADDR = mystrdup(cp + 1);
else if (strcmp(opt, "mcportbase") == 0)
DEFAULT_MCPORT = mystrdup(cp + 1);
else if (strcmp(opt, "mcportnum") == 0)
DEFAULT_MCNUMPORT = mystrdup(cp + 1);
else if (strcmp(opt, "bandwidth") == 0)
maxrate = (uint32_t)
strtol(cp+1, NULL, 10);
......
......@@ -22,6 +22,13 @@
# Subbosses in the same broadcast domain should use different values to
# avoid confusion; e.g., 239.193.1, 239.194.1, etc.
# Unset to use mfrisbeed default.
# MCBASEPORT: base multicast port number.
# Zero means any ephemeral port.
# Unset to use mfrisbeed default.
# MCNUMPORT: number of ports to allow.
# Range will be MCBASEPORT to MCBASEPORT+MCNUMPORT.
# Zero means any ephemeral port above the base.
# Unset to use mfrisbeed default.
# BANDWIDTH: maximum bandwidth any instance of frisbeed should use (Mb/sec).
# Unset to use mfrisbeed default.
# DYNAMICBW: use *experimental* dynamic bandwidth control. If non-zero,
......@@ -42,6 +49,8 @@
# DEBUG: set to run with debugging enabled.
#
MCBASEADDR=239.192.1
MCBASEPORT=
MCNUMPORT=
BANDWIDTH=100000000
DYNAMICBW=
MAXLINGER=180
......@@ -122,6 +131,12 @@ if [ $? -eq 0 ]; then
MCBASEADDR)
MCBASEADDR=$v
;;
MCBASEPORT)
MCBASEPORT=$v
;;
MCNUMPORT)
MCNUMPORT=$v
;;
BANDWIDTH)
BANDWIDTH=$v
;;
......@@ -172,6 +187,20 @@ opts=""
if [ -n "$MCBASEADDR" ]; then
opts="-O mcaddr=$MCBASEADDR"
fi
if [ -n "$MCBASEPORT" ]; then
if [ -z "$opts" ]; then
opts="-O mcportbase=$MCBASEPORT"
else
opts="$opts,mcportbase=$MCBASEPORT"
fi
fi
if [ -n "$MCNUMPORT" ]; then
if [ -z "$opts" ]; then
opts="-O mcportnum=$MCNUMPORT"
else
opts="$opts,mcportnum=$MCNUMPORT"
fi
fi
if [ -n "$BANDWIDTH" ]; then
if [ -z "$opts" ]; then
opts="-O bandwidth=$BANDWIDTH"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment