Apache Mesos
htb.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_QUEUEING_HTB_HPP__
18 #define __LINUX_ROUTING_QUEUEING_HTB_HPP__
19 
20 #include <stdint.h>
21 
22 #include <string>
23 
24 #include <stout/hashmap.hpp>
25 #include <stout/try.hpp>
26 
27 #include "linux/routing/handle.hpp"
28 
29 namespace routing {
30 namespace queueing {
31 namespace htb {
32 
33 constexpr char KIND[] = "htb";
34 
35 // Returns true if there exists an htb queueing discipline on the
36 // egress side of the link.
38  const std::string& link,
39  const Handle& parent);
40 
41 
42 // Creates a new htb queueing discipline on the egress side of
43 // the link. Returns false if a queueing discipline already exists which
44 // prevents the creation.
46  const std::string& link,
47  const Handle& parent,
48  const Option<Handle>& handle);
49 
50 
51 // Removes the htb queueing discipline from the link. Returns
52 // false if the htb queueing discipline is not found.
53 Try<bool> remove(
54  const std::string& link,
55  const Handle& parent);
56 
57 
58 // Returns the set of common Traffic Control statistics for the
59 // htb queueing discipline on the link, None() if the link or
60 // qdisc does not exist or an error if we cannot cannot determine the
61 // result.
63  const std::string& link,
64  const Handle& parent);
65 
66 
67 } // namespace htb {
68 } // namespace queueing {
69 } // namespace routing {
70 
71 #endif // __LINUX_ROUTING_QUEUEING_HTB_HPP__
Definition: option.hpp:29
Definition: check.hpp:33
Try< bool > exists(const std::string &link, const Handle &parent)
Definition: handle.hpp:38
Try< bool > create(const std::string &link, const Handle &parent, const Option< Handle > &handle)
Definition: check.hpp:30
Result< hashmap< std::string, uint64_t > > statistics(const std::string &link, const Handle &parent)
Definition: diagnosis.hpp:30
constexpr char KIND[]
Definition: htb.hpp:33