MiniUPnPd Web Installer - Available For Testing

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Author Message
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Sun Dec 20, 2009 5:12    Post subject: Reply with quote
MikeMcr wrote:
I would like to display a list of UPnP forwards using the MyPage feature.

Unfortunately "iptables -L MINIUPNPD" does not show the internal description for each forward which is provided by the client (XBox, Messenger etc)

This is acknowledged by the author here:

http://miniupnp.tuxfamily.org/forum/viewtopic.php?t=299

The solution in the last post is to use "miniupnpdctl".

Looking at the source, this appears to be a binary built along with miniupnpd. Autobot, I don't suppose you have a copy from your compiled build, please?


It wasn't that simple, I had to recompile miniupnpd with #define USE_MINIUPNPDCTL but its done and you can get what you want here. Since you seem to know what your doing could you redownload the new miniupnpd and miniupnpdctl and make sure that everything still functions properly and report back your findings please.

_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
Sponsor
MikeMcr
DD-WRT User


Joined: 28 Aug 2009
Posts: 54

PostPosted: Sun Dec 20, 2009 11:19    Post subject: Reply with quote
autobot wrote:
It wasn't that simple, I had to recompile miniupnpd with #define USE_MINIUPNPDCTL but its done and you can get what you want here. Since you seem to know what your doing could you redownload the new miniupnpd and miniupnpdctl and make sure that everything still functions properly and report back your findings please.


Thanks for doing that. I downloaded the new files and everything seems OK so far. However, the output of miniupnpdctl isn't very friendly so I'm not sure how I'm going to parse it yet.
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Sun Dec 20, 2009 11:20    Post subject: Reply with quote
You mean that 1/2 leading garbage?
_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
MikeMcr
DD-WRT User


Joined: 28 Aug 2009
Posts: 54

PostPosted: Sun Dec 20, 2009 11:30    Post subject: Reply with quote
Yep. I'll try a few examples to see how consistent it is:

Code:

<stuff before>
struct ctlelem: socket=9
 0 œuÿ   UDP 2011->192.168.1.17:2011 'Xbox (192.168.1.17:2011) 2011 UDP' 0 0
Events details
Subscribers :
<stuff after>
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Sun Dec 20, 2009 11:37    Post subject: Reply with quote
MikeMcr wrote:
Yep. I'll try a few examples to see how consistent it is:

Code:

<stuff before>
struct ctlelem: socket=9
 0 œuÿ   UDP 2011->192.168.1.17:2011 'Xbox (192.168.1.17:2011) 2011 UDP' 0 0
Events details
Subscribers :
<stuff after>


I will look at the code later and see why its doing that, I'm going to sleep. You may need to use sed, cut or your preferred method to pretty that up till its fixed, if its a simple fix that is.

_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
MikeMcr
DD-WRT User


Joined: 28 Aug 2009
Posts: 54

PostPosted: Sun Dec 20, 2009 12:30    Post subject: Reply with quote
autobot wrote:
I will look at the code later and see why its doing that, I'm going to sleep. You may need to use sed, cut or your preferred method to pretty that up till its fixed, if its a simple fix that is.


The code seems to be in the function "write_ruleset_details" of "upnpredirect.c". Those control characters are supposed to be the interface name but it doesn't appear to get filled out for iptables.

I'll report that to the author as it seems to be dumping an uninitialised string.
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Sun Dec 20, 2009 20:31    Post subject: Reply with quote
Thanks, I will update it if a patch or new source is released. I'm not sure if this is a MIPS issue so I'm going to compile it for x86 and see if I get the same trash. I wish I would have learned c but I chose pascal/delphi back in the win98 era....it helps but very little. I will check the forum over at the miniupnp site and watch for your thread, unless you mailed him.

To those who read this, it has nothing to do with the proper function of miniupnp it is a minor issue with the output of miniupnpdctl which isn't installed by my script.

_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
MikeMcr
DD-WRT User


Joined: 28 Aug 2009
Posts: 54

PostPosted: Sun Dec 20, 2009 21:14    Post subject: Reply with quote
Thanks, I'm actually a Delphi programmer as well so in the same situation. Linux is new to me so when I said the output was horrible to parse, I meant it!

Anyway, I have attached what I have done so far. The mypage.sh file contains the html with a section showing the raw iptables output and a nicer table showing the parsed output of miniupnpdctl.

It calls miniupnpd_mypage.sh to get the parsed output. I store my files in /jffs so you will need to search both files and replace /jffs as appropriate.

Notice miniupnpd_mypage.sh is quite slow to run. I tried using cut instead of awk but it made no difference. Any pointers on how to speed up the parsing is welcome as this really is my first attempt at code like that.



MyPage.zip
 Description:

Download
 Filename:  MyPage.zip
 Filesize:  1.54 KB
 Downloaded:  997 Time(s)

autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Mon Dec 21, 2009 5:30    Post subject: Reply with quote
Don't forget about tr -d, there are so many ways to format text.
_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Tue Dec 22, 2009 1:09    Post subject: Reply with quote
Ok I recompiled for x86 and miniupnpdctl outputs the proper information with no leading trash so this is something of a mips issue so far. I had put a space in the name I entered into my config.h #define OS_VERSION variable but it turned out not to be that. It has to be something in config.h though, going to keep working at it.
_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Tue Dec 22, 2009 18:22    Post subject: Reply with quote
Update....Well the developer of miniupnp is working at it, he gave me revised source but the output remained the same. I gave him a log of miniupnpdctl and the mips binaries which he is looking at now.
_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
MikeMcr
DD-WRT User


Joined: 28 Aug 2009
Posts: 54

PostPosted: Tue Dec 22, 2009 18:36    Post subject: Reply with quote
Thanks for doing that. Looking at your config file, you have me wondering now; is your miniupnpd version supposed to work on both 2.4 and 2.6 kernel DD-WRT builds?

I am using a WRT610Nv1 so cannot use a 2.6 DD-WRT build. Your makefile links to iptables version 1.4.1 but my DD-WRT build (13401M NEWD-2 Eko) uses iptables 1.3.7. Is that OK? Anything to be concerned about?
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Tue Dec 22, 2009 18:48    Post subject: Reply with quote
I don't have a K26 router either.

To my knowledge the difference in iptables isn't the problem, I told Thomas (miniupnp) what iptables version I am using. If he can't figure it out I will get 1.3.7 and try that, if that doesn't work I'm going to try Tornado's gcc4 toolchain to see if its a gcc3 issue. A lot of bs for such a minor thing, but I want the output of miniupnpdctl also.

_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Tue Dec 22, 2009 21:35    Post subject: Reply with quote
Ok it is fixed now, miniupnpdctl outputs the properly formatted data. That was harder to fix than I initially thought.
_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Tue Dec 22, 2009 22:01    Post subject: Reply with quote
@autobot...

I saw you needed to run a script everytime the firewall runs...
For my asiablock I needed to make some chains which could be referenced in the rc_firewall
I therefore asked eko to give me a "prewall" which I could hook into....

If you create a symbolic link (you need to create the directory if it doesn't exist):

/tmp/etc/config/miniupnp.prewall

which points to your script it will run everytime the firewall restarts and you will be able to do your stuff....

If you have it all working I may incorporate it into my optware script....

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next Display posts from previous:    Page 3 of 8
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
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
You can attach files in this forum
You can download files in this forum