nat: dslite plugin separation
[vpp.git] / src / plugins / nat / lib / lib.h
1 /*
2  * Copyright (c) 2020 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  * @file
17  * @brief NAT port/address allocation lib
18  */
19 #ifndef included_nat_lib_h__
20 #define included_nat_lib_h__
21
22 #define foreach_nat_error \
23   _(VALUE_EXIST, -1, "Value already exists") \
24   _(NO_SUCH_ENTRY, -2, "No such entry") \
25   _(UNKNOWN_PROTOCOL, -3, "Unknown protocol") \
26   _(OUT_OF_TRANSLATIONS, -4, "Out of translations")
27
28 #define foreach_nat_protocol \
29   _(UDP, 0, udp, "udp")       \
30   _(TCP, 1, tcp, "tcp")       \
31   _(ICMP, 2, icmp, "icmp")
32
33 typedef enum
34 {
35 #define _(N, i, s) NAT_ERROR_##N = i,
36   foreach_nat_error
37 #undef _
38 } nat_error_t;
39
40 typedef enum
41 {
42 #define _(N, i, n, s) NAT_PROTOCOL_##N = i,
43   foreach_nat_protocol
44 #undef _
45 } nat_protocol_t;
46
47 #endif /* included_nat_lib_h__ */
48 /*
49  * fd.io coding-style-patch-verification: ON
50  *
51  * Local Variables:
52  * eval: (c-set-style "gnu")
53  * End:
54  */