changes to replace MacAddress usage and remove ipaddress module altogether
This commit is contained in:
parent
4db7f845a5
commit
de493c810a
11 changed files with 43 additions and 83 deletions
|
@ -1,8 +1,8 @@
|
|||
import netaddr
|
||||
|
||||
from core import utils
|
||||
from core.emane.nodes import EmaneNet
|
||||
from core.emulator.enumerations import LinkTypes
|
||||
from core.nodes.ipaddress import MacAddress
|
||||
from core.nodes.physical import PhysicalNode
|
||||
|
||||
|
||||
|
@ -226,7 +226,7 @@ class IpPrefixes:
|
|||
|
||||
# random mac
|
||||
if not mac:
|
||||
mac = MacAddress.random()
|
||||
mac = utils.random_mac()
|
||||
|
||||
return InterfaceData(
|
||||
_id=inteface_id,
|
||||
|
@ -250,7 +250,7 @@ class InterfaceData:
|
|||
|
||||
:param int _id: interface id
|
||||
:param str name: name for interface
|
||||
:param core.nodes.ipaddress.MacAddress mac: mac address
|
||||
:param str mac: mac address
|
||||
:param str ip4: ipv4 address
|
||||
:param int ip4_mask: ipv4 bit mask
|
||||
:param str ip6: ipv6 address
|
||||
|
|
|
@ -33,7 +33,6 @@ from core.location.event import EventLoop
|
|||
from core.location.mobility import BasicRangeModel, MobilityManager
|
||||
from core.nodes.base import CoreNetworkBase, CoreNode, CoreNodeBase
|
||||
from core.nodes.docker import DockerNode
|
||||
from core.nodes.ipaddress import MacAddress
|
||||
from core.nodes.lxd import LxcNode
|
||||
from core.nodes.network import (
|
||||
CtrlNet,
|
||||
|
@ -1778,7 +1777,7 @@ class Session:
|
|||
net=control_net,
|
||||
ifindex=control_net.CTRLIF_IDX_BASE + net_index,
|
||||
ifname=f"ctrl{net_index}",
|
||||
hwaddr=MacAddress.random(),
|
||||
hwaddr=utils.random_mac(),
|
||||
addrlist=addrlist,
|
||||
)
|
||||
node.netif(interface1).control = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue