-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruta.py
34 lines (24 loc) · 853 Bytes
/
ruta.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from conversor import Conversor
from dispositivo import Dispositvo
from puerto import Puerto
from random import randint
from trama import Trama
import ip_packet
from detector import CRC
from detector import Hamming
class Ruta:
def __init__(self, destination: str, mask: str, gateway:str,interfaz:int) -> None:
self.destination = destination
self.mask = mask
self.gateway = gateway
self.interfaz = interfaz # el puerto
def compare(self, ruta)-> bool:
if(self.destination != ruta.destination):
return False
if(self.mask != ruta.mask):
return False
if(self.gateway != ruta.gateway):
return False
if(self.interfaz != ruta.interfaz):
return False
return True