/*
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 2012 Alan Rushforth
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PacketDotNet
{
namespace Ieee80211
{
///
/// The Sequence control field occurs in management and data frames and is used to
/// relate together fragmented payloads carried in multiple 802.11 frames.
///
public class SequenceControlField
{
///
/// Gets or sets the field that backs all the other properties in the class.
///
///
/// The field.
///
public UInt16 Field { get; set; }
///
/// Gets or sets the sequence number.
///
///
/// The sequence number.
///
public short SequenceNumber
{
get
{
return (short)(Field >> 4);
}
set
{
//Use the & mask to make sure we only overwrite the sequence number part of the field
Field &= 0xF;
Field |= (UInt16)(value << 4);
}
}
///
/// Gets or sets the fragment number.
///
///
/// The fragment number.
///
public byte FragmentNumber
{
get
{
return (byte)(Field & 0x000F);
}
set
{
Field &= unchecked((ushort)~0xF);
Field |= (UInt16)(value & 0x0F);
}
}
///
/// Initializes a new instance of the class.
///
public SequenceControlField()
{
}
///
/// Constructor
///
///
/// A
///
public SequenceControlField(UInt16 field)
{
this.Field = field;
}
}
}
}