-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathIPNetRow.cs
More file actions
69 lines (56 loc) · 2.06 KB
/
IPNetRow.cs
File metadata and controls
69 lines (56 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
using System.Net;
using System.Net.NetworkInformation;
namespace IPHelper
{
public class IPNetRow
{
#region Private Fields
private readonly int _adaptorIndex;
private readonly IPAddress _entryIPAddress;
private readonly PhysicalAddress _entryMacAddress;
private readonly Win32Funcs.IpNetRow _orginalData;
private readonly Win32Funcs.ArpEntryType _typeOfArp;
#endregion
#region Constructors
public IPNetRow(Win32Funcs.IpNetRow ipNetRow)
{
// Todo : I Know what i have to do here! :D ;)
_orginalData = ipNetRow;
_adaptorIndex = ipNetRow.adaptorIndex;
var macaddress = new byte[8]
{
ipNetRow.adaptorPhysicalMacAddress0, ipNetRow.adaptorPhysicalMacAddress1,
ipNetRow.adaptorPhysicalMacAddress2, ipNetRow.adaptorPhysicalMacAddress3,
ipNetRow.adaptorPhysicalMacAddress4, ipNetRow.adaptorPhysicalMacAddress5,
ipNetRow.adaptorPhysicalMacAddress6, ipNetRow.adaptorPhysicalMacAddress7
};
_entryMacAddress = new PhysicalAddress(macaddress);
_entryIPAddress = new IPAddress(BitConverter.GetBytes(ipNetRow.adaptorAddr));
_typeOfArp = (Win32Funcs.ArpEntryType)ipNetRow.typeOfARPEntry;
}
#endregion
#region Public Properties
public int AdaptorIndex
{
get { return _adaptorIndex; }
}
public PhysicalAddress EntryMacAddress
{
get { return _entryMacAddress; }
}
public IPAddress EntryIPAddress
{
get { return _entryIPAddress; }
}
public Win32Funcs.ArpEntryType TypeOfArpEntry
{
get { return _typeOfArp; }
}
public Win32Funcs.IpNetRow GetIpNetRowStructure()
{
return _orginalData;
}
#endregion
}
}