Apache Mesos
route.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __LINUX_ROUTING_ROUTE_HPP__
18 #define __LINUX_ROUTING_ROUTE_HPP__
19 
20 #include <string>
21 #include <vector>
22 
23 #include <stout/ip.hpp>
24 #include <stout/option.hpp>
25 #include <stout/result.hpp>
26 #include <stout/try.hpp>
27 
28 namespace routing {
29 namespace route {
30 
31 // Represents a rule in the routing table (for IPv4).
32 struct Rule
33 {
34  Rule(const Option<net::IP::Network>& _destination,
35  const Option<net::IP>& _gateway,
36  const std::string& _link)
37  : destination(_destination),
38  gateway(_gateway),
39  link(_link) {}
40 
43  std::string link;
44 };
45 
46 
47 // Returns the main routing table of this host.
49 
50 
51 // Returns the default gateway of this host.
53 
54 } // namespace route {
55 } // namespace routing {
56 
57 #endif // __LINUX_ROUTING_ROUTE_HPP__
Option< net::IP > gateway
Definition: route.hpp:42
Result< net::IP > defaultGateway()
Option< net::IP::Network > destination
Definition: route.hpp:41
Definition: try.hpp:34
Rule(const Option< net::IP::Network > &_destination, const Option< net::IP > &_gateway, const std::string &_link)
Definition: route.hpp:34
Definition: route.hpp:32
Definition: result.hpp:40
std::string link
Definition: route.hpp:43
Try< std::vector< Rule > > table()