Example #1
0
 def create_dhcp_offer_packet(self):
     return testutils.dhcp_offer_packet(eth_client=self.client_iface_mac,
                                        eth_server=self.relay_iface_mac,
                                        ip_server=self.relay_iface_ip,
                                        ip_offered=self.client_ip,
                                        ip_gateway=self.relay_iface_ip,
                                        netmask_client=self.client_subnet,
                                        dhcp_lease=self.LEASE_TIME,
                                        padding_bytes=0)
Example #2
0
 def create_dhcp_offer_packet(self):
     return testutils.dhcp_offer_packet(eth_server=self.server_iface_mac,
                                        eth_dst=self.relay_iface_mac,
                                        eth_client=self.client_mac,
                                        ip_server=self.server_ip,
                                        ip_dst=self.relay_iface_ip,
                                        ip_offered=self.client_ip,
                                        port_dst=self.DHCP_SERVER_PORT,
                                        ip_gateway=self.relay_iface_ip,
                                        netmask_client=self.client_subnet,
                                        dhcp_lease=self.LEASE_TIME,
                                        padding_bytes=0,
                                        set_broadcast_bit=True)
Example #3
0
    def createDhcpOfferPacket(self, dutMac):
        """
        Helper function that creates DHCP Offer packet destined to DUT

        Args:
            dutMac(str): MAC address of DUT

        Returns:
            packet: DHCP Offer packet
        """
        return testutils.dhcp_offer_packet(
            eth_dst=dutMac,
            eth_server=self.DHCP_RELAY["mac"],
            eth_client=self.DHCP_CLIENT["mac"],
            ip_server=self.DHCP_SERVER["ip"],
            ip_dst=self.DHCP_RELAY["ip"],
            ip_offered=self.DHCP_CLIENT["ip"],
            port_dst=self.DHCP_SERVER["port"],
            ip_gateway=self.DHCP_RELAY["ip"],
            netmask_client=self.DHCP_CLIENT["subnet"],
            dhcp_lease=self.LEASE_TIME_SEC,
            padding_bytes=0,
            set_broadcast_bit=True)