MCPcopy Create free account
hub / github.com/apache/mesos / lo

Function lo

src/linux/routing/link/link.cpp:91–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89
90
91Result<string> lo()
92{
93 Try<set<string>> links = net::links();
94 if (links.isError()) {
95 return Error("Failed to get all the links: " + links.error());
96 }
97
98 foreach (const string& link, links.get()) {
99 Result<bool> test = link::internal::test(link, IFF_LOOPBACK);
100 if (test.isError()) {
101 return Error("Failed to check the flag on link: " + link);
102 } else if (test.isSome() && test.get()) {
103 return link;
104 }
105 }
106
107 return None();
108}
109
110
111Try<bool> exists(const string& _link)

Callers 4

TEST_FFunction · 0.85
SetUpMethod · 0.85
SetUpMethod · 0.85
createMethod · 0.85

Calls 5

NoneClass · 0.85
errorMethod · 0.65
linksFunction · 0.50
ErrorFunction · 0.50
isErrorMethod · 0.45

Tested by 3

TEST_FFunction · 0.68
SetUpMethod · 0.68
SetUpMethod · 0.68