GetIPStatistics

Alles over het toepassen van API en DLL's in Liberty BASIC

Moderator: anthonio

GetIPStatistics

Berichtdoor anthonio » do maart 19, 2009 10:25 pm

Code: Selecteer alles
Struct TCPSTATS,_
    dwForwarding As long,_ ' IP forwarding enabled or disabled
    dwDefaultTTL As Long,_ ' default time-to-live
    dwInReceives As Long,_ ' datagrams received
    dwInHdrErrors As Long,_  ' received header errors
    dwInAddrErrors As Long,_ ' received address errors
    dwForwDatagrams As Long,_ ' datagrams forwarded
    dwInUnknownProtos As Long,_  ' datagrams with unknown protocol
    dwInDiscards As Long,_ ' received datagrams discarded
    dwInDelivers As Long,_ ' received datagrams delivered
    dwOutRequests As Long,_  '
    dwRoutingDiscards As Long,_  '
    dwOutDiscards As Long,_  ' sent datagrams discarded
    dwOutNoRoutes As Long,_  ' datagrams for which no route exists
    dwReasmTimeout As Long,_ ' datagrams for which all frags did not arrive
    dwReasmReqds As Long,_ ' datagrams requiring reassembly
    dwReasmOks As Long,_  ' successful reassemblies
    dwReasmFails As Long,_ ' failed reassemblies
    dwFragOks As Long,_  ' successful fragmentations
    dwFragFails As Long,_ ' failed fragmentations
    dwFragCreates As Long,_  ' datagrams fragmented
    dwNumIf As Long,_ ' number of interfaces on computer
    dwNumAddr As Long,_
    dwNumRoutes As uLong ' number of routes in routing table

open "iphlpapi.dll" for dll as #IPHLPAPI

rtn = GetIP()
print rtn
print TCPSTATS.dwForwarding.struct * 1500
print TCPSTATS.dwDefaultTTL.struct
print TCPSTATS.dwInReceives.struct
print TCPSTATS.dwInHdrErrors.struct
print TCPSTATS.dwInAddrErrors.struct
print TCPSTATS.dwForwDatagrams.struct
print TCPSTATS.dwInUnknownProtos.struct
print TCPSTATS.dwInDiscards.struct
print TCPSTATS.dwInDelivers.struct
print TCPSTATS.dwOutRequests.struct
print TCPSTATS.dwRoutingDiscards.struct
print TCPSTATS.dwOutDiscards.struct
print TCPSTATS.dwOutNoRoutes.struct
print TCPSTATS.dwReasmTimeout.struct
print TCPSTATS.dwReasmReqds.struct
print TCPSTATS.dwReasmOks.struct
print TCPSTATS.dwReasmFails.struct
print TCPSTATS.dwFragOks.struct
print TCPSTATS.dwFragFails.struct
print TCPSTATS.dwFragCreates.struct
print TCPSTATS.dwNumIf.struct
print TCPSTATS.dwNumAddr.struct
print TCPSTATS.dwNumRoutes.struct
close #IPHLPAPI
end
wait

function GetIP()
    calldll #IPHLPAPI, "GetTcpStatistics",_
    TCPSTATS As struct, GetIP as long
End function


Als output krijg ik allemaal nullen ....
Heeft iemand hier ervaring mee, en zo ja, is dit normaal?
wat krijgen jullie als output?
Dual boot: Ubuntu 8.04 - WIndows XP SP2 (via VMware) - Windows Vista 32bit - Toshiba L40 - Dual Core @ 1,76GHz - 1GB RAM - 120GB HDD - VDSL Connection
Avatar gebruiker
anthonio
 
Berichten: 281
Geregistreerd: zo mei 20, 2007 9:58 pm

Re: GetIPStatistics

Berichtdoor Gordon » vr maart 20, 2009 12:27 am

Hmmmm.....
Ik zie verschillende getallen waaronder vele nullen.
Mijn reeks begint met:
0
6000
300
120000
-1
33
9
0
22
1
1990
1863


Gordon
Avatar gebruiker
Gordon
Site Admin
 
Berichten: 684
Geregistreerd: zo mei 22, 2005 12:50 am

Re: GetIPStatistics

Berichtdoor anthonio » vr maart 20, 2009 12:50 am

merci voor je verslag gordon,
dat wil zeggen dat het programma dus werkt.
Al die gegevens zijn uitgedrukt in bytes.
Heeft allemaal met je internet te maken.
Welk OS gebruik je.
Ik momenteel vista, mss dat het daar aan ligt.
straks eens proberen op xp.

groeten.
Dual boot: Ubuntu 8.04 - WIndows XP SP2 (via VMware) - Windows Vista 32bit - Toshiba L40 - Dual Core @ 1,76GHz - 1GB RAM - 120GB HDD - VDSL Connection
Avatar gebruiker
anthonio
 
Berichten: 281
Geregistreerd: zo mei 20, 2007 9:58 pm

Re: GetIPStatistics

Berichtdoor anthonio » vr maart 20, 2009 7:14 pm

Heb de code eens gerunt op men XP en ik krijg nu ook getallen.

Code: Selecteer alles
4 IP forwarding enabled or disabled
300 default time-to-live
120000 datagrams received
-1 received header errors
252 received address errors
0 datagrams forwarded
0 datagrams with unknown protocol
29 received datagrams discarded
0 received datagrams delivered
22207
13012
1 sent datagrams discarded
0 datagrams for which no route exists
20 datagrams for which all frags did not arrive
15 datagrams requiring reassembly
0 successful reassemblies
0 failed reassemblies
0 successful fragmentations
0 failed fragmentations
0 datagrams fragmented
0 number of interfaces on computer
0
0 number of routes in routing table


Deze getallen geven statistieken van je IP weer.
Wat ze allemaal betekenen, daar ben ik ook niet helemaal uit.

Anthonio
Dual boot: Ubuntu 8.04 - WIndows XP SP2 (via VMware) - Windows Vista 32bit - Toshiba L40 - Dual Core @ 1,76GHz - 1GB RAM - 120GB HDD - VDSL Connection
Avatar gebruiker
anthonio
 
Berichten: 281
Geregistreerd: zo mei 20, 2007 9:58 pm

Re: GetIPStatistics

Berichtdoor ridick1 » zo feb 12, 2012 11:18 am

Iets schrijven en niet weten waar het voor dient o.O
Dat lukt mij niet ;-)
ridick1
 
Berichten: 31
Geregistreerd: zo jan 15, 2012 12:48 pm


Keer terug naar API/DLL

Wie is er online

Gebruikers op dit forum: Geen geregistreerde gebruikers. en 1 gast

cron