#2205 - Tidied up interface creation and applied some suggestions from PR
This commit is contained in:
@@ -103,11 +103,11 @@ class ACLRule(SimComponent):
|
||||
The default action is `DENY`.
|
||||
:ivar Optional[IPProtocol] protocol: The network protocol (e.g., TCP, UDP, ICMP) to match. If `None`, the rule
|
||||
applies to all protocols.
|
||||
:ivar Optional[IPv4Address] src_ip_address: The source IP address to match. If combined with `src_wildcard_mask`,
|
||||
:ivar Optional[IPV4Address] src_ip_address: The source IP address to match. If combined with `src_wildcard_mask`,
|
||||
it specifies the start of an IP range.
|
||||
:ivar Optional[IPv4Address] src_wildcard_mask: The wildcard mask for the source IP address, defining the range
|
||||
:ivar Optional[IPV4Address] src_wildcard_mask: The wildcard mask for the source IP address, defining the range
|
||||
of addresses to match.
|
||||
:ivar Optional[IPv4Address] dst_ip_address: The destination IP address to match. If combined with
|
||||
:ivar Optional[IPV4Address] dst_ip_address: The destination IP address to match. If combined with
|
||||
`dst_wildcard_mask`, it specifies the start of an IP range.
|
||||
:ivar Optional[IPv4Address] dst_wildcard_mask: The wildcard mask for the destination IP address, defining the
|
||||
range of addresses to match.
|
||||
@@ -1225,7 +1225,7 @@ class Router(NetworkNode):
|
||||
"""
|
||||
Determines whether a given network frame should be forwarded to the session manager.
|
||||
|
||||
his function evaluates whether the destination IP address of the frame corresponds to one of the router's
|
||||
This function evaluates whether the destination IP address of the frame corresponds to one of the router's
|
||||
interface IP addresses. If so, it then checks if the frame is an ICMP packet or if the destination port matches
|
||||
any of the ports that the router's software manager identifies as open. If either condition is met, the frame
|
||||
is considered for further processing by the session manager, implying potential application-level handling or
|
||||
|
||||
@@ -118,15 +118,9 @@ class WirelessRouter(Router):
|
||||
def __init__(self, hostname: str, **kwargs):
|
||||
super().__init__(hostname=hostname, num_ports=0, **kwargs)
|
||||
|
||||
wap = WirelessAccessPoint(ip_address="127.0.0.1", subnet_mask="255.0.0.0", gateway="0.0.0.0")
|
||||
wap.port_num = 1
|
||||
self.connect_nic(wap)
|
||||
self.network_interface[1] = wap
|
||||
self.connect_nic(WirelessAccessPoint(ip_address="127.0.0.1", subnet_mask="255.0.0.0", gateway="0.0.0.0"))
|
||||
|
||||
router_interface = RouterInterface(ip_address="127.0.0.1", subnet_mask="255.0.0.0", gateway="0.0.0.0")
|
||||
router_interface.port_num = 2
|
||||
self.connect_nic(router_interface)
|
||||
self.network_interface[2] = router_interface
|
||||
self.connect_nic(RouterInterface(ip_address="127.0.0.1", subnet_mask="255.0.0.0", gateway="0.0.0.0"))
|
||||
|
||||
self.set_original_state()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user