API Reference Manual 1.51.0
Loading...
Searching...
No Matches
odp_l3fwd_db.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2016-2018 Linaro Limited
3 */
4
7#ifndef _ODP_L3FWD_DB_H_
8#define _ODP_L3FWD_DB_H_
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include <odp_api.h>
15#include <odp/helper/odph_api.h>
16
17#define OIF_LEN 32
18#define MAX_DB 32
19#define MAX_STRING 32
20
24#define FWD_MAX_FLOW_COUNT (1 << 22)
25
29#define FWD_DEF_BUCKET_ENTRIES 4
30
34typedef struct ip_addr_range_s {
35 uint32_t addr;
36 uint32_t depth;
37} ip_addr_range_t;
38
42typedef struct ODP_ALIGNED_CACHE ipv4_tuple5_s {
43 union {
44 struct {
45 int32_t src_ip;
46 int32_t dst_ip;
47 int16_t src_port;
48 int16_t dst_port;
49 int8_t proto;
50 int8_t pad1;
51 int16_t pad2;
52 };
53 struct {
54 int64_t hi64;
55 int64_t lo64;
56 };
57 };
58} ipv4_tuple5_t;
59
63typedef struct fwd_db_entry_s {
64 struct fwd_db_entry_s *next;
65 char oif[OIF_LEN];
66 int oif_id;
67 odph_ethaddr_t src_mac;
68 odph_ethaddr_t dst_mac;
69 ip_addr_range_t subnet;
70} fwd_db_entry_t;
71
75typedef struct fwd_db_s {
76 uint32_t index;
77 fwd_db_entry_t *list;
78 fwd_db_entry_t array[MAX_DB];
79} fwd_db_t;
80
82extern fwd_db_t *fwd_db;
83
87void init_fwd_db(void);
88
92void init_fwd_hash_cache(void);
93
105int create_fwd_db_entry(char *input, char **oif, uint8_t **dst_mac);
106
114void resolve_fwd_db(char *intf, int portid, uint8_t *mac);
115
121void dump_fwd_db_entry(fwd_db_entry_t *entry);
122
126void dump_fwd_db(void);
127
135fwd_db_entry_t *find_fwd_db_entry(ipv4_tuple5_t *key);
136
137#ifdef __cplusplus
138}
139#endif
140
141#endif
#define ODP_ALIGNED_CACHE
Defines type/struct/variable to be cache line size aligned.
The OpenDataPlane API.