ccf0a1c0231118a6be9216296a0dcbe9f9c17f74
[vpp.git] / src / vpp-api / vom / acl_types.hpp
1 /*
2  * Copyright (c) 2017 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #ifndef __VOM_ACL_TYPES_H__
17 #define __VOM_ACL_TYPES_H__
18
19 #include "vom/types.hpp"
20
21 namespace VOM {
22 namespace ACL {
23 /**
24  * ACL Actions
25  */
26 struct action_t : public enum_base<action_t>
27 {
28   /**
29    * Constructor
30    */
31   action_t(int v, const std::string s);
32
33   /**
34    * Destructor
35    */
36   ~action_t() = default;
37
38   /**
39    * Permit and Reflexive
40    */
41   const static action_t PERMITANDREFLEX;
42
43   /**
44    * Permit Action
45    */
46   const static action_t PERMIT;
47
48   /**
49    * Deny Action
50    */
51   const static action_t DENY;
52
53   /**
54    * Get the enum type from a VPP integer value
55    */
56   static const action_t& from_int(uint8_t i);
57
58   /**
59    *Get the enum type from a bool value and optional uint8_t value
60    *which implements the connection tracking ....
61    */
62   static const action_t& from_bool(bool b, uint8_t c);
63 };
64 };
65 };
66
67 /*
68  * fd.io coding-style-patch-verification: ON
69  *
70  * Local Variables:
71  * eval: (c-set-style "mozilla")
72  * End:
73  */
74
75 #endif