Updating DHCP docstrings

This commit is contained in:
Dom 2023-11-14 22:23:20 +00:00
parent cbd8f336ab
commit 93c412d0cd

View File

@ -130,6 +130,7 @@ class Packet():
_type: type of packet to construct, Offer or Ack _type: type of packet to construct, Offer or Ack
source_ip: IP address that the DHCP packet was received from source_ip: IP address that the DHCP packet was received from
topology: networkx Graph object detailing the network topology topology: networkx Graph object detailing the network topology
settings: settings file containing DHCP and TFTP server IPs, required for the packet contents
Returns: Returns:
DHCP packet of type Offer or Ack DHCP packet of type Offer or Ack
@ -294,6 +295,10 @@ class Packet():
class DHCPServer(object): class DHCPServer(object):
def __init__(self, SETTINGS_FILE): def __init__(self, SETTINGS_FILE):
'''
Summary:
Constructs the DHCPServer object using the contents of the settings YAML file.
'''
self.SETTINGS = yaml.load(open(SETTINGS_FILE), Loader=yaml.SafeLoader) self.SETTINGS = yaml.load(open(SETTINGS_FILE), Loader=yaml.SafeLoader)
self.DHCP_SERVER_IP = self.SETTINGS['DHCP']['SERVER_IP'] self.DHCP_SERVER_IP = self.SETTINGS['DHCP']['SERVER_IP']
self.DHCP_SERVER_PORT = self.SETTINGS['DHCP']['SERVER_PORT'] self.DHCP_SERVER_PORT = self.SETTINGS['DHCP']['SERVER_PORT']