span: add feature (rx only) (VPP-185)
[vpp.git] / vnet / vnet / devices / devices.c
1 /*
2  * Copyright (c) 2015 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:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15
16 #include <vnet/devices/devices.h>
17 #include <vnet/feature/feature.h>
18
19 static uword
20 device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
21                  vlib_frame_t * frame)
22 {
23   return 0;
24 }
25
26 /* *INDENT-OFF* */
27 VLIB_REGISTER_NODE (device_input_node) = {
28   .function = device_input_fn,
29   .name = "device-input",
30   .type = VLIB_NODE_TYPE_INPUT,
31   .state = VLIB_NODE_STATE_DISABLED,
32   .n_next_nodes = VNET_DEVICE_INPUT_N_NEXT_NODES,
33   .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES,
34 };
35
36 VNET_FEATURE_ARC_INIT (device_input, static) =
37 {
38   .arc_name  = "device-input",
39   .start_nodes = VNET_FEATURES ("device-input"),
40   .arc_index_ptr = &feature_main.device_input_feature_arc_index,
41 };
42
43 VNET_FEATURE_INIT (l2_patch, static) = {
44   .arc_name = "device-input",
45   .node_name = "l2-patch",
46   .runs_before = VNET_FEATURES ("ethernet-input"),
47 };
48
49 VNET_FEATURE_INIT (worker_handoff, static) = {
50   .arc_name = "device-input",
51   .node_name = "worker-handoff",
52   .runs_before = VNET_FEATURES ("ethernet-input"),
53 };
54
55 VNET_FEATURE_INIT (span_input, static) = {
56   .arc_name = "device-input",
57   .node_name = "span-input",
58   .runs_before = VNET_FEATURES ("ethernet-input"),
59 };
60
61 VNET_FEATURE_INIT (ethernet_input, static) = {
62   .arc_name = "device-input",
63   .node_name = "ethernet-input",
64   .runs_before = 0, /* not before any other features */
65 };
66 /* *INDENT-ON* */
67
68 /*
69  * fd.io coding-style-patch-verification: ON
70  *
71  * Local Variables:
72  * eval: (c-set-style "gnu")
73  * End:
74  */