Hi Xavi,

I think we should remove Windows-only stuff from 
this function. Harbour core is meant to be portable, 
so anything where there is no provision for support 
on other platforms, should be moved to hbwin
(like GUID).

I also don't understand "type". It's vague, and 
it returns a human readable (English) string, while 
if this is portable and useful information (and only if), 
it should rather return some sort of numeric value.

To put it short, only HWADDR should be used from 
this new code, maybe gateway.

Brgds,
Viktor


On 2010 Feb 21, at 21:44, Xavi wrote:

> Hi all,
> 
> Thank you very much Mindaugas. Yes, I think it's possible to mix both 
> GetAdaptersInfo, WSAIoctl to fill Przemek's array and add more elements to 
> Windows.
> 
> I attached a first draft, Could you test it and comets?
> 
> #include "hbsocket.ch"
> proc main( noAlias )
>    local iface
>    ? os(), version()
>    ? "interfaces:"
>    for each iface in hb_inetIfInfo( !empty( noAlias ), 0 )
>       ? "Family .... :", iface[HB_SOCKET_IFINFO_FAMILY]
>       ? "Name ...... :", iface[HB_SOCKET_IFINFO_NAME]
>       ? "Flags ..... :", iface[HB_SOCKET_IFINFO_FLAGS]
>       ? "Address ... :", iface[HB_SOCKET_IFINFO_ADDR]
>       ? "Mask ...... :", iface[HB_SOCKET_IFINFO_NETMASK]
>       ? "Bradcast .. :", iface[HB_SOCKET_IFINFO_BROADCAST]
>       ? "P2P ........:", iface[HB_SOCKET_IFINFO_P2PADDR]
>       ? "MAC ....... :", iface[HB_SOCKET_IFINFO_HWADDR]
>       ? "Type .......:", iface[HB_SOCKET_IFINFO_TYPE]
>       ? "Gateway ... :", iface[HB_SOCKET_IFINFO_GATEWAY]
>       ? "GUID ...... :", iface[HB_SOCKET_IFINFO_GUID]
>       ? '-------------------------------------------------------'
>    next
>    ?
>    Wait
> return
> 
> Best regards,
> Xavi
> 
> El 21/02/2010 2:25, Mindaugas Kavaliauskas escribió:
>> Hi,
>> 
>> 
>>> + added new C function:
>>> PHB_ITEM hb_socketGetIFaces( int af, HB_BOOL fNoAliases );
>>> it returns array with existing interfaces description.
>>> This code was added for non MS-Windows based platforms only.
>>> Support for MS-Windows has to be added yet.
>> 
>> Xavi has mentioned a popular GetAdaptersInfo() way to get interface
>> list. Windows also support another method that is more similar to your
>> implementation (but less info could be obtained using with method):
>> 
>> http://tangentsoft.net/wskfaq/examples/getifaces.html
>> http://msdn.microsoft.com/en-us/library/ms741621(VS.85).aspx
>> http://msdn.microsoft.com/en-us/library/ms738568(VS.85).aspx
>> 
>> 
>> 
>> Regards,
>> Mindaugas
> <hbsocket.zip>_______________________________________________
> Harbour mailing list (attachment size limit: 40KB)
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to