daemon: Include MAC addresses in CORE API link messages.

This commit is contained in:
tgoff0 2015-03-09 15:20:42 +00:00
parent db03927892
commit db15bee60c
3 changed files with 16 additions and 0 deletions

View file

@ -68,6 +68,9 @@ class PtpNet(NetgraphPipeNet):
tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF1NUM, \ tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF1NUM, \
if1.node.getifindex(if1)) if1.node.getifindex(if1))
if if1.hwaddr:
tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF1MAC,
if1.hwaddr)
for addr in if1.addrlist: for addr in if1.addrlist:
(ip, sep, mask) = addr.partition('/') (ip, sep, mask) = addr.partition('/')
mask = int(mask) mask = int(mask)
@ -86,6 +89,9 @@ class PtpNet(NetgraphPipeNet):
tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF2NUM, \ tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF2NUM, \
if2.node.getifindex(if2)) if2.node.getifindex(if2))
if if2.hwaddr:
tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF2MAC,
if2.hwaddr)
for addr in if2.addrlist: for addr in if2.addrlist:
(ip, sep, mask) = addr.partition('/') (ip, sep, mask) = addr.partition('/')
mask = int(mask) mask = int(mask)

View file

@ -371,6 +371,10 @@ class PyCoreNet(PyCoreObj):
1) 1)
tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF2NUM, tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF2NUM,
otherobj.getifindex(netif)) otherobj.getifindex(netif))
if netif.hwaddr:
tlvdata += \
coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF2MAC,
netif.hwaddr)
for addr in netif.addrlist: for addr in netif.addrlist:
(ip, sep, mask) = addr.partition('/') (ip, sep, mask) = addr.partition('/')
mask = int(mask) mask = int(mask)

View file

@ -108,6 +108,9 @@ class PtpNet(LxBrNet):
tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF1NUM, \ tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF1NUM, \
if1.node.getifindex(if1)) if1.node.getifindex(if1))
if if1.hwaddr:
tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF1MAC,
if1.hwaddr)
for addr in if1.addrlist: for addr in if1.addrlist:
(ip, sep, mask) = addr.partition('/') (ip, sep, mask) = addr.partition('/')
mask = int(mask) mask = int(mask)
@ -126,6 +129,9 @@ class PtpNet(LxBrNet):
tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF2NUM, \ tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF2NUM, \
if2.node.getifindex(if2)) if2.node.getifindex(if2))
if if2.hwaddr:
tlvdata += coreapi.CoreLinkTlv.pack(coreapi.CORE_TLV_LINK_IF2MAC,
if2.hwaddr)
for addr in if2.addrlist: for addr in if2.addrlist:
(ip, sep, mask) = addr.partition('/') (ip, sep, mask) = addr.partition('/')
mask = int(mask) mask = int(mask)