/*
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 2010 Chris Morgan
*/
using System;
namespace PacketDotNet
{
///
/// Point to Point Protocol
/// See http://tools.ietf.org/html/rfc2516
///
public class PPPoEFields
{
/// Size in bytes of the version/type field
public readonly static int VersionTypeLength = 1;
/// Size in bytes of the code field
public readonly static int CodeLength = 1;
/// Size in bytes of the SessionId field
public readonly static int SessionIdLength = 2;
/// Size in bytes of the Length field
public readonly static int LengthLength = 2;
/// Offset from the start of the header to the version/type field
public readonly static int VersionTypePosition = 0;
/// Offset from the start of the header to the Code field
public readonly static int CodePosition;
/// Offset from the start of the header to the SessionId field
public readonly static int SessionIdPosition;
/// Offset from the start of the header to the Length field
public readonly static int LengthPosition;
///
/// Length of the overall PPPoe header
///
public readonly static int HeaderLength;
static PPPoEFields()
{
CodePosition = VersionTypePosition + VersionTypeLength;
SessionIdPosition = CodePosition + CodeLength;
LengthPosition = SessionIdPosition + SessionIdLength;
HeaderLength = LengthPosition + LengthLength;
}
}
}