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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @brief NAT port/address allocation lib
19 #ifndef included_nat_lib_h__
20 #define included_nat_lib_h__
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")
28 #define foreach_nat_protocol \
29 _(UDP, 0, udp, "udp") \
30 _(TCP, 1, tcp, "tcp") \
31 _(ICMP, 2, icmp, "icmp")
35 #define _(N, i, s) NAT_ERROR_##N = i,
42 #define _(N, i, n, s) NAT_PROTOCOL_##N = i,
47 #endif /* included_nat_lib_h__ */
49 * fd.io coding-style-patch-verification: ON
52 * eval: (c-set-style "gnu")