Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / NetworkInformation / SystemIPGlobalStatistics.cs / 1 / SystemIPGlobalStatistics.cs
////// namespace System.Net.NetworkInformation { using System.Net.Sockets; using System; using System.ComponentModel; /// /// Provides support for ip configuation information and statistics. /// /// IP statistics internal class SystemIPGlobalStatistics:IPGlobalStatistics { MibIpStats stats = new MibIpStats(); private SystemIPGlobalStatistics(){ } internal SystemIPGlobalStatistics(AddressFamily family){ uint result; if (!ComNetOS.IsPostWin2K){ if (family!= AddressFamily.InterNetwork){ throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired)); } result = UnsafeNetInfoNativeMethods.GetIpStatistics(out stats); } else result = UnsafeNetInfoNativeMethods.GetIpStatisticsEx(out stats, family); if (result != IpHelperErrors.Success) { throw new NetworkInformationException((int)result); } } ///public override bool ForwardingEnabled{get {return stats.forwardingEnabled;}} /// public override int DefaultTtl{get {return (int) stats.defaultTtl;}} /// public override long ReceivedPackets{get {return stats.packetsReceived;}} /// public override long ReceivedPacketsWithHeadersErrors{get {return stats.receivedPacketsWithHeaderErrors;}} /// public override long ReceivedPacketsWithAddressErrors{get {return stats.receivedPacketsWithAddressErrors;}} /// public override long ReceivedPacketsForwarded{get {return stats.packetsForwarded;}} /// public override long ReceivedPacketsWithUnknownProtocol{get {return stats.receivedPacketsWithUnknownProtocols;}} /// public override long ReceivedPacketsDiscarded{get {return stats.receivedPacketsDiscarded;}} /// public override long ReceivedPacketsDelivered{get {return stats.receivedPacketsDelivered;}} /// public override long OutputPacketRequests{get {return stats.packetOutputRequests;}} /// public override long OutputPacketRoutingDiscards{get {return stats.outputPacketRoutingDiscards;}} /// public override long OutputPacketsDiscarded{get {return stats.outputPacketsDiscarded;}} /// public override long OutputPacketsWithNoRoute{get {return stats.outputPacketsWithNoRoute;}} /// public override long PacketReassemblyTimeout{get {return stats.packetReassemblyTimeout;}} /// public override long PacketReassembliesRequired{get {return stats.packetsReassemblyRequired;}} /// public override long PacketsReassembled{get {return stats.packetsReassembled;}} /// public override long PacketReassemblyFailures{get {return stats.packetsReassemblyFailed;}} /// public override long PacketsFragmented{get {return stats.packetsFragmented;}} /// public override long PacketFragmentFailures{get {return stats.packetsFragmentFailed;}} /// public override int NumberOfInterfaces{get {return (int)stats.interfaces;}} /// public override int NumberOfIPAddresses{get {return (int)stats.ipAddresses;}} /// public override int NumberOfRoutes{get {return (int)stats.routes;}} } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /// /// namespace System.Net.NetworkInformation { using System.Net.Sockets; using System; using System.ComponentModel; /// /// Provides support for ip configuation information and statistics. /// /// IP statistics internal class SystemIPGlobalStatistics:IPGlobalStatistics { MibIpStats stats = new MibIpStats(); private SystemIPGlobalStatistics(){ } internal SystemIPGlobalStatistics(AddressFamily family){ uint result; if (!ComNetOS.IsPostWin2K){ if (family!= AddressFamily.InterNetwork){ throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired)); } result = UnsafeNetInfoNativeMethods.GetIpStatistics(out stats); } else result = UnsafeNetInfoNativeMethods.GetIpStatisticsEx(out stats, family); if (result != IpHelperErrors.Success) { throw new NetworkInformationException((int)result); } } ///public override bool ForwardingEnabled{get {return stats.forwardingEnabled;}} /// public override int DefaultTtl{get {return (int) stats.defaultTtl;}} /// public override long ReceivedPackets{get {return stats.packetsReceived;}} /// public override long ReceivedPacketsWithHeadersErrors{get {return stats.receivedPacketsWithHeaderErrors;}} /// public override long ReceivedPacketsWithAddressErrors{get {return stats.receivedPacketsWithAddressErrors;}} /// public override long ReceivedPacketsForwarded{get {return stats.packetsForwarded;}} /// public override long ReceivedPacketsWithUnknownProtocol{get {return stats.receivedPacketsWithUnknownProtocols;}} /// public override long ReceivedPacketsDiscarded{get {return stats.receivedPacketsDiscarded;}} /// public override long ReceivedPacketsDelivered{get {return stats.receivedPacketsDelivered;}} /// public override long OutputPacketRequests{get {return stats.packetOutputRequests;}} /// public override long OutputPacketRoutingDiscards{get {return stats.outputPacketRoutingDiscards;}} /// public override long OutputPacketsDiscarded{get {return stats.outputPacketsDiscarded;}} /// public override long OutputPacketsWithNoRoute{get {return stats.outputPacketsWithNoRoute;}} /// public override long PacketReassemblyTimeout{get {return stats.packetReassemblyTimeout;}} /// public override long PacketReassembliesRequired{get {return stats.packetsReassemblyRequired;}} /// public override long PacketsReassembled{get {return stats.packetsReassembled;}} /// public override long PacketReassemblyFailures{get {return stats.packetsReassemblyFailed;}} /// public override long PacketsFragmented{get {return stats.packetsFragmented;}} /// public override long PacketFragmentFailures{get {return stats.packetsFragmentFailed;}} /// public override int NumberOfInterfaces{get {return (int)stats.interfaces;}} /// public override int NumberOfIPAddresses{get {return (int)stats.ipAddresses;}} /// public override int NumberOfRoutes{get {return (int)stats.routes;}} } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CardSpaceException.cs
- GrammarBuilderPhrase.cs
- RemotingAttributes.cs
- SqlOuterApplyReducer.cs
- HtmlInputButton.cs
- RegisteredDisposeScript.cs
- CriticalFinalizerObject.cs
- DocumentPageHost.cs
- TdsValueSetter.cs
- MergeFilterQuery.cs
- ContractsBCL.cs
- MenuStrip.cs
- PieceDirectory.cs
- SharedPerformanceCounter.cs
- Int16AnimationUsingKeyFrames.cs
- IconHelper.cs
- PersonalizationProviderCollection.cs
- TrackingLocationCollection.cs
- IsolatedStorageFile.cs
- XmlNamespaceManager.cs
- _FtpControlStream.cs
- ScrollPattern.cs
- SqlWebEventProvider.cs
- DiscriminatorMap.cs
- EditCommandColumn.cs
- AsymmetricCryptoHandle.cs
- WindowVisualStateTracker.cs
- CursorEditor.cs
- ConfigXmlAttribute.cs
- __Filters.cs
- ModelPerspective.cs
- DateTimePicker.cs
- BindingSource.cs
- SchemaMerger.cs
- TemplateBaseAction.cs
- ConstructorNeedsTagAttribute.cs
- ValueOfAction.cs
- Imaging.cs
- SecurityElement.cs
- TypeElement.cs
- ResizeGrip.cs
- ImmutableObjectAttribute.cs
- ProcessInfo.cs
- ProgressBarBrushConverter.cs
- NativeMethods.cs
- TableParagraph.cs
- WinEventWrap.cs
- DefaultCommandExtensionCallback.cs
- IgnorePropertiesAttribute.cs
- _CookieModule.cs
- AddInSegmentDirectoryNotFoundException.cs
- HtmlString.cs
- Content.cs
- RoutingChannelExtension.cs
- CodeMemberProperty.cs
- ScrollViewerAutomationPeer.cs
- Matrix3DValueSerializer.cs
- SemaphoreFullException.cs
- ServiceProviders.cs
- FtpWebResponse.cs
- FtpCachePolicyElement.cs
- PointValueSerializer.cs
- ApplicationSecurityInfo.cs
- EmptyImpersonationContext.cs
- Visitors.cs
- ClientEventManager.cs
- ParallelTimeline.cs
- DEREncoding.cs
- XmlSchemaAnnotated.cs
- PersonalizationProviderCollection.cs
- TaskbarItemInfo.cs
- InkCanvas.cs
- WindowPattern.cs
- Span.cs
- XmlIlTypeHelper.cs
- EmptyEnumerable.cs
- ConditionalAttribute.cs
- ValueType.cs
- ProcessModule.cs
- ReflectPropertyDescriptor.cs
- HybridWebProxyFinder.cs
- ZipPackage.cs
- ToolStripItem.cs
- ClassicBorderDecorator.cs
- TemplateField.cs
- GeneralTransform3DGroup.cs
- MasterPageBuildProvider.cs
- GeometryCombineModeValidation.cs
- EncoderExceptionFallback.cs
- SchemaSetCompiler.cs
- IncrementalHitTester.cs
- PersistStreamTypeWrapper.cs
- WebPartEventArgs.cs
- FusionWrap.cs
- QueryExecutionOption.cs
- MsmqIntegrationChannelListener.cs
- ValidateNames.cs
- ToolboxCategoryItems.cs
- OrderingExpression.cs
- RandomNumberGenerator.cs