Hi All,
I had found some stuff about UPnP and NAT.
Source code is available at:
My first aproach is this:
But doesn't work.
Any ideas ?
Thanks in advance,
David Marcovich
I had found some stuff about UPnP and NAT.
Source code is available at:
My first aproach is this:
Code:
#compile exe type UpnpController control_url as string * 15 service_type as string * 512 end type Declare Function LNat_Upnp_Discover cdecl Lib "libnat.dll" Alias "LNat_Upnp_Discover" ( upnp as UpnpController ) as long Declare Function LNat_Upnp_Get_Public_Ip cdecl Lib "libnat.dll" Alias "LNat_Upnp_Get_Public_Ip" ( upnp as UpnpController, IP as asciiz, ip_len as long ) as long Declare Function LNat_Upnp_Controller_Free cdecl Lib "libnat.dll" Alias "LNat_Upnp_Controller_Free" ( upnp as UpnpController ) as long function pbmain() local ip as asciiz * 15, result as long, ip_len as long local upnp as UpnpController ip = "255.255.255.255" ip_len = Sizeof(ip) result = LNat_Upnp_Discover(upnp) if result <> 0 then msgbox "Failed at Router comunication" : exit function result = LNat_Upnp_Get_Public_Ip (upnp, ip, ip_len) if result <> 0 then msgbox "Router is not UPnP compatible" : exit function result = LNat_Upnp_Controller_Free(upnp) MsgBox ip end function
Any ideas ?
Thanks in advance,
David Marcovich
Comment