blob: 7c2d5510bcb08b00398b0573c78f95ad924015b7 [file] [log] [blame]
Keith Burns (alagalah)07203af2016-08-25 13:37:37 -07001/*
Ed Warnickecb9cada2015-12-08 15:45:58 -07002 *------------------------------------------------------------------
3 * tuntap.h - kernel stack (reverse) punt/inject path
4 *
5 * Copyright (c) 2009 Cisco and/or its affiliates.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at:
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *------------------------------------------------------------------
18 */
Keith Burns (alagalah)07203af2016-08-25 13:37:37 -070019/**
20 * @file
21 * @brief Call from VLIB_INIT_FUNCTION to set the Linux kernel inject node name.
Ed Warnickecb9cada2015-12-08 15:45:58 -070022 */
23void register_tuntap_inject_node_name (char *name);
24
Dave Barach2feaffc2017-01-14 10:30:50 -050025/** arguments structure for vnet_tap_connect, vnet_tap_connect_renumber, etc.
26 */
Ed Warnickecb9cada2015-12-08 15:45:58 -070027
Dave Barach2feaffc2017-01-14 10:30:50 -050028typedef struct
29{
30 /** Interface name */
31 u8 *intfc_name;
32 /** Mac address */
33 u8 *hwaddr_arg;
34 /** Please set the indicated ip4 address/mask on the interface */
35 u8 ip4_address_set;
36 /** Please set the indicated ip4 address/mask on the interface */
37 u8 ip6_address_set;
38 /** Renumber the (existing) interface */
39 u8 renumber;
40 /** (optional) ip4 address to set */
41 ip4_address_t *ip4_address;
42 /** (optional) ip4 mask width to set */
43 u32 ip4_mask_width;
44 /** (optional) ip6 address to set */
45 ip6_address_t *ip6_address;
46 /** (optional) ip6 mask width to set */
47 u32 ip6_mask_width;
48 /** Output parameter: result sw_if_index */
49 u32 *sw_if_indexp;
50 /** Custom device instance */
51 u32 custom_dev_instance;
52 /** original sw_if_index (renumber) */
53 u32 orig_sw_if_index;
54} vnet_tap_connect_args_t;
55
56/** Connect a tap interface */
57int vnet_tap_connect (vlib_main_t * vm, vnet_tap_connect_args_t *args);
58
59/** Connect / renumber a tap interface */
60int vnet_tap_connect_renumber (vlib_main_t * vm,
61 vnet_tap_connect_args_t *args);
62
63/** Modify a tap interface */
64int vnet_tap_modify (vlib_main_t * vm, vnet_tap_connect_args_t *args);
65
66/** delete a tap interface */
Ed Warnickecb9cada2015-12-08 15:45:58 -070067int vnet_tap_delete(vlib_main_t *vm, u32 sw_if_index);
68
Dave Barach2feaffc2017-01-14 10:30:50 -050069