2 // Copyright (c) 2010-2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
19 #include "prox_malloc.h"
24 #define FLAG_DST_MAC_KNOWN 1
25 #define MAX_ARP_ENTRIES 65536
30 uint64_t arp_update_time;
33 struct ether_addr mac;
36 struct rte_ring *ctrl_plane_ring;
37 struct task_base *tmaster;
40 uint8_t reachable_port_id;
44 struct arp_table optimized_arp_table[4];
45 struct rte_hash *ip_hash;
46 struct arp_table *arp_table;
49 void task_init_l3(struct task_base *tbase, struct task_args *targ);
50 void task_start_l3(struct task_base *tbase, struct task_args *targ);
51 int write_dst_mac(struct task_base *tbase, struct rte_mbuf *mbuf, uint32_t *ip_dst);
52 void task_set_gateway_ip(struct task_base *tbase, uint32_t ip);
53 void task_set_local_ip(struct task_base *tbase, uint32_t ip);
54 void handle_ctrl_plane_pkts(struct task_base *tbase, struct rte_mbuf **mbufs, uint16_t n_pkts);