1/*
2 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
3 * Permission to use, copy, modify, and/or distribute this software for
4 * any purpose with or without fee is hereby granted, provided that the
5 * above copyright notice and this permission notice appear in all copies.
6 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
12 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13 */
14
15
16/**
17 * @defgroup isis_fdb ISIS_FDB
18 * @{
19 */
20#ifndef _ISIS_FDB_H_
21#define _ISIS_FDB_H_
22
23#ifdef __cplusplus
24extern "C" {
25#endif                          /* __cplusplus */
26
27#include "fal/fal_fdb.h"
28
29    sw_error_t isis_fdb_init(a_uint32_t dev_id);
30
31#ifdef IN_FDB
32#define ISIS_FDB_INIT(rv, dev_id) \
33    { \
34        rv = isis_fdb_init(dev_id); \
35        SW_RTN_ON_ERROR(rv); \
36    }
37#else
38#define ISIS_FDB_INIT(rv, dev_id)
39#endif
40
41#ifdef HSL_STANDALONG
42
43    HSL_LOCAL sw_error_t
44    isis_fdb_add(a_uint32_t dev_id, const fal_fdb_entry_t * entry);
45
46    HSL_LOCAL sw_error_t
47    isis_fdb_find(a_uint32_t dev_id, fal_fdb_entry_t * entry);
48
49    HSL_LOCAL sw_error_t
50    isis_fdb_del_all(a_uint32_t dev_id, a_uint32_t flag);
51
52    HSL_LOCAL sw_error_t
53    isis_fdb_del_by_port(a_uint32_t dev_id, fal_port_t port_id,
54                         a_uint32_t flag);
55
56    HSL_LOCAL sw_error_t
57    isis_fdb_del_by_mac(a_uint32_t dev_id, const fal_fdb_entry_t * entry);
58
59    HSL_LOCAL sw_error_t
60    isis_fdb_extend_next(a_uint32_t dev_id, fal_fdb_op_t * op,
61                         fal_fdb_entry_t * entry);
62
63    HSL_LOCAL sw_error_t
64    isis_fdb_extend_first(a_uint32_t dev_id, fal_fdb_op_t * option,
65                          fal_fdb_entry_t * entry);
66
67    HSL_LOCAL sw_error_t
68    isis_fdb_transfer(a_uint32_t dev_id, fal_port_t old_port,
69                      fal_port_t new_port, a_uint32_t fid,
70                      fal_fdb_op_t * option);
71
72    HSL_LOCAL sw_error_t
73    isis_fdb_port_learn_set(a_uint32_t dev_id, fal_port_t port_id,
74                            a_bool_t enable);
75
76    HSL_LOCAL sw_error_t
77    isis_fdb_port_learn_get(a_uint32_t dev_id, fal_port_t port_id,
78                            a_bool_t * enable);
79
80    HSL_LOCAL sw_error_t
81    isis_fdb_age_ctrl_set(a_uint32_t dev_id, a_bool_t enable);
82
83    HSL_LOCAL sw_error_t
84    isis_fdb_age_ctrl_get(a_uint32_t dev_id, a_bool_t * enable);
85
86    HSL_LOCAL sw_error_t
87    isis_fdb_age_time_set(a_uint32_t dev_id, a_uint32_t * time);
88
89    HSL_LOCAL sw_error_t
90    isis_fdb_age_time_get(a_uint32_t dev_id, a_uint32_t * time);
91
92    HSL_LOCAL sw_error_t
93    isis_port_fdb_learn_limit_set(a_uint32_t dev_id, fal_port_t port_id,
94                                  a_bool_t enable, a_uint32_t cnt);
95
96    HSL_LOCAL sw_error_t
97    isis_port_fdb_learn_limit_get(a_uint32_t dev_id, fal_port_t port_id,
98                                  a_bool_t * enable, a_uint32_t * cnt);
99
100    HSL_LOCAL sw_error_t
101    isis_port_fdb_learn_exceed_cmd_set(a_uint32_t dev_id,
102                                       fal_port_t port_id,
103                                       fal_fwd_cmd_t cmd);
104
105    HSL_LOCAL sw_error_t
106    isis_port_fdb_learn_exceed_cmd_get(a_uint32_t dev_id,
107                                       fal_port_t port_id,
108                                       fal_fwd_cmd_t * cmd);
109
110    HSL_LOCAL sw_error_t
111    isis_fdb_learn_limit_set(a_uint32_t dev_id, a_bool_t enable,
112                             a_uint32_t cnt);
113
114    HSL_LOCAL sw_error_t
115    isis_fdb_learn_limit_get(a_uint32_t dev_id, a_bool_t * enable,
116                             a_uint32_t * cnt);
117
118    HSL_LOCAL sw_error_t
119    isis_fdb_learn_exceed_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd);
120
121    HSL_LOCAL sw_error_t
122    isis_fdb_learn_exceed_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd);
123
124    HSL_LOCAL sw_error_t
125    isis_fdb_resv_add(a_uint32_t dev_id, fal_fdb_entry_t * entry);
126
127    HSL_LOCAL sw_error_t
128    isis_fdb_resv_del(a_uint32_t dev_id, fal_fdb_entry_t * entry);
129
130    HSL_LOCAL sw_error_t
131    isis_fdb_resv_find(a_uint32_t dev_id, fal_fdb_entry_t * entry);
132
133    HSL_LOCAL sw_error_t
134    isis_fdb_resv_iterate(a_uint32_t dev_id, a_uint32_t * iterator,
135                          fal_fdb_entry_t * entry);
136
137    HSL_LOCAL sw_error_t
138    isis_fdb_port_learn_static_set(a_uint32_t dev_id, fal_port_t port_id,
139                                   a_bool_t enable);
140
141    HSL_LOCAL sw_error_t
142    isis_fdb_port_learn_static_get(a_uint32_t dev_id, fal_port_t port_id,
143                                   a_bool_t * enable);
144
145    HSL_LOCAL sw_error_t
146    isis_fdb_port_add(a_uint32_t dev_id, a_uint32_t fid, fal_mac_addr_t * addr, fal_port_t port_id);
147
148    HSL_LOCAL sw_error_t
149    isis_fdb_port_del(a_uint32_t dev_id, a_uint32_t fid, fal_mac_addr_t * addr, fal_port_t port_id);
150
151
152#endif
153
154#ifdef __cplusplus
155}
156#endif                          /* __cplusplus */
157#endif                          /* _ISIS_FDB_H_ */
158
159/**
160 * @}
161 */
162
163