1
0
Fork 0

Use IPv4Address

master
Alex Kotov 3 years ago
parent 7d0195eadd
commit 8271b616e9
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
  1. 9
      main.py

@ -20,11 +20,12 @@ class Config:
self.port = data['port']
self.iface_name = data['iface_name']
self.iface_addr = data['iface_addr']
self.iface_dstaddr = data['iface_dstaddr']
self.iface_netmask = data['iface_netmask']
self.iface_mtu = data['iface_mtu']
self.iface_addr = ipaddress.IPv4Address(data['iface_addr'])
self.iface_dstaddr = ipaddress.IPv4Address(data['iface_dstaddr'])
class IpPacket:
def __init__(self, header, body):
self.header = header
@ -59,8 +60,8 @@ def main():
print(tun_iface.name)
tun_iface.addr = config.iface_addr
tun_iface.dstaddr = config.iface_dstaddr
tun_iface.addr = str(config.iface_addr)
tun_iface.dstaddr = str(config.iface_dstaddr)
tun_iface.netmask = config.iface_netmask
tun_iface.mtu = config.iface_mtu