|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _resolve(host): |
|
|
def _resolve(host): |
|
|
|
|
|
# Commenting out as network from_addr or to_addr could be IPv6 which |
|
|
|
|
|
# might not start with a number and causes errors with gethostbyname |
|
|
|
|
|
|
|
|
|
|
|
return host |
|
|
|
|
|
|
|
|
# let's just see if it starts with a number or a colon, for simplicity |
|
|
# let's just see if it starts with a number or a colon, for simplicity |
|
|
if re.match(r'^[0-9:]', host): |
|
|
|
|
|
return host |
|
|
|
|
|
|
|
|
#if re.match(r'^[0-9:]', host): |
|
|
|
|
|
#return host |
|
|
|
|
|
|
|
|
return socket.gethostbyname(host) |
|
|
|
|
|
|
|
|
#return socket.gethostbyname(host) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _as_rule(method, app, interface, protocol, from_addr, from_port, to_addr, to_port, comment): |
|
|
def _as_rule(method, app, interface, protocol, from_addr, from_port, to_addr, to_port, comment): |