EthernetAddress class encapsulates a 6 byte OctetString
representing an Ethernet MAC address.
Namespace:
SnmpSharpNetAssembly: SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.5.0.0 (0.5.0.0)
Syntax
| C# | Visual Basic | Visual C++ |
[SerializableAttribute] public class EthernetAddress : OctetString
<SerializableAttribute> _ Public Class EthernetAddress _ Inherits OctetString
[SerializableAttribute] public ref class EthernetAddress : public OctetString
Members
| All Members | Constructors | Properties | Methods |
| Member | Description | |
|---|---|---|
| EthernetAddress()()() | Constructor. Initialize the class to 0000.0000.0000
| |
| EthernetAddress(EthernetAddress) |
Constructor. Initialize the class with the value from the argument class.
| |
| EthernetAddress(OctetString) | Constructor. Initialize the class with the value from the OctetString argument.
| |
| EthernetAddress(array<Byte>[]()[]) |
Constructor. Initialize the class with the value of the byte array.
| |
| Append(array<Byte>[]()[]) |
Append contents of the byte array to the class value. If class value is length 0, byte array
content is set as the class value.
(Inherited from OctetString.) | |
| Append(String) |
Append string value to the OctetString class. If current class content is length 0, new
string value is set as the value of this class.
Class assumes that string value is UTF8 encoded.
(Inherited from OctetString.) | |
| Clone()()() | Create a new object that is a duplicate of the
current object.
(Overrides OctetString..::.Clone()()().) | |
| decode(array<Byte>[]()[], Int32) |
Decode OctetString from the BER format.
(Inherited from OctetString.) | |
| encode(MutableByte) | BER encode OctetString variable. (Inherited from OctetString.) | |
| Equals(Object) |
Compare against another object. Acceptable object types are OctetString and
String.
(Inherited from OctetString.) | |
| GetHashCode()()() |
Dummy override to prevent compiler warning messages.
(Inherited from OctetString.) | |
| GetType()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
| Item[([(Int32])]) |
Indexed access to the OctetString class data members.
(Inherited from OctetString.)OctetString os = new OctetString("test"); for(int i=0;i<=os.Length;i++) { Console.WriteLine("{0}",os[i]); } | |
| Length | Get length of the internal byte array. 0 if byte array is undefined or zero length. (Inherited from OctetString.) | |
| Reset()()() |
Reset internal buffer to null.
(Inherited from OctetString.) | |
| Set(String) | Parses hex string representing an Ethernet MAC address to the enternal format. Ethernet
address has to contain 12 hex characters (1-9 or A-F) to be parsed correctly. Special formatting is
ignored so both 0000.0010.0000 and 00-00-00-10-00-00 will be parsed ok.
(Overrides OctetString..::.Set(String).) | |
| Set(Byte) |
Set class value to an array 1 byte long and set the value to the supplied argument.
(Inherited from OctetString.) | |
| Set(array<Byte>[]()[]) |
Set class value from the argument byte array. If byte array argument is null or length == 0,
internal OctetString buffer is set to null.
(Inherited from OctetString.) | |
| Set(Int32, Byte) |
Set value at specified position to the supplied value
(Inherited from OctetString.) | |
| ToArray()()() |
Convert the OctetString class to a byte array. Internal class data buffer is *copied* and not passed to the caller.
(Inherited from OctetString.) | |
| ToHexString()()() |
Return string formatted hexadecimal representation of the objects value.
(Inherited from OctetString.) | |
| ToMACAddressString()()() | Utility function to print a MAC address (binary string of 6 byte length. (Inherited from OctetString.) | |
| ToString()()() |
Return Ethernet MAC address as a string formatted as: xxxx.xxxx.xxxx
(Overrides OctetString..::.ToString()()().) | |
| Type |
Return ASN.1 type of the object stored in this or derived class.
(Inherited from AsnType.) |
Remarks
THis class doesn't not represent a distinct ASN.1 data type. It is a helper
class to allow users to perform MAC address specific operations on OctetString values.
Inheritance Hierarchy
System..::.Object
SnmpSharpNet..::.AsnType
SnmpSharpNet..::.OctetString
SnmpSharpNet..::.EthernetAddress
SnmpSharpNet..::.AsnType
SnmpSharpNet..::.OctetString
SnmpSharpNet..::.EthernetAddress