为什么系统调用 GetIpNetTable 的物理地址有 8 个字节(而不是 6 个字节)?

发布于 2025-01-04 14:47:40 字数 535 浏览 3 评论 0 原文

在我最新的项目中,我使用 GetIpNetTable 使用 .NET 从 C# 访问 Windows ARP 表,

我注意到,当我查看 MAC 地址时,我的条目的最后两个字节(7 和 8)不断变化! 由于 MAC 地址通常只有 6 个字节,我想知道这两个字节包含什么...

请参阅 http://msdn.microsoft.com/en-us/library/cc704859%28v=prot.10%29.aspx

ypedef struct _MIB_IPNETROW {
  DWORD dwIndex;
  DWORD dwPhysAddrLen;
  BYTE bPhysAddr[8]; // WHY 8 BYTES??
  DWORD dwAddr;
  DWORD dwType;
} MIB_IPNETROW, 
 *PMIB_IPNETROW;

In my latest project I use GetIpNetTable for accessing the Windows ARP-Table from C# using .NET

I noticed, when I looked at the MAC Addresses, that the last two bytes (7 and 8) of my entries kept changing!
As MAC addresses usually have only 6 Bytes, I wondered what these two bytes contain...

See http://msdn.microsoft.com/en-us/library/cc704859%28v=prot.10%29.aspx

ypedef struct _MIB_IPNETROW {
  DWORD dwIndex;
  DWORD dwPhysAddrLen;
  BYTE bPhysAddr[8]; // WHY 8 BYTES??
  DWORD dwAddr;
  DWORD dwType;
} MIB_IPNETROW, 
 *PMIB_IPNETROW;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

记忆消瘦 2025-01-11 14:47:40

由于链路层并不总是以太网,因此物理地址并不总是 MAC,因此也不总是 48 位。我认为该字段包含一个 EUI-64 地址,在以太网的情况下,该地址是通过将 FF-FF 插入 MAC EUI-48 地址的中间而生成的。

As a link layer isn't always Ethernet, the physical address isn't always MAC and therefore not always 48-bit. I suppose this field contains an EUI-64 address, which in the case of Ethernet is generated by inserting FF-FF into the middle of the MAC EUI-48 address.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文