View previous topic :: View next topic |
Author |
Message |
NickH
Joined: 10 Feb 2018 Posts: 26
|
Posted: Tue Jul 03, 2018 7:55 am Post subject: What is the leases file format? |
|
|
I have a upnp.leases file like:
Code: | UDP:9304:172.17.2.112:9304:0:172.17.2.112:9304 to 9304 (UDP)
UDP:61841:172.17.2.118:61841:0:Teredo
UDP:19132:172.17.2.116:19132:0:Minecraft
UDP:9308:172.17.2.112:9308:0:172.17.2.112:9308 to 9308 (UDP)
UDP:9307:172.17.2.112:9307:0:172.17.2.112:9307 to 9307 (UDP)
UDP:9305:172.17.2.112:9305:0:172.17.2.112:9305 to 9305 (UDP) |
I'd like to write a simple status screen for ClearOS and I am wondering what the various fields are. This seems to be a colon separated text file. I can see the protocol, source IP and port a couple of times, there is a field which is always 0, and after it either one or two fields. It is one field if it contains "Teredo" or "Minecraft" or else it is two with a source IP then some form of text describing the port forwarded. Is there any chance of an explanation, please, as I can't really read code.
As an extra, when v2.1 was released there was a comment about writing the remaining lease time to the leases file. I've tried enabling it in config.h but I don't see anything here. Should I? Or do I have to stop miniupnpd and reset the leases file? Also what is the intention of it? Is the code going to be changed to remove mappings for items as they expire?
TIA, Nick |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
Posted: Fri Jul 13, 2018 3:53 pm Post subject: |
|
|
the format :
Code: | <protocol>:<external port>:<internal address>:<internal port>:<timestamp>:<description> |
if the timestamp is 0, that means the lease has unlimited lifetime. _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
NickH
Joined: 10 Feb 2018 Posts: 26
|
Posted: Fri Jul 13, 2018 4:59 pm Post subject: |
|
|
So all leases are requested with unlimited lifetime? If so, what is the point of the "#define LEASEFILE_USE_REMAINING_TIME" switch when compiling?
Having enabled it, the only difference I see is that the leases file disappears sometimes (when it gets old?). I would not have expected it to disappear of there are leases with unlimited lifetime, or have I misunderstood something? I've never seen a value in the timestamp field. |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
Posted: Fri Jul 13, 2018 6:19 pm Post subject: |
|
|
the point of LEASEFILE_USE_REMAINING_TIME is for machines where there is no RTC.
your lease file only shows 6 lease, and yes, they are all "unlimited lifetime"
There is a lease "clean up" system in miniupnpd
use clean_ruleset_threshold and clean_ruleset_interval in the .conf file if you want to configure it.
Also clients remove their lease, sometime _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
|