Apache Mesos
ingress.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_INGRESS_HPP__
18 #define __LINUX_ROUTING_QUEUEING_INGRESS_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 ingress {
32 
33 constexpr char KIND[] = "ingress";
34 
35 
36 // The handle of the ingress queueing discipline is immutable.
37 constexpr Handle HANDLE = Handle(0xffff, 0);
38 
39 
40 // Returns true if there exists an ingress qdisc on the link.
41 Try<bool> exists(const std::string& link);
42 
43 
44 // Creates a new ingress qdisc on the link. Returns false if an
45 // ingress qdisc already exists on the link.
46 Try<bool> create(const std::string& link);
47 
48 
49 // Removes the ingress qdisc on the link. Return false if the ingress
50 // qdisc is not found.
51 Try<bool> remove(const std::string& link);
52 
53 // Returns the set of common Traffic Control statistics for the
54 // ingress queueing discipline on the link, None() if the link or
55 // qdisc does not exist or an error if we cannot cannot determine the
56 // result.
57 Result<hashmap<std::string, uint64_t>> statistics(const std::string& link);
58 
59 } // namespace ingress {
60 } // namespace queueing {
61 } // namespace routing {
62 
63 #endif // __LINUX_ROUTING_QUEUEING_INGRESS_HPP__
Definition: check.hpp:33
Definition: handle.hpp:38
Definition: check.hpp:30
Try< bool > exists(const std::string &link)
Definition: exists.hpp:26
constexpr Handle HANDLE
Definition: ingress.hpp:37
constexpr char KIND[]
Definition: ingress.hpp:33
Definition: diagnosis.hpp:30
Result< hashmap< std::string, uint64_t > > statistics(const std::string &link)
Try< bool > create(const std::string &link)