fixes#698
As advised in UDA:
Due to the unreliable nature of UDP, devices SHOULD send the entire set
of discovery messages more than once with some delay between sets e.g. a
few hundred milliseconds. To avoid network congestion discovery messages
SHOULD NOT be sent more than three times. In addition, the device MUST
re-send its advertisements periodically prior to expiration of the duration
specified in the CACHE-CONTROL header field; it is RECOMMENDED that such
refreshing of advertisements be done at a randomly-distributed interval
of less than one-half of the advertisement expiration time.
(CACHE-CONTROL value is minimum 1800 seconds, so the interval should be
less than 900s
fixes#697http://upnp.org/specs/gw/UPnP-gw-WANIPConnection-v2-Service.pdf
p9:
1.2 Changes since WANIPConnection:1
Upon startup, UPnP IGD DCP MUST broadcast an ssdp:byebye before sending the initial
ssdp:alive onto the local network. Sending an ssdp:byebye as part of the normal start up process
for a UPnP device ensures that UPnP control points with information about the previous device
instance will safely discard state information about the previous device instance before
communicating with the new device instance.
NFtables uses the INET table for NAT which combines IPv4 and IPv6.
Older systems might not have this option and use the ip table instead.
This adds a flag to fall back to the ip table style.
Signed-Off-By: Sven Auhagen <sven.auhagen@voleatech.de>
to be compliant with UPnP UDA 1.0, 1.1 and 2.0
fixes#698
UDA 1.0 1.2.3 Discovery: Search: Response (p21) :
CACHE-CONTROL
Required. Must have max-age directive that specifies number of seconds
the advertisement is valid. After this duration, control points should
assume the device (or service) is no longer available. Should be greater
than or equal to 1800 seconds (30 minutes), although exceptions are defined
in the text above. Specified by UPnP vendor. Integer.
UDA 1.1 1.3.3 Search response (p34) :
CACHE-CONTROL
REQUIRED. Field value MUST have the max-age directive (“max-age=”) followed
by an integer that specifies the number of seconds the advertisement
is valid. After this duration, control points SHOULD assume the device
(or service) is no longer available; as long as a control point has
received at least one advertisement that is still valid from a root
device, any of its embedded devices or any of its services, then the
control point can assume that all are available. The number of seconds
SHOULD be greater than or equal to 1800 seconds (30 minutes), although
exceptions are defined in the text above. Specified by UPnP vendor.
Other directives MUST NOT be sent and MUST be ignored when received.
UDA 2.0 1.3.3 Search response (p40) :
CACHE-CONTROL
Required. Field value shall have the max-age directive (“max-age=”) followed
by an integer that specifies the number of seconds the advertisement
is valid. After this duration, control points should assume the device
(or service) is no longer available; as long as a control point has
received at least one advertisement that is still valid from a root
device, any of its embedded devices or any of its services, then the
control point can assume that all are available. The number of seconds
should be greater than or equal to 1800 seconds (30 minutes), although
exceptions are defined in the text above. Specified by UPnP vendor.
Other directives shall not be sent and shall be ignored when received.