Apache Mesos
fq_codel.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_FQ_CODEL_HPP__
18 #define __LINUX_ROUTING_QUEUEING_FQ_CODEL_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 fq_codel {
32 
33 constexpr char KIND[] = "fq_codel";
34 
35 
36 // NOTE: Root queueing discipline handle has to be X:0, so handle's
37 // secondary number has to be 0 here. There can be only one root
38 // queueing discipline on the egress side of a link and fq_codel is
39 // classless and hence there is only one instance of fq_codel per
40 // link. This allows us to fix the fq_codel handle.
41 
42 
43 // The default number of flows for the fq_codel queueing discipline.
44 extern const int DEFAULT_FLOWS;
45 
46 
47 // Returns true if there exists an fq_codel queueing discipline on the
48 // egress side of the link.
50  const std::string& link,
51  const Handle& parent);
52 
53 
54 // Creates a new fq_codel queueing discipline on the egress side of
55 // the link. Returns false if a queueing discipline already exists.
56 // NOTE: The root queueing discipline handle has to be X:0, so
57 // handle's secondary number must be zero if the parent is attached to
58 // EGRESS_ROOT.
60  const std::string& link,
61  const Handle& parent,
62  const Option<Handle>& handle);
63 
64 
65 // Removes the fq_codel queueing discipline from the link. Return
66 // false if the fq_codel queueing discipline is not found.
67 Try<bool> remove(
68  const std::string& link,
69  const Handle& parent);
70 
71 
72 // Returns the set of common Traffic Control statistics for the
73 // fq_codel queueing discipline on the link, None() if the link or
74 // qdisc does not exist or an error if we cannot cannot determine the
75 // result.
77  const std::string& link,
78  const Handle& parent);
79 
80 
81 } // namespace fq_codel {
82 } // namespace queueing {
83 } // namespace routing {
84 
85 #endif // __LINUX_ROUTING_QUEUEING_FQ_CODEL_HPP__
Definition: option.hpp:29
Definition: check.hpp:33
constexpr char KIND[]
Definition: fq_codel.hpp:33
Definition: handle.hpp:38
Definition: check.hpp:30
Try< bool > exists(const std::string &link, const Handle &parent)
Try< bool > create(const std::string &link, const Handle &parent, const Option< Handle > &handle)
Definition: diagnosis.hpp:30
Result< hashmap< std::string, uint64_t > > statistics(const std::string &link, const Handle &parent)