Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / NetworkInformation / SystemIcmpV6Statistics.cs / 1 / SystemIcmpV6Statistics.cs
////// namespace System.Net.NetworkInformation { using System.Net.Sockets; using System; using System.ComponentModel; internal enum IcmpV6StatType { DestinationUnreachable = 1, PacketTooBig = 2, TimeExceeded = 3, ParameterProblem = 4, EchoRequest = 128, EchoReply = 129, MembershipQuery = 130, MembershipReport = 131, MembershipReduction = 132, RouterSolicit = 133, RouterAdvertisement = 134, NeighborSolict = 135, NeighborAdvertisement = 136, Redirect = 137, }; /// /// Provides support for ip configuation information and statistics. /// Icmp statistics for Ipv6. internal class SystemIcmpV6Statistics:IcmpV6Statistics { MibIcmpInfoEx stats; internal SystemIcmpV6Statistics(){ if (!ComNetOS.IsPostWin2K){ throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired)); } uint result = UnsafeNetInfoNativeMethods.GetIcmpStatisticsEx(out stats,AddressFamily.InterNetworkV6); if (result != IpHelperErrors.Success) { throw new NetworkInformationException((int)result); } } public override long MessagesSent{get {return (long)stats.outStats.dwMsgs;}} public override long MessagesReceived{get {return (long)stats.inStats.dwMsgs;}} public override long ErrorsSent{get {return (long)stats.outStats.dwErrors;}} public override long ErrorsReceived{get {return (long)stats.inStats.dwErrors;}} public override long DestinationUnreachableMessagesSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.DestinationUnreachable]; } } public override long DestinationUnreachableMessagesReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.DestinationUnreachable]; } } public override long PacketTooBigMessagesSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.PacketTooBig]; } } public override long PacketTooBigMessagesReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.PacketTooBig]; } } public override long TimeExceededMessagesSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.TimeExceeded]; } } public override long TimeExceededMessagesReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.TimeExceeded]; } } public override long ParameterProblemsSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.ParameterProblem]; } } public override long ParameterProblemsReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.ParameterProblem]; } } public override long EchoRequestsSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.EchoRequest]; } } public override long EchoRequestsReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.EchoRequest]; } } public override long EchoRepliesSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.EchoReply]; } } public override long EchoRepliesReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.EchoReply]; } } public override long MembershipQueriesSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.MembershipQuery]; } } public override long MembershipQueriesReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.MembershipQuery]; } } public override long MembershipReportsSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.MembershipReport]; } } public override long MembershipReportsReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.MembershipReport]; } } public override long MembershipReductionsSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.MembershipReduction]; } } public override long MembershipReductionsReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.MembershipReduction]; } } public override long RouterAdvertisementsSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.RouterAdvertisement]; } } public override long RouterAdvertisementsReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.RouterAdvertisement]; } } public override long RouterSolicitsSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.RouterSolicit]; } } public override long RouterSolicitsReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.RouterSolicit]; } } public override long NeighborAdvertisementsSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.NeighborAdvertisement]; } } public override long NeighborAdvertisementsReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.NeighborAdvertisement]; } } public override long NeighborSolicitsSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.NeighborSolict]; } } public override long NeighborSolicitsReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.NeighborSolict]; } } public override long RedirectsSent{ get { return stats.outStats.rgdwTypeCount[(long)IcmpV6StatType.Redirect]; } } public override long RedirectsReceived{ get { return stats.inStats.rgdwTypeCount[(long)IcmpV6StatType.Redirect]; } } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CompilerState.cs
- FtpRequestCacheValidator.cs
- Calendar.cs
- SQLMoney.cs
- VerificationAttribute.cs
- ModifierKeysConverter.cs
- WebBrowser.cs
- HandlerBase.cs
- DefaultWorkflowSchedulerService.cs
- JsonServiceDocumentSerializer.cs
- SimpleHandlerBuildProvider.cs
- CleanUpVirtualizedItemEventArgs.cs
- SqlBuffer.cs
- DataGridViewCellConverter.cs
- DetailsViewUpdateEventArgs.cs
- Transform3DGroup.cs
- MappingItemCollection.cs
- BindingExpressionBase.cs
- HttpGetProtocolReflector.cs
- GridViewEditEventArgs.cs
- PerformanceCounterCategory.cs
- BackgroundFormatInfo.cs
- CompilationUnit.cs
- BookmarkList.cs
- WebPartConnectionsCancelEventArgs.cs
- IdnMapping.cs
- DataGridViewColumnCollection.cs
- DataGridPageChangedEventArgs.cs
- PersianCalendar.cs
- CollectionMarkupSerializer.cs
- TriggerActionCollection.cs
- CompareInfo.cs
- WebPartsPersonalization.cs
- NameValueCollection.cs
- Exceptions.cs
- DynamicRouteExpression.cs
- PolygonHotSpot.cs
- followingquery.cs
- ServiceObjectContainer.cs
- ExpressionReplacer.cs
- XmlILAnnotation.cs
- HttpListenerPrefixCollection.cs
- XmlSchemaElement.cs
- TreeNodeCollection.cs
- HtmlInputFile.cs
- ExeConfigurationFileMap.cs
- IgnoreFlushAndCloseStream.cs
- HtmlInputReset.cs
- SqlIdentifier.cs
- ToolStripRenderer.cs
- GridPatternIdentifiers.cs
- ClientFormsAuthenticationCredentials.cs
- SchemaTableColumn.cs
- PieceDirectory.cs
- RotateTransform3D.cs
- Group.cs
- DataGridViewBindingCompleteEventArgs.cs
- RSAPKCS1SignatureDeformatter.cs
- sqlpipe.cs
- StrongNameKeyPair.cs
- HtmlElementCollection.cs
- QilInvoke.cs
- WebBrowserPermission.cs
- UnwrappedTypesXmlSerializerManager.cs
- VisualBasicHelper.cs
- EntryPointNotFoundException.cs
- EditorZone.cs
- PrefixHandle.cs
- DocumentApplicationJournalEntry.cs
- AstTree.cs
- ConnectionManagementSection.cs
- CollectionView.cs
- GroupedContextMenuStrip.cs
- MailWriter.cs
- columnmapkeybuilder.cs
- CommandTreeTypeHelper.cs
- MethodImplAttribute.cs
- DataGridItemEventArgs.cs
- Internal.cs
- ErrorWebPart.cs
- Int32CollectionValueSerializer.cs
- Stackframe.cs
- SqlHelper.cs
- ListControlConvertEventArgs.cs
- _IPv6Address.cs
- LinkedResource.cs
- SelectionWordBreaker.cs
- EventHandlersStore.cs
- BatchWriter.cs
- PathFigureCollectionConverter.cs
- TransportChannelFactory.cs
- EntityKey.cs
- AssemblyAssociatedContentFileAttribute.cs
- OracleEncoding.cs
- BuilderPropertyEntry.cs
- Merger.cs
- DeadCharTextComposition.cs
- XmlNodeReader.cs
- SqlMethods.cs
- ZoneIdentityPermission.cs