Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccie18643 committed Jul 14, 2024
1 parent f3c2e7a commit 1674f0b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pytcp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
# #
############################################################################

# pylint: disable=too-many-arguments


"""
Module contains the main PyTCP stack class.
pytcp/__init__.py
ver 2.8
ver 2.9
"""


Expand Down Expand Up @@ -87,7 +89,7 @@ def __init__(
ip6_gateway: str | None = None,
):
"""
Initialize stack on given interface.
Initialize stack on the provided interface.
"""

# Set the MAC address.
Expand Down Expand Up @@ -121,13 +123,15 @@ def __init__(
config.IP6_SUPPORT = True
config.IP6_LLA_AUTOCONFIG = True
config.IP6_GUA_AUTOCONFIG = False

self.rx_fd = fd[0]
self.tx_fd = fd[1]

def start(self) -> None:
"""
Start stack components.
"""

stack.timer.start()
stack.arp_cache.start()
stack.nd_cache.start()
Expand All @@ -142,6 +146,7 @@ def stop(self) -> None:
"""
Stop stack components.
"""

stack.packet_handler.stop()
stack.tx_ring.stop()
stack.rx_ring.stop()
Expand Down

0 comments on commit 1674f0b

Please sign in to comment.