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 

Advertise vs Search

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Feature Request
View previous topic :: View next topic  
Author Message
jonsmirl



Joined: 26 Mar 2013
Posts: 5
Location: United States

PostPosted: Tue Mar 26, 2013 1:02 am    Post subject: Advertise vs Search Reply with quote

Why doesn't miniupnpd advertise? I checked out the code and it only responds to SEARCH.

I'm looking for a code base to use as a basis for recreating GUPnP Network Light with a much smaller footprint.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1445

PostPosted: Fri Mar 29, 2013 1:58 pm    Post subject: Reply with quote

miniUPnPd does advertise !
please check SendSSDPNotifies() function in minissdp.c
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jonsmirl



Joined: 26 Mar 2013
Posts: 5
Location: United States

PostPosted: Fri Mar 29, 2013 2:05 pm    Post subject: Reply with quote

It only advertises in response to a search command.

Start GUPnP Control Panel
then start miniupnp.
It won't appear in the Control Panel
miniupnp didn't start sending periodic adverts when started

Now do it the other way.
Start miniupnp
Start Control panel
It will appear because control panel sent a M-SEARCH at startup.
Back to top
View user's profile Send private message
jonsmirl



Joined: 26 Mar 2013
Posts: 5
Location: United States

PostPosted: Fri Mar 29, 2013 2:11 pm    Post subject: Reply with quote

UPnP spec says it should pick an interval like 120 minutes. At startup send out an advert with the 120 min expiration. Then at 50 minutes plus/minus a a few minutes resend the 120 minutes advert.

If it does this it will appear in GUPnP Control panel.
Back to top
View user's profile Send private message
jonsmirl



Joined: 26 Mar 2013
Posts: 5
Location: United States

PostPosted: Fri Mar 29, 2013 2:15 pm    Post subject: Reply with quote

My Linksys and Actiontec routers send out adverts like I described.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1445

PostPosted: Fri Mar 29, 2013 3:05 pm    Post subject: Reply with quote

I repeat : miniupnpd does send periodically NOTIFY SSDP packets.
please use notify_interval in miniupnpd.conf or -t option on command line to configure how often notify are sent.
120min is too long. default is 30 secs. 60 or 120 secs is good too.

Maybe there is problem on your machine that prevents miniupnpd from sending the notifications. Please check the logs.
I see around line 1466 in miniupnpd.c that they wont be sent if gettimeofday() fails...
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/


Last edited by miniupnp on Fri Mar 29, 2013 3:13 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1445

PostPosted: Fri Mar 29, 2013 3:09 pm    Post subject: Reply with quote

jonsmirl wrote:
It only advertises in response to a search command.

Start GUPnP Control Panel
then start miniupnp.
It won't appear in the Control Panel
miniupnp didn't start sending periodic adverts when started

Now do it the other way.
Start miniupnp
Start Control panel
It will appear because control panel sent a M-SEARCH at startup.

Just one question : Are you trying to use miniUPnPd and GUPnP Control Panel on the *SAME* machine ?
I don't see why you would do that, but of course the multicast packets won't be received because miniUPnPd does set IP_MULTICAST_LOOP to 0.
see OpenAndConfSSDPNotifySocket() in minissdp.c.
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jonsmirl



Joined: 26 Mar 2013
Posts: 5
Location: United States

PostPosted: Fri Mar 29, 2013 3:52 pm    Post subject: Reply with quote

I'm on the same machine. I was going through the code and looking at it. I've checked it out by using two machines now and it works as expected. I had missed the bit about disabling the multicast loop.

So for development purposes I can't leave the UPnP browser running. I need to restart it to make the miniupnpd device appear. Maybe I'll add a refresh command to the browser.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Feature Request 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.