View previous topic :: View next topic |
Author |
Message |
jonsmirl
Joined: 26 Mar 2013 Posts: 5 Location: United States
|
Posted: Tue Mar 26, 2013 1:02 am Post subject: Advertise vs Search |
|
|
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 |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1587
|
Posted: Fri Mar 29, 2013 1:58 pm Post subject: |
|
|
miniUPnPd does advertise !
please check SendSSDPNotifies() function in minissdp.c _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
 |
jonsmirl
Joined: 26 Mar 2013 Posts: 5 Location: United States
|
Posted: Fri Mar 29, 2013 2:05 pm Post subject: |
|
|
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 |
|
 |
jonsmirl
Joined: 26 Mar 2013 Posts: 5 Location: United States
|
Posted: Fri Mar 29, 2013 2:11 pm Post subject: |
|
|
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 |
|
 |
jonsmirl
Joined: 26 Mar 2013 Posts: 5 Location: United States
|
Posted: Fri Mar 29, 2013 2:15 pm Post subject: |
|
|
My Linksys and Actiontec routers send out adverts like I described. |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1587
|
Posted: Fri Mar 29, 2013 3:05 pm Post subject: |
|
|
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.
https://miniupnp.tuxfamily.org/
Last edited by miniupnp on Fri Mar 29, 2013 3:13 pm; edited 1 time in total |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1587
|
Posted: Fri Mar 29, 2013 3:09 pm Post subject: |
|
|
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.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
 |
jonsmirl
Joined: 26 Mar 2013 Posts: 5 Location: United States
|
Posted: Fri Mar 29, 2013 3:52 pm Post subject: |
|
|
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 |
|
 |
|