FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
lib.h
Go to the documentation of this file.
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 typedef enum
29 {
30 #define _(N, i, s) NAT_ERROR_##N = i,
32 #undef _
33 } nat_error_t;
34 
35 #define foreach_nat_protocol \
36  _ (OTHER, 0, other, "other") \
37  _ (UDP, 1, udp, "udp") \
38  _ (TCP, 2, tcp, "tcp") \
39  _ (ICMP, 3, icmp, "icmp")
40 
41 typedef enum
42 {
43 #define _(N, i, n, s) NAT_PROTOCOL_##N = i,
45 #undef _
47 
48 #endif /* included_nat_lib_h__ */
49 /*
50  * fd.io coding-style-patch-verification: ON
51  *
52  * Local Variables:
53  * eval: (c-set-style "gnu")
54  * End:
55  */
nat_protocol_t
Definition: lib.h:41
nat_error_t
Definition: lib.h:28
#define foreach_nat_error
Definition: lib.h:22
#define foreach_nat_protocol
Definition: lib.h:35