 |
Hub-Link Support Forums....
|
| View previous topic :: View next topic |
| Author |
Message |
jabarlee Active Member

Joined: 28 Sep 2003 Posts: 142 Location: Greece
|
Posted: Thu Dec 09, 2004 7:12 pm Post subject: correct user ip |
|
|
Correct me if I'm wrong:
In the early versions there was an option to warn a user, in case his ip was different from the one he put in the settings of DC++
could we see that again?
(I itend to modify it a bit so as to kick these users) _________________ caught in a w3b... |
|
| Back to top |
|
 |
TasMan Developer
Joined: 27 Sep 2003 Posts: 81 Location: Canada
|
Posted: Thu Dec 09, 2004 7:40 pm Post subject: |
|
|
| If you're using SDCH, Hub-Link would have to use PreDataArrival for this to work. The reason being is that SDCH will fix your IP if it's wrong in a search request / connection request (unless you connect via localhost - then it leaves you alone and assumes the IP in the search/etc is correct). |
|
| Back to top |
|
 |
HaArD Site Admin

Joined: 27 Sep 2003 Posts: 533
|
Posted: Fri Dec 10, 2004 2:11 pm Post subject: |
|
|
| Exactly... nothing has changed in the NMDC script if you want to see how that worked jabarlee. |
|
| Back to top |
|
 |
jabarlee Active Member

Joined: 28 Sep 2003 Posts: 142 Location: Greece
|
Posted: Fri Dec 10, 2004 4:27 pm Post subject: |
|
|
thnx guys.
I'll see about a script by RollTheDice, I don't want to mess with Hublink, it;s working flawless.
I'll see the NMDC script though, it may help me to understand how the thing works _________________ caught in a w3b... |
|
| Back to top |
|
 |
jabarlee Active Member

Joined: 28 Sep 2003 Posts: 142 Location: Greece
|
Posted: Wed Jan 12, 2005 6:47 am Post subject: |
|
|
I return to this, I just don't want to open a new topic in SDCH forum, since I know you (HaArD & TasMan) know the answer
My hub runs both on local network, and inet. When a user connects to the Hub using its local ip (10.0.0.1), but having in his settings an inet ip, does SDCH "fixes" that? This correction applies only to search and "connect to hub" requests or to download requests, too?
All my users use the "local" ip to connect to the Hub (inet connection is for administration only". But they report that, if 2 users have an inet ip in their settings, the download will take place using the inet route, and not the local one. I guess that SDCH does not mess with transfer requests between users, so in that case the script I want does have a use...
*** If you think that this has gone way off topic plz delete and I'll post in the SDCH forums _________________ caught in a w3b... |
|
| Back to top |
|
 |
TasMan Developer
Joined: 27 Sep 2003 Posts: 81 Location: Canada
|
Posted: Wed Jan 12, 2005 4:26 pm Post subject: |
|
|
| If the user connects via localhost/etc (ie inside the network), SDCH will not tamper with IPs in search requests and connection requests. The reason for this is so that the user can specify their "real" IP in the DC++ settings and be able to connect to other users (if it replaced the IP in the connection / search request with the IP the hub *thinks* they have, they would probably only be able to do local transfers/etc). |
|
| Back to top |
|
 |
HaArD Site Admin

Joined: 27 Sep 2003 Posts: 533
|
Posted: Thu Jan 13, 2005 6:47 am Post subject: |
|
|
Hub-Link doesn't do anything with the IP's... for SDCH the script doesn't do anything either since TasMan built all the special handling that it is required right into the hubsoft.
| Code: | 'Find out if the IP is a local range (skip IP match check if it is)
Select Case CByte(LeftB$(strKey, InStrB(1, strKey, ".") - 1))
Case 192, 127, 10
Case Else
strParts = LeftB$(strParts, InStrB(1, strParts, ":") - 1)
'If IP doesn't match, then fix it
If Not strKey = strParts Then _
strCommand = Replace(strCommand, strParts, strKey, 1, 1)
End Select |
For NMDC the script has the option of fixing the IP, or not, and informing the user, or not. The NMDC script also tests to see if it is a Private IP (not as thorougly as SDCH, I'll update that right now) and leaves those unchanged.
| Code: | Elseif Not CTMMsgIP = CTMIP Then
'Make sure it's not a local hubowner.
If Not CTMIP = "127.0.0.1" And Not Left(CTMIP, 7) = "192.168" Then
CTMMsg = Replace(CTMMsg, CTMMsgIP, curUser.IP)
If bIPFixPM Then curUser.SendData "$To: " & curUser.sName & " From: " & sBotName & " $<" & sBotName & "> " & _
"You have the wrong IP address in your connection settings. To stop this message please update it to read " & CTMIP
End If
End If |
| Quote: | Private Address Space
The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private networks:
Class A: 10.0.0.0 - 10.255.255.255
(Subnet mask: 255.0.0.0)
Class B: 172.16.0.0 - 172.31.255.255
(Subnet mask: 255.255.0.0)
Class C: 192.168.0.0 - 192.168.255.255
(Subnet mask: 255.255.255.0)
Note that the first block is nothing but a single class A network number, while the second block is a set of 16 contiguous class B network numbers, and third block is a set of 255 contiguous class C network numbers. The complete RFC-1918 can be found via FTP on nic.ddn.mil. |
New NMDC Code in next release will be:
| Code: | Elseif Not CTMMsgIP = CTMIP Then
'Make sure it's not a local hubowner.
If Not CTMIP = "127.0.0.1" And Not Left(CTMIP, 7) = "10" And Not Left(CTMIP, 7) = "192.168" and Not (Left(CTMIP, 7) > "172.15" and Left(CTMIP, 7) < "172.32") Then
CTMMsg = Replace(CTMMsg, CTMMsgIP, curUser.IP)
If bIPFixPM Then curUser.SendData "$To: " & curUser.sName & " From: " & sBotName & " $<" & sBotName & "> " & _
"You have the wrong IP address in your connection settings. To stop this message please update it to read " & CTMIP
End If
End If |
|
|
| Back to top |
|
 |
jabarlee Active Member

Joined: 28 Sep 2003 Posts: 142 Location: Greece
|
Posted: Mon Jan 17, 2005 10:48 am Post subject: |
|
|
thnx again for the reply. I had not fully understand what TasMan ment with "localhost/etc"
So I guess that I have two options:
1. To have a script that does the thing I want or
2. Recompile the SDCH.exe, just ommiting the 10.x.x.x addresses, by removing the according check:
| Code: | 'Find out if the IP is a local range (skip IP match check if it is)
Select Case CByte(LeftB$(strKey, InStrB(1, strKey, ".") - 1))
Case 192, 127
Case Else
strParts = LeftB$(strParts, InStrB(1, strParts, ":") - 1)
'If IP doesn't match, then fix it
If Not strKey = strParts Then _
strCommand = Replace(strCommand, strParts, strKey, 1, 1)
End Select |
I'm on it (not me personally) _________________ caught in a w3b... |
|
| Back to top |
|
 |
|
|
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
|