Exemple #1
0
 def receive_offer(self, pkt):
    
     if pkt[MSGTYPE].code == 53:
         if pkt[MSGTYPE].type == 2:               
             
             log_scapy.debug("I've got DHCP Offer, and should send Request.")  
             self.your_client_ip = pkt[BOOTP].yiaddr
             self.server_id = pkt[SERVID].server_id
             raise self.RCVD_OFFER(pkt)
Exemple #2
0
 def receive_ack(self, pkt):
     if pkt[MSGTYPE].code == 53:
         if pkt[MSGTYPE].type == 5:
             #if pkt.haslayer(SERVID) and pkt[SERVID].server_id == self.server_id: #request without servid when client reboot           
             log_scapy.debug("I've got DHCP ACK.")
             raise self.RCVD_ACK()
Exemple #3
0
 def on_ERROR(self):
     log_scapy.debug("This is action:Error happened, the automata will be ended.")
Exemple #4
0
 def timeout_waiting(self):
     log_scapy.debug("This is timeout condition: I don't get what I want, I'll retry or raise ERROR state.")
     if self._cur_retry < self._max_retry:
         raise self.SEND_DISCOVER()
     else:
         raise self.ERROR()
Exemple #5
0
 def WAITING(self):
     log_scapy.debug("This is WAITING state.")