4 * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef __INCLUDE_PIPELINE_ROUTING_BE_H__
35 #define __INCLUDE_PIPELINE_ROUTING_BE_H__
37 #include <rte_ether.h>
39 #include "pipeline_common_be.h"
44 enum pipeline_routing_route_key_type {
45 PIPELINE_ROUTING_ROUTE_IPV4,
48 struct pipeline_routing_route_key_ipv4 {
53 struct pipeline_routing_route_key {
54 enum pipeline_routing_route_key_type type;
56 struct pipeline_routing_route_key_ipv4 ipv4;
60 enum pipeline_routing_route_flags {
61 PIPELINE_ROUTING_ROUTE_LOCAL = 1 << 0, /* 0 = remote; 1 = local */
67 enum pipeline_routing_arp_key_type {
68 PIPELINE_ROUTING_ARP_IPV4,
71 struct pipeline_routing_arp_key_ipv4 {
76 struct pipeline_routing_arp_key {
77 enum pipeline_routing_arp_key_type type;
79 struct pipeline_routing_arp_key_ipv4 ipv4;
86 enum pipeline_routing_msg_req_type {
87 PIPELINE_ROUTING_MSG_REQ_ROUTE_ADD,
88 PIPELINE_ROUTING_MSG_REQ_ROUTE_DEL,
89 PIPELINE_ROUTING_MSG_REQ_ROUTE_ADD_DEFAULT,
90 PIPELINE_ROUTING_MSG_REQ_ROUTE_DEL_DEFAULT,
91 PIPELINE_ROUTING_MSG_REQ_ARP_ADD,
92 PIPELINE_ROUTING_MSG_REQ_ARP_DEL,
93 PIPELINE_ROUTING_MSG_REQ_ARP_ADD_DEFAULT,
94 PIPELINE_ROUTING_MSG_REQ_ARP_DEL_DEFAULT,
95 PIPELINE_ROUTING_MSG_REQS
101 struct pipeline_routing_route_add_msg_req {
102 enum pipeline_msg_req_type type;
103 enum pipeline_routing_msg_req_type subtype;
106 struct pipeline_routing_route_key key;
110 uint32_t port_id; /* Output port ID */
111 uint32_t ip; /* Next hop IP address (only valid for remote routes) */
114 struct pipeline_routing_route_add_msg_rsp {
123 struct pipeline_routing_route_delete_msg_req {
124 enum pipeline_msg_req_type type;
125 enum pipeline_routing_msg_req_type subtype;
128 struct pipeline_routing_route_key key;
131 struct pipeline_routing_route_delete_msg_rsp {
137 * MSG ROUTE ADD DEFAULT
139 struct pipeline_routing_route_add_default_msg_req {
140 enum pipeline_msg_req_type type;
141 enum pipeline_routing_msg_req_type subtype;
147 struct pipeline_routing_route_add_default_msg_rsp {
153 * MSG ROUTE DELETE DEFAULT
155 struct pipeline_routing_route_delete_default_msg_req {
156 enum pipeline_msg_req_type type;
157 enum pipeline_routing_msg_req_type subtype;
160 struct pipeline_routing_route_delete_default_msg_rsp {
167 struct pipeline_routing_arp_add_msg_req {
168 enum pipeline_msg_req_type type;
169 enum pipeline_routing_msg_req_type subtype;
172 struct pipeline_routing_arp_key key;
175 struct ether_addr macaddr;
178 struct pipeline_routing_arp_add_msg_rsp {
187 struct pipeline_routing_arp_delete_msg_req {
188 enum pipeline_msg_req_type type;
189 enum pipeline_routing_msg_req_type subtype;
192 struct pipeline_routing_arp_key key;
195 struct pipeline_routing_arp_delete_msg_rsp {
201 * MSG ARP ADD DEFAULT
203 struct pipeline_routing_arp_add_default_msg_req {
204 enum pipeline_msg_req_type type;
205 enum pipeline_routing_msg_req_type subtype;
211 struct pipeline_routing_arp_add_default_msg_rsp {
217 * MSG ARP DELETE DEFAULT
219 struct pipeline_routing_arp_delete_default_msg_req {
220 enum pipeline_msg_req_type type;
221 enum pipeline_routing_msg_req_type subtype;
224 struct pipeline_routing_arp_delete_default_msg_rsp {
228 extern struct pipeline_be_ops pipeline_routing_be_ops;