Getting extern IP automatic
Moderator: Moderators
Getting extern IP automatic
Hi, I am not so in to this c++ and such stuff, so I cant get this done without any help.
I would like to compile a DC++ client that gets the extern IP automatic, instead of doing this manually. Is this is a simple thing to do? Dunno, for me it looks like a 4-5 lines of code or something like that.
I would appriciate any help, if anyone could help me.
I would like to compile a DC++ client that gets the extern IP automatic, instead of doing this manually. Is this is a simple thing to do? Dunno, for me it looks like a 4-5 lines of code or something like that.
I would appriciate any help, if anyone could help me.
-
- Forum Moderator
- Posts: 1420
- Joined: 2003-04-22 14:37
Re: Getting extern IP automatic
What gives you that impression?jippekaka wrote:Dunno, for me it looks like a 4-5 lines of code or something like that.
Re: Getting extern IP automatic
Prove me wrong then...TheParanoidOne wrote:What gives you that impression?jippekaka wrote:Dunno, for me it looks like a 4-5 lines of code or something like that.
-
- Forum Moderator
- Posts: 1420
- Joined: 2003-04-22 14:37
Re: Getting extern IP automatic
Huh? What are you talking about? I don't know how many lines of code it would be. I'm just wondering what makes you think it would be 4-5 lines.jippekaka wrote:Prove me wrong then...TheParanoidOne wrote:What gives you that impression?jippekaka wrote:Dunno, for me it looks like a 4-5 lines of code or something like that.
-
- Posts: 184
- Joined: 2003-05-26 11:29
- Location: UK
Re: Getting extern IP automatic
233 lines would just about do it.jippekaka wrote:Prove me wrong then...TheParanoidOne wrote:What gives you that impression?jippekaka wrote:Dunno, for me it looks like a 4-5 lines of code or something like that.
edit: oops, my mistake, its 243.
Always remember you're unique, just like everyone else.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
Re: Getting extern IP automatic
It is zero lines of code. Use a dynamic hostname.jippekaka wrote:Dunno, for me it looks like a 4-5 lines of code or something like that.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
Re: Getting extern IP automatic
Still applies. =)GargoyleMT wrote:It is zero lines of code. Use a dynamic hostname.
I have a patch for this, but it's fugly - it's from 0.306.
a simple grep revealed to me that this is not the case,Twink wrote:i thought dc++ already did this as long as the hubs supported userip2??
BCDC++ has it though (in NmdcHub.cpp)
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
-
- Posts: 21
- Joined: 2004-08-08 09:12
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
-
- Posts: 21
- Joined: 2004-08-08 09:12
-
- Posts: 21
- Joined: 2004-08-08 09:12
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
-
- Posts: 21
- Joined: 2004-08-08 09:12
-
- Posts: 21
- Joined: 2004-08-08 09:12
OK, got the detection working via the UPnP interface,
If DC++ has the UPnP option enabled, and it can find a sensible looking interface address, it will populate the IP address itself and set the connection to Active, otherwise it will leave it alone.
On my system, it's working a treat.... I still need to decide if I want to disable the IP textbox and connection type settings, if I have automagically set them (thoughts anyone??)
Have updated my UPnP test binary with the latest code to include this.. Have also updated the PDF docs.
If DC++ has the UPnP option enabled, and it can find a sensible looking interface address, it will populate the IP address itself and set the connection to Active, otherwise it will leave it alone.
On my system, it's working a treat.... I still need to decide if I want to disable the IP textbox and connection type settings, if I have automagically set them (thoughts anyone??)
Have updated my UPnP test binary with the latest code to include this.. Have also updated the PDF docs.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
This sounds wonderful. (Just look at Help/Support - this is the #1 topic there.)mgillespie wrote:With these changes, it should just work straight out of the box in Active Mode on a UPnP enabled system...
I'll give it a try.mgillespie wrote:Have updated my UPnP test binary with the latest code to include this.. Have also updated the PDF docs.
-
- Posts: 21
- Joined: 2004-08-08 09:12
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
-
- Posts: 21
- Joined: 2004-08-08 09:12
-
- Posts: 21
- Joined: 2004-08-08 09:12
Not sure what you mean? Can you explain...
The external IP address we are referring to, is for NAT routers, where you have to use the NAT router address as your external address, NOT your internal LAN address (which is easy to find using 1 line of code).
If anyone is having problems getting UPnP working, I have a test program that interrogates all your LAN interfaces, and tells you if Windows thinks they are UPnP enabled:
Get it here: http://www.mgillespie.plus.com/UPnPTest.exe
Before DC++ UPnP will work, you need to get atleast 1 interface reporting that it's UPnP capable.
XPSP2 fixes some UPnP issues, so any problems, it's worth getting that.
The external IP address we are referring to, is for NAT routers, where you have to use the NAT router address as your external address, NOT your internal LAN address (which is easy to find using 1 line of code).
If anyone is having problems getting UPnP working, I have a test program that interrogates all your LAN interfaces, and tells you if Windows thinks they are UPnP enabled:
Get it here: http://www.mgillespie.plus.com/UPnPTest.exe
Before DC++ UPnP will work, you need to get atleast 1 interface reporting that it's UPnP capable.
XPSP2 fixes some UPnP issues, so any problems, it's worth getting that.