/* This file is part of PacketDotNet PacketDotNet is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. PacketDotNet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with PacketDotNet. If not, see . */ /* * Copyright 2009 Chris Morgan */ using System; namespace PacketDotNet { /// /// Lengths and offsets to the fields in the LinuxSLL packet /// See http://github.com/mcr/libpcap/blob/master/pcap/sll.h /// public class LinuxSLLFields { /// /// Length of the packet type field /// public readonly static int PacketTypeLength = 2; /// /// Link layer address type /// public readonly static int LinkLayerAddressTypeLength = 2; /// /// Link layer address length /// public readonly static int LinkLayerAddressLengthLength = 2; /// /// The link layer address field length /// NOTE: the actual link layer address MAY be shorter than this /// public readonly static int LinkLayerAddressMaximumLength = 8; /// /// Number of bytes in a SLL header /// public readonly static int SLLHeaderLength = 16; /// /// Length of the ethernet protocol field /// public readonly static int EthernetProtocolTypeLength = 2; /// /// Position of the packet type field /// public readonly static int PacketTypePosition = 0; /// /// Position of the link layer address type field /// public readonly static int LinkLayerAddressTypePosition; /// /// Positino of the link layer address length field /// public readonly static int LinkLayerAddressLengthPosition; /// /// Position of the link layer address field /// public readonly static int LinkLayerAddressPosition; /// /// Position of the ethernet protocol type field /// public readonly static int EthernetProtocolTypePosition; static LinuxSLLFields() { LinkLayerAddressTypePosition = PacketTypePosition + PacketTypeLength; LinkLayerAddressLengthPosition = LinkLayerAddressTypePosition + LinkLayerAddressTypeLength; LinkLayerAddressPosition = LinkLayerAddressLengthPosition + LinkLayerAddressLengthLength; EthernetProtocolTypePosition = LinkLayerAddressPosition + LinkLayerAddressMaximumLength; } } }