예제 #1
0
파일: Client.py 프로젝트: mgold/Packets
 def sendMail(self):
     mail = Packet(self.screen, self.pos[0], self.pos[1])
     mail.color = self.color
     mail.protocol = "SMTP"
     mail.source = self.IP
     mail.sender = self.name
     mail.destination = self.names[self.corespondent]
     self.link.send(mail, self)
예제 #2
0
파일: Client.py 프로젝트: mgold/Packets
 def update(self):
     if self.corespondent not in self.names:
         if self.timer == 0:
             request = Packet(self.screen, self.pos[0], self.pos[1])
             request.color = (191, 128, 128)
             request.protocol = "DNS Request"
             request.source = self.IP
             request.destination = DNSIP()
             request.request = self.corespondent
             self.link.send(request, self)
             self.timer = 250
         else:
             self.timer -= 1
예제 #3
0
파일: DNS.py 프로젝트: mgold/Packets
 def receive(self, packet):
     if packet.protocol == "OSPF":
         pass
     elif packet.protocol == "DNS Request":
         respacket = Packet(self.screen, self.pos[0], self.pos[1])
         respacket.protocol = "DNS Response"
         respacket.destination = packet.source
         respacket.color = self.packetColor
         respacket.source = self.IP
         try:
             respacket.response = packet.request, self.names[packet.request]
             respacket.code = 200
         except KeyError: #Yes, I'm using HTTP codes for DNS. Shh.
             respacket.response = None
             respacket.code = 404
         packet.link.send(respacket, self)