1# formatting details: see "get_olsr_service"
6 # openvpn://192.168.2.191:5101|udp|gw public_host:subaru.opennet-initiative.de upload:293 download:11786 #192.168.2.191
7 if ($1 && ($1 ~ /^[^#]/)) {
8 # remove trailing " #..." (describing the source of the announcement)
9 sub("[[:blank:]]+#.*$", "", $0);
11 split($0, tokens, "|");
13 # parse the first part, e.g. "openvpn://192.168.2.191:5101"
14 split(tokens[1], url_tokens, ":");
15 scheme = url_tokens[1];
16 host = substr(url_tokens[2], 3);
17 split(url_tokens[3], port_and_path, "/");
18 port = port_and_path[1];
19 path = "/" port_and_path[2];
22 details_count = split(tokens[3], service_and_details) - 1;
23 service = service_and_details[1];
24 if (details_count > 0) {
26 sub("^[^ ]+ ", "", details);
31 if ((scheme == "http") && (port == "8080") && (protocol == "tcp") && ((service == "gw") || (service == "ugw"))) {
37 print(service, scheme, host, port, protocol, path, details);