1cb9cadadSEd Warnicke/*
2cb9cadadSEd Warnicke * Copyright (c) 2015 Cisco and/or its affiliates.
3cb9cadadSEd Warnicke * Licensed under the Apache License, Version 2.0 (the "License");
4cb9cadadSEd Warnicke * you may not use this file except in compliance with the License.
5cb9cadadSEd Warnicke * You may obtain a copy of the License at:
6cb9cadadSEd Warnicke *
7cb9cadadSEd Warnicke *     http://www.apache.org/licenses/LICENSE-2.0
8cb9cadadSEd Warnicke *
9cb9cadadSEd Warnicke * Unless required by applicable law or agreed to in writing, software
10cb9cadadSEd Warnicke * distributed under the License is distributed on an "AS IS" BASIS,
11cb9cadadSEd Warnicke * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12cb9cadadSEd Warnicke * See the License for the specific language governing permissions and
13cb9cadadSEd Warnicke * limitations under the License.
14cb9cadadSEd Warnicke */
15cb9cadadSEd Warnicke/*
16cb9cadadSEd Warnicke * vnet.h: general networking definitions
17cb9cadadSEd Warnicke *
18cb9cadadSEd Warnicke * Copyright (c) 2011 Eliot Dresselhaus
19cb9cadadSEd Warnicke *
20cb9cadadSEd Warnicke * Permission is hereby granted, free of charge, to any person obtaining
21cb9cadadSEd Warnicke * a copy of this software and associated documentation files (the
22cb9cadadSEd Warnicke * "Software"), to deal in the Software without restriction, including
23cb9cadadSEd Warnicke * without limitation the rights to use, copy, modify, merge, publish,
24cb9cadadSEd Warnicke * distribute, sublicense, and/or sell copies of the Software, and to
25cb9cadadSEd Warnicke * permit persons to whom the Software is furnished to do so, subject to
26cb9cadadSEd Warnicke * the following conditions:
27cb9cadadSEd Warnicke *
28cb9cadadSEd Warnicke * The above copyright notice and this permission notice shall be
29cb9cadadSEd Warnicke * included in all copies or substantial portions of the Software.
30cb9cadadSEd Warnicke *
31cb9cadadSEd Warnicke *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32cb9cadadSEd Warnicke *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33cb9cadadSEd Warnicke *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34cb9cadadSEd Warnicke *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
35cb9cadadSEd Warnicke *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
36cb9cadadSEd Warnicke *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
37cb9cadadSEd Warnicke *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38cb9cadadSEd Warnicke */
39cb9cadadSEd Warnicke
40cb9cadadSEd Warnicke#ifndef included_vnet_vnet_h
41cb9cadadSEd Warnicke#define included_vnet_vnet_h
42cb9cadadSEd Warnicke
43cb9cadadSEd Warnicke#include <vppinfra/types.h>
44cb9cadadSEd Warnicke
453ae2873eSDave Barach#include <vppinfra/pcap.h>
46cb9cadadSEd Warnicke#include <vnet/buffer.h>
47cb9cadadSEd Warnicke#include <vnet/config.h>
48cb9cadadSEd Warnicke#include <vnet/interface.h>
49cb9cadadSEd Warnicke#include <vnet/api_errno.h>
50cb9cadadSEd Warnicke
51ba868bb7SDave Barachtypedef struct vnet_main_t
52ba868bb7SDave Barach{
53cb9cadadSEd Warnicke  u32 local_interface_hw_if_index;
54cb9cadadSEd Warnicke  u32 local_interface_sw_if_index;
55cb9cadadSEd Warnicke
56cb9cadadSEd Warnicke  vnet_interface_main_t interface_main;
57cb9cadadSEd Warnicke
58cb9cadadSEd Warnicke  /* set up by constructors */
59ba868bb7SDave Barach  vnet_device_class_t *device_class_registrations;
60ba868bb7SDave Barach  vnet_hw_interface_class_t *hw_interface_class_registrations;
618b37b873SNeale Ranns    _vnet_interface_function_list_elt_t
628b37b873SNeale Ranns    * hw_interface_add_del_functions[VNET_ITF_FUNC_N_PRIO];
638b37b873SNeale Ranns    _vnet_interface_function_list_elt_t
648b37b873SNeale Ranns    * hw_interface_link_up_down_functions[VNET_ITF_FUNC_N_PRIO];
658b37b873SNeale Ranns    _vnet_interface_function_list_elt_t
668b37b873SNeale Ranns    * sw_interface_add_del_functions[VNET_ITF_FUNC_N_PRIO];
678b37b873SNeale Ranns    _vnet_interface_function_list_elt_t
688b37b873SNeale Ranns    * sw_interface_admin_up_down_functions[VNET_ITF_FUNC_N_PRIO];
69d723161eSOle Troan    _vnet_interface_function_list_elt_t
70d723161eSOle Troan    * sw_interface_mtu_change_functions[VNET_ITF_FUNC_N_PRIO];
71cb9cadadSEd Warnicke
727be864adSDave Barach  uword *interface_tag_by_sw_if_index;
737be864adSDave Barach
74ba868bb7SDave Barach  /*
75cb9cadadSEd Warnicke   * Last "api" error, preserved so we can issue reasonable diagnostics
76cb9cadadSEd Warnicke   * at or near the top of the food chain
77cb9cadadSEd Warnicke   */
78cb9cadadSEd Warnicke  vnet_api_error_t api_errno;
79cb9cadadSEd Warnicke
80ba868bb7SDave Barach  vlib_main_t *vlib_main;
81cb9cadadSEd Warnicke} vnet_main_t;
82cb9cadadSEd Warnicke
8371612d61SDave Wallaceextern vnet_main_t vnet_main;
84cb9cadadSEd Warnicke
85cb9cadadSEd Warnicke#include <vnet/interface_funcs.h>
86cb9cadadSEd Warnicke#include <vnet/global_funcs.h>
87cb9cadadSEd Warnicke
88cb9cadadSEd Warnicke#endif /* included_vnet_vnet_h */
89ba868bb7SDave Barach
90ba868bb7SDave Barach/*
91ba868bb7SDave Barach * fd.io coding-style-patch-verification: ON
92ba868bb7SDave Barach *
93ba868bb7SDave Barach * Local Variables:
94ba868bb7SDave Barach * eval: (c-set-style "gnu")
95ba868bb7SDave Barach * End:
96ba868bb7SDave Barach */
97