skyscraper8/skyscraper8/Docsis/MacManagementMessage.cs
feyris-tan ef86554f9a Import
2025-05-12 22:09:16 +02:00

43 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using skyscraper5.Skyscraper;
namespace skyscraper5.Docsis
{
public abstract class MacManagementMessage : Validatable
{
public PhysicalAddress Source { get; }
public PhysicalAddress Destination { get; }
protected MacManagementMessage(PhysicalAddress source, PhysicalAddress destination, byte[] buffer)
{
if (buffer == null)
{
throw new ArgumentNullException(nameof(buffer));
}
Source = source;
Destination = destination;
}
public MacManagementMessageTypeAttribute MessageType
{
get
{
Type type = this.GetType();
object[] customAttributes = type.GetCustomAttributes(typeof(MacManagementMessageTypeAttribute), false);
if (customAttributes == null)
return null;
if (customAttributes.Length == 0)
return null;
MacManagementMessageTypeAttribute attribute = (MacManagementMessageTypeAttribute)customAttributes[0];
return attribute;
}
}
}
}