mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 15:11:41 +00:00
- Fix GetIpNetTable
- Arp -a will now show a complete list of ARP information svn path=/trunk/; revision=43092
This commit is contained in:
parent
bc07b8444d
commit
c1769578ac
4 changed files with 14 additions and 9 deletions
|
@ -147,4 +147,6 @@ NTSTATUS deleteIpAddress( ULONG NteContext );
|
||||||
/* Inserts a route into the route table. */
|
/* Inserts a route into the route table. */
|
||||||
DWORD createIpForwardEntryOS(PMIB_IPFORWARDROW pRoute);
|
DWORD createIpForwardEntryOS(PMIB_IPFORWARDROW pRoute);
|
||||||
|
|
||||||
|
BOOL isLoopback( HANDLE tcpFile, TDIEntityID *loop_maybe );
|
||||||
|
|
||||||
#endif /* ndef WINE_IFENUM_H_ */
|
#endif /* ndef WINE_IFENUM_H_ */
|
||||||
|
|
|
@ -315,7 +315,7 @@ BOOL isInterface( TDIEntityID *if_maybe ) {
|
||||||
if_maybe->tei_entity == IF_ENTITY;
|
if_maybe->tei_entity == IF_ENTITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL isLoopback( HANDLE tcpFile, TDIEntityID *loop_maybe ) {
|
BOOL isLoopback( HANDLE tcpFile, TDIEntityID *loop_maybe ) {
|
||||||
IFEntrySafelySized entryInfo;
|
IFEntrySafelySized entryInfo;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
|
||||||
|
|
|
@ -539,7 +539,8 @@ DWORD getNumArpEntries(void)
|
||||||
|
|
||||||
for( i = 0; i < numEntities; i++ ) {
|
for( i = 0; i < numEntities; i++ ) {
|
||||||
if( isInterface( &entitySet[i] ) &&
|
if( isInterface( &entitySet[i] ) &&
|
||||||
hasArp( tcpFile, &entitySet[i] ) ) {
|
hasArp( tcpFile, &entitySet[i] ) &&
|
||||||
|
!isLoopback( tcpFile, &entitySet[i] ) ) {
|
||||||
|
|
||||||
status = tdiGetSetOfThings( tcpFile,
|
status = tdiGetSetOfThings( tcpFile,
|
||||||
INFO_CLASS_PROTOCOL,
|
INFO_CLASS_PROTOCOL,
|
||||||
|
@ -571,7 +572,7 @@ PMIB_IPNETTABLE getArpTable(void)
|
||||||
DWORD numEntities, returnSize;
|
DWORD numEntities, returnSize;
|
||||||
TDIEntityID *entitySet;
|
TDIEntityID *entitySet;
|
||||||
HANDLE tcpFile;
|
HANDLE tcpFile;
|
||||||
int i, row = 0, totalNumber;
|
int i, totalNumber, TmpIdx, CurrIdx = 0;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
PMIB_IPNETTABLE IpArpTable = NULL;
|
PMIB_IPNETTABLE IpArpTable = NULL;
|
||||||
PMIB_IPNETROW AdapterArpTable = NULL;
|
PMIB_IPNETROW AdapterArpTable = NULL;
|
||||||
|
@ -598,8 +599,9 @@ PMIB_IPNETTABLE getArpTable(void)
|
||||||
status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
|
status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
|
||||||
|
|
||||||
for( i = 0; i < numEntities; i++ ) {
|
for( i = 0; i < numEntities; i++ ) {
|
||||||
if( isIpEntity( tcpFile, &entitySet[i] ) &&
|
if( isInterface( &entitySet[i] ) &&
|
||||||
hasArp( tcpFile, &entitySet[i] ) ) {
|
hasArp( tcpFile, &entitySet[i] ) &&
|
||||||
|
!isLoopback( tcpFile, &entitySet[i] ) ) {
|
||||||
|
|
||||||
status = tdiGetSetOfThings( tcpFile,
|
status = tdiGetSetOfThings( tcpFile,
|
||||||
INFO_CLASS_PROTOCOL,
|
INFO_CLASS_PROTOCOL,
|
||||||
|
@ -613,8 +615,8 @@ PMIB_IPNETTABLE getArpTable(void)
|
||||||
&returnSize );
|
&returnSize );
|
||||||
|
|
||||||
if( status == STATUS_SUCCESS ) {
|
if( status == STATUS_SUCCESS ) {
|
||||||
for( row = 0; row < returnSize; row++ )
|
for( TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++ )
|
||||||
IpArpTable->table[row] = AdapterArpTable[row];
|
IpArpTable->table[CurrIdx] = AdapterArpTable[TmpIdx];
|
||||||
}
|
}
|
||||||
|
|
||||||
if( AdapterArpTable ) tdiFreeThingSet( AdapterArpTable );
|
if( AdapterArpTable ) tdiFreeThingSet( AdapterArpTable );
|
||||||
|
@ -624,7 +626,7 @@ PMIB_IPNETTABLE getArpTable(void)
|
||||||
closeTcpFile( tcpFile );
|
closeTcpFile( tcpFile );
|
||||||
|
|
||||||
tdiFreeThingSet( entitySet );
|
tdiFreeThingSet( entitySet );
|
||||||
IpArpTable->dwNumEntries = row;
|
IpArpTable->dwNumEntries = CurrIdx;
|
||||||
|
|
||||||
return IpArpTable;
|
return IpArpTable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -490,7 +490,8 @@ ULONG NBCopyNeighbors
|
||||||
for( CurNCE = NeighborCache[i].Cache;
|
for( CurNCE = NeighborCache[i].Cache;
|
||||||
CurNCE;
|
CurNCE;
|
||||||
CurNCE = CurNCE->Next ) {
|
CurNCE = CurNCE->Next ) {
|
||||||
if( CurNCE->Interface == Interface ) {
|
if( CurNCE->Interface == Interface &&
|
||||||
|
!AddrIsEqual( &CurNCE->Address, &CurNCE->Interface->Unicast ) ) {
|
||||||
if( ArpTable ) {
|
if( ArpTable ) {
|
||||||
ArpTable[Size].Index = Interface->Index;
|
ArpTable[Size].Index = Interface->Index;
|
||||||
ArpTable[Size].AddrSize = CurNCE->LinkAddressLength;
|
ArpTable[Size].AddrSize = CurNCE->LinkAddressLength;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue