Fix arp handling when master core is on socket 1
[samplevnf.git] / VNFs / DPPD-PROX / packet_utils.h
index 0017a89..74a3f60 100644 (file)
@@ -13,6 +13,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 */
+#ifndef _PACKET_UTILS_H_
+#define _PACKET_UTILS_H_
 
 #include "arp.h"
 #include "quit.h"
 #define FLAG_DST_MAC_KNOWN     1
 #define MAX_ARP_ENTRIES        65536
 
+#define IP4(x) x & 0xff, (x >> 8) & 0xff, (x >> 16) & 0xff, x >> 24
+enum {
+       SEND_MBUF_AND_ARP,
+       SEND_MBUF,
+       SEND_ARP,
+       DROP_MBUF
+};
+
 struct task_base;
 struct task_args;
 struct arp_table {
@@ -44,6 +54,7 @@ struct l3_base {
        struct arp_table optimized_arp_table[4];
        struct rte_hash *ip_hash;
        struct arp_table *arp_table;
+       struct rte_mempool *arp_pool;
 };
 
 void task_init_l3(struct task_base *tbase, struct task_args *targ);
@@ -52,3 +63,5 @@ int write_dst_mac(struct task_base *tbase, struct rte_mbuf *mbuf, uint32_t *ip_d
 void task_set_gateway_ip(struct task_base *tbase, uint32_t ip);
 void task_set_local_ip(struct task_base *tbase, uint32_t ip);
 void handle_ctrl_plane_pkts(struct task_base *tbase, struct rte_mbuf **mbufs, uint16_t n_pkts);
+
+#endif /* _PACKET_UTILS_H_ */