diff --git a/routerinfo.cpp b/routerinfo.cpp index a56a273..1991c0a 100644 --- a/routerinfo.cpp +++ b/routerinfo.cpp @@ -6,7 +6,7 @@ static void usage(const char * argv) { - std::cout << "usage: " << argv << " [-6|-f|-p] routerinfo.dat" << std::endl; + std::cout << "usage: " << argv << " [-6|-f|-p|-y] routerinfo.dat" << std::endl; } template @@ -51,7 +51,8 @@ int main(int argc, char * argv[]) bool ipv6 = false; bool firewall = false; bool port = false; - while((opt = getopt(argc, argv, "6fp")) != -1) { + bool yggdrasil = false; + while((opt = getopt(argc, argv, "6fpy")) != -1) { switch(opt) { case '6': ipv6 = true; @@ -62,6 +63,9 @@ int main(int argc, char * argv[]) case 'p': port = true; break; + case 'y': + yggdrasil = true; + break; default: usage(argv[0]); return 1; @@ -89,7 +93,13 @@ int main(int argc, char * argv[]) a = ri.GetSSU2V6Address(); if(a) addrs.push_back(a); - } + } + + if(yggdrasil){ + a = ri.GetYggdrasilAddress(); + if(a) + addrs.push_back(a); + } if(firewall) std::cout << "# ";