Click here to Skip to main content
15,896,526 members
Articles / Web Development / HTML

SharpPcap - A Packet Capture Framework for .NET

,
Rate me:
Please Sign up or sign in to vote.
4.94/5 (192 votes)
5 May 2014MPL21 min read 2.1M   10.3K   518  
A framework for capturing, injecting and analyzing network packets for .NET applications based on the WinPcap packet capture driver
// $Id: IGMPFields.java,v 1.1 2001/07/30 00:00:02 pcharles Exp $

/// <summary>************************************************************************
/// Copyright (C) 2001, Patrick Charles and Jonas Lehmann                   *
/// Distributed under the Mozilla Public License                            *
/// http://www.mozilla.org/NPL/MPL-1.1.txt                                *
/// *************************************************************************
/// </summary>
namespace Tamir.IPLib.Packets
{
	using System;
	
	
	/// <summary> IGMP protocol field encoding information.
	/// *
	/// </summary>
	/// <author>  Patrick Charles and Jonas Lehmann
	/// </author>
	/// <version>  $Revision: 1.1 $
	/// @lastModifiedBy $Author: pcharles $
	/// @lastModifiedAt $Date: 2001/07/30 00:00:02 $
	/// 
	/// </version>
	public struct IGMPFields{
		// field lengths
			
		/// <summary> Length of the IGMP message type code in bytes.</summary>
		public readonly static int IGMP_CODE_LEN = 1;
		/// <summary> Length of the IGMP max response code in bytes.</summary>
		public readonly static int IGMP_MRSP_LEN = 1;
		/// <summary> Length of the IGMP header checksum in bytes.</summary>
		public readonly static int IGMP_CSUM_LEN = 2;
		/// <summary> Length of group address in bytes.</summary>
		public readonly static int IGMP_GADDR_LEN;

		// field positions
			
		/// <summary> Position of the IGMP message type.</summary>
		public readonly static int IGMP_CODE_POS = 0;
		/// <summary> Position of the IGMP max response code.</summary>
		public readonly static int IGMP_MRSP_POS;
		/// <summary> Position of the IGMP header checksum.</summary>
		public readonly static int IGMP_CSUM_POS;
		/// <summary> Position of the IGMP group address.</summary>
		public readonly static int IGMP_GADDR_POS;
		// complete header length 
			
		/// <summary> Length in bytes of an IGMP header.</summary>
		// 8
		public readonly static int IGMP_HEADER_LEN;	
		
		static IGMPFields()
		{
			IGMP_GADDR_LEN = IPAddress.WIDTH;
			IGMP_MRSP_POS = Tamir.IPLib.Packets.IGMPFields.IGMP_CODE_POS + Tamir.IPLib.Packets.IGMPFields.IGMP_CODE_LEN;
			IGMP_CSUM_POS = Tamir.IPLib.Packets.IGMPFields.IGMP_MRSP_POS + Tamir.IPLib.Packets.IGMPFields.IGMP_MRSP_LEN;
			IGMP_GADDR_POS = Tamir.IPLib.Packets.IGMPFields.IGMP_CSUM_POS + Tamir.IPLib.Packets.IGMPFields.IGMP_CSUM_LEN;
			IGMP_HEADER_LEN = Tamir.IPLib.Packets.IGMPFields.IGMP_GADDR_POS + Tamir.IPLib.Packets.IGMPFields.IGMP_GADDR_LEN;
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Mozilla Public License 1.1 (MPL 1.1)


Written By
Software Developer
Israel Israel
Works as a Network Engineer for a leading networking company.

Written By
United States United States
Entrepreneur and product developer with a wide range of technical and business experience.

Comments and Discussions