Commit 8cffa02f authored by Franck Messaoudi's avatar Franck Messaoudi

Update: folloow up to the update of the code base

parent 0c7ccbcb
#ifndef __ARP_TABLE_H__
#define __ARP_TABLE_H__
#include <types.h>
//#include <stdint.h>
struct s_arp_mapping {
uint8_t mac_address[6];
uint32_t ipv4_address;
};
#endif // __ARP_TABLE_H__
\ No newline at end of file
#ifndef __FAR_MAPS_H__
#define __FAR_MAPS_H__
#include <bpf_helpers.h>
#include <linux/bpf.h>
#include <pfcp/pfcp_far.h>
#include <types.h>
#include "arp_table.h"
#define ARP_ENTRIES_MAX_SIZE 10000
#define FAR_TAILS_MAX 20
#define MAX_INTERFACES 10
#define MAX_FAR_PROGRAMS 10000
/*---------------------------------------------------------------------------------------------------------------*/
struct {
__uint(type, BPF_MAP_TYPE_DEVMAP);
__uint(max_entries, MAX_INTERFACES);
__type(key, u32); // id
__type(value, u32); // tx port
} m_redirect_interfaces SEC(".maps");
/*---------------------------------------------------------------------------------------------------------------*/
struct {
__uint(type, BPF_MAP_TYPE_HASH);
__uint(max_entries, ARP_ENTRIES_MAX_SIZE);
__type(key, u32); // IPv4 address
__type(value, struct s_arp_mapping); // <IP Address, MAC address>
} m_arp_table SEC(".maps");
/*---------------------------------------------------------------------------------------------------------------*/
#endif // __FAR_MAPS_H__
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment