From 67b698f982ee4ba90229da9aecb0746fa3650ce7 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 17 Apr 2020 19:53:10 +0500 Subject: [PATCH] Parse config --- main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.py b/main.py index 8e4a789..6542b00 100755 --- a/main.py +++ b/main.py @@ -1,8 +1,10 @@ #!/usr/bin/env python3 +import sys import pytun import struct import ipaddress +import json class IpHeader: def __init__(self, raw): @@ -24,6 +26,11 @@ class IpHeader: self.dst = ipaddress.IPv4Address(dst) def main(): + config_filename = sys.argv[1] + + with open(config_filename) as config_file: + config = json.load(config_file) + tun_iface = pytun.TunTapDevice() print(tun_iface.name)