determine client subnet mask in terminal server
-
Hi all I have developed an application that runs on the Terminal Server. I want to determine the connecting client's IP address and subnet mask to assign them appropriate rights. I have used the wtsclientinfo.dll to get the client's IP address. But I could n't find a way to get the subnet mak. Can anybody help me?:doh: samitha -- modified at 23:50 Monday 20th February, 2006
-
Hi all I have developed an application that runs on the Terminal Server. I want to determine the connecting client's IP address and subnet mask to assign them appropriate rights. I have used the wtsclientinfo.dll to get the client's IP address. But I could n't find a way to get the subnet mak. Can anybody help me?:doh: samitha -- modified at 23:50 Monday 20th February, 2006
samitha, wtsclientinfo.dll is a wrapper for wtsapi32.dll by Jitendra Kumar, (you should get with him) about that. But regardless, wtsapi32 microsoft documentation for WTS_CLIENT_ADDRESS, which is called by his wrapper has some remarks you may be interested in first: MSDN Remarks: The client network address is reported by the RDP client itself when it connects to the server. This could be different than the address that actually connected to the server. For example, suppose there is a NAT between the client and the server. The client can report its own IP address, but the IP address that actually connects to the server is the NAT address. For VPN connections, the IP address might not be discoverable by the client. If it cannot be discovered, the client can report the only IP address it has, which may be the ISP assigned address. Because the address may not be the actual network address, it should not be used as a form of client authentication. Reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/wts_client_address_str.asp[^] progload
-
samitha, wtsclientinfo.dll is a wrapper for wtsapi32.dll by Jitendra Kumar, (you should get with him) about that. But regardless, wtsapi32 microsoft documentation for WTS_CLIENT_ADDRESS, which is called by his wrapper has some remarks you may be interested in first: MSDN Remarks: The client network address is reported by the RDP client itself when it connects to the server. This could be different than the address that actually connected to the server. For example, suppose there is a NAT between the client and the server. The client can report its own IP address, but the IP address that actually connects to the server is the NAT address. For VPN connections, the IP address might not be discoverable by the client. If it cannot be discovered, the client can report the only IP address it has, which may be the ISP assigned address. Because the address may not be the actual network address, it should not be used as a form of client authentication. Reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/wts_client_address_str.asp[^] progload
Great catch! :-D A fine example of how reading the documentation on what your using can save you from wasting a lot of time. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
samitha, wtsclientinfo.dll is a wrapper for wtsapi32.dll by Jitendra Kumar, (you should get with him) about that. But regardless, wtsapi32 microsoft documentation for WTS_CLIENT_ADDRESS, which is called by his wrapper has some remarks you may be interested in first: MSDN Remarks: The client network address is reported by the RDP client itself when it connects to the server. This could be different than the address that actually connected to the server. For example, suppose there is a NAT between the client and the server. The client can report its own IP address, but the IP address that actually connects to the server is the NAT address. For VPN connections, the IP address might not be discoverable by the client. If it cannot be discovered, the client can report the only IP address it has, which may be the ISP assigned address. Because the address may not be the actual network address, it should not be used as a form of client authentication. Reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/wts_client_address_str.asp[^] progload
NAT won't be a problem. Can anybody suggest me a method to find the client's subnet mask giving its IP Address? samitha