miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

What is the leases file format?

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation
View previous topic :: View next topic  
Author Message
NickH



Joined: 10 Feb 2018
Posts: 18

PostPosted: Tue Jul 03, 2018 7:55 am    Post subject: What is the leases file format? Reply with quote

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
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Fri Jul 13, 2018 3:53 pm    Post subject: Reply with quote

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.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
NickH



Joined: 10 Feb 2018
Posts: 18

PostPosted: Fri Jul 13, 2018 4:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Fri Jul 13, 2018 6:19 pm    Post subject: Reply with quote

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 Smile
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.