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:
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.
16 #include <vnet/ip/ip.h>
17 #include <nat/nat_dpo.h>
19 dpo_type_t nat_dpo_type;
22 nat_dpo_create (dpo_proto_t dproto, u32 aftr_index, dpo_id_t * dpo)
24 dpo_set (dpo, nat_dpo_type, dproto, aftr_index);
28 format_nat_dpo (u8 * s, va_list * args)
30 index_t index = va_arg (*args, index_t);
31 CLIB_UNUSED (u32 indent) = va_arg (*args, u32);
33 return (format (s, "NAT44 out2in: AFTR:%d", index));
37 nat_dpo_lock (dpo_id_t * dpo)
42 nat_dpo_unlock (dpo_id_t * dpo)
46 const static dpo_vft_t nat_dpo_vft = {
47 .dv_lock = nat_dpo_lock,
48 .dv_unlock = nat_dpo_unlock,
49 .dv_format = format_nat_dpo,
52 const static char *const nat_ip4_nodes[] = {
57 const static char *const nat_ip6_nodes[] = {
61 const static char *const *const nat_nodes[DPO_PROTO_NUM] = {
62 [DPO_PROTO_IP4] = nat_ip4_nodes,
63 [DPO_PROTO_IP6] = nat_ip6_nodes,
64 [DPO_PROTO_MPLS] = NULL,
68 nat_dpo_module_init (void)
70 nat_dpo_type = dpo_register_new_type (&nat_dpo_vft, nat_nodes);
74 * fd.io coding-style-patch-verification: ON
77 * eval: (c-set-style "gnu")