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 #ifndef SRC_PLUGINS_STN_STN_H_
17 #define SRC_PLUGINS_STN_STN_H_
19 #include <vlib/vlib.h>
20 #include <vnet/ip/ip4.h>
21 #include <vnet/ip/ip6.h>
22 #include <vppinfra/bihash_16_8.h>
25 ip46_address_t address;
31 /* pool of stn rules */
37 /* hash table used to retrieve the rule from the ip address */
38 clib_bihash_16_8_t rule_by_address_table;
40 u32 punt_to_stn_ip4_next_index;
41 u32 punt_to_stn_ip6_next_index;
47 /** Destination address of intercepted packets */
48 ip46_address_t address;
49 /** TX interface to send packets to */
51 /** Whether to delete the rule */
53 } stn_rule_add_del_args_t;
56 * Add or delete an stn rule.
58 int stn_rule_add_del (stn_rule_add_del_args_t *args);
60 extern stn_main_t stn_main;
63 stn_api_init (vlib_main_t * vm, stn_main_t * sm);
65 #endif /* SRC_PLUGINS_STN_STN_H_ */