[ Not work the development mailing list ]
Hi Viktor,
PRG .-
aAdapters := win_GetAdaptersInfo()
aAdapters == { {cTipo, cNameDes, cMAC, cAddress, cMask, cGateway, cAdapter,
nStatus} }
Sort by nStatus.
C .-
DWORD hbwin_GetAdaptersInfo( PHB_ITEM pItmArray )
File .-
contrin/hbwin/win_getadt.c
It need .-
#include <Iphlpapi.h>
Also I've an added nStatus to try sort it by relevance.
I don't know whether to bring it or not? .-
...
pMacro = hb_macroCompile( "{|x,y|x[8]>y[8]}" );
if( pMacro ){
hb_macroRun( pMacro ); hb_macroDelete( pMacro );
pCodeBlock = hb_stackItemFromTop( -1 );
if( pCodeBlock && HB_IS_BLOCK( pCodeBlock ) ){
hb_arraySort( pItmArray, NULL, NULL, pCodeBlock );
}
hb_stackPop();
}
...
Best regards,
Xavi
El 19/02/2010 16:02, Viktor Szakáts escribió:
Hi Xavi, Przemek,
To have similar features for all platform, either we
should support MAC address on non-win platforms, or
(if this is not possible or not portable) we should
move win-only MAC support to some additional hbwin
function.
Brgds,
Viktor
On 2010 Feb 19, at 15:56, Xavi wrote:
[ Seem that not work the development mailing list ]
Przemek,
I can commit basic implementation for all systems except MS-Windows
(it would be nice if you can test it in OS2 GCC and OW builds) and
maybe later someone will create windows implementation.
No problem, I've done MS-Windows only implementation that also includes MACs
address.
aAdapters == { {cType, cNameDes, cMAC, cAddress, cMask, cGateway, cAdapter} }
So if you provides functions names, file names, in short where putting it, I
think that don't it cost me a lot of work. :)
Best regards,
Xavi
El 19/02/2010 11:36, Przemysław Czerpak escribió:
On Fri, 19 Feb 2010, Przemysław Czerpak wrote:
Hi,
and, there's no way to list interface addresses in a portable way, is there?
Right now I'm using a hb_InetGetHosts( NetName() ), but I'm not sure it's the
best way to go.
This may return only IP address to one interface.
I created code for POSIX systems which scans all
interfaces and return array with AF_INET interfaces
where each entry contains:
{<ifname>,<ifaddr>,<bcastaddr>,<netmask> }
I'll check if it can work with MS-Windows and other
systems and if yes then I'll port it to harbour.
Looking at header files seems that I can port it to OS2 (WATCOM) and
DOS-WATTCP but it will not work in MS-Windows builds so it will be
necessary to create independent implementation giving similar
functionality for this system only.
I can commit basic implementation for all systems except MS-Windows
(it would be nice if you can test it in OS2 GCC and OW builds) and
maybe later someone will create windows implementation.
best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour