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#ifndef _ISIS_IP_H_
17#define _ISIS_IP_H_
18
19#ifdef __cplusplus
20extern "C" {
21#endif                          /* __cplusplus */
22
23#include "fal/fal_ip.h"
24
25    sw_error_t isis_ip_init(a_uint32_t dev_id);
26
27    sw_error_t isis_ip_reset(a_uint32_t dev_id);
28
29#ifdef IN_IP
30#define ISIS_IP_INIT(rv, dev_id) \
31    { \
32        rv = isis_ip_init(dev_id); \
33        SW_RTN_ON_ERROR(rv); \
34    }
35
36#define ISIS_IP_RESET(rv, dev_id) \
37    { \
38        rv = isis_ip_reset(dev_id); \
39        SW_RTN_ON_ERROR(rv); \
40    }
41#else
42#define ISIS_IP_INIT(rv, dev_id)
43#define ISIS_IP_RESET(rv, dev_id)
44#endif
45
46#ifdef HSL_STANDALONG
47
48    HSL_LOCAL sw_error_t
49    isis_ip_host_add(a_uint32_t dev_id, fal_host_entry_t * host_entry);
50
51    HSL_LOCAL sw_error_t
52    isis_ip_intf_entry_add(a_uint32_t dev_id, fal_intf_mac_entry_t * entry);
53
54    HSL_LOCAL sw_error_t
55    isis_ip_host_del(a_uint32_t dev_id, a_uint32_t del_mode,
56                     fal_host_entry_t * host_entry);
57
58    HSL_LOCAL sw_error_t
59    isis_ip_host_get(a_uint32_t dev_id, a_uint32_t get_mode,
60                     fal_host_entry_t * host_entry);
61
62    HSL_LOCAL sw_error_t
63    isis_ip_host_next(a_uint32_t dev_id, a_uint32_t next_mode,
64                      fal_host_entry_t * host_entry);
65
66    HSL_LOCAL sw_error_t
67    isis_ip_host_counter_bind(a_uint32_t dev_id, a_uint32_t entry_id,
68                              a_uint32_t cnt_id, a_bool_t enable);
69
70    HSL_LOCAL sw_error_t
71    isis_ip_host_pppoe_bind(a_uint32_t dev_id, a_uint32_t entry_id,
72                            a_uint32_t pppoe_id, a_bool_t enable);
73
74    HSL_LOCAL sw_error_t
75    isis_ip_pt_arp_learn_set(a_uint32_t dev_id, fal_port_t port_id,
76                             a_uint32_t flags);
77
78    HSL_LOCAL sw_error_t
79    isis_ip_pt_arp_learn_get(a_uint32_t dev_id, fal_port_t port_id,
80                             a_uint32_t * flags);
81
82    HSL_LOCAL sw_error_t
83    isis_ip_arp_learn_set(a_uint32_t dev_id, fal_arp_learn_mode_t mode);
84
85    HSL_LOCAL sw_error_t
86    isis_ip_arp_learn_get(a_uint32_t dev_id, fal_arp_learn_mode_t * mode);
87
88    HSL_LOCAL sw_error_t
89    isis_ip_source_guard_set(a_uint32_t dev_id, fal_port_t port_id,
90                             fal_source_guard_mode_t mode);
91
92    HSL_LOCAL sw_error_t
93    isis_ip_source_guard_get(a_uint32_t dev_id, fal_port_t port_id,
94                             fal_source_guard_mode_t * mode);
95
96    HSL_LOCAL sw_error_t
97    isis_ip_unk_source_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd);
98
99    HSL_LOCAL sw_error_t
100    isis_ip_unk_source_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd);
101
102    HSL_LOCAL sw_error_t
103    isis_ip_arp_guard_set(a_uint32_t dev_id, fal_port_t port_id,
104                          fal_source_guard_mode_t mode);
105
106    HSL_LOCAL sw_error_t
107    isis_ip_arp_guard_get(a_uint32_t dev_id, fal_port_t port_id,
108                          fal_source_guard_mode_t * mode);
109
110    HSL_LOCAL sw_error_t
111    isis_arp_unk_source_cmd_set(a_uint32_t dev_id, fal_fwd_cmd_t cmd);
112
113    HSL_LOCAL sw_error_t
114    isis_arp_unk_source_cmd_get(a_uint32_t dev_id, fal_fwd_cmd_t * cmd);
115
116    HSL_LOCAL sw_error_t
117    isis_ip_route_status_set(a_uint32_t dev_id, a_bool_t enable);
118
119    HSL_LOCAL sw_error_t
120    isis_ip_route_status_get(a_uint32_t dev_id, a_bool_t * enable);
121
122    HSL_LOCAL sw_error_t
123    isis_ip_intf_entry_del(a_uint32_t dev_id, a_uint32_t del_mode,
124                           fal_intf_mac_entry_t * entry);
125
126    HSL_LOCAL sw_error_t
127    isis_ip_intf_entry_next(a_uint32_t dev_id, a_uint32_t next_mode,
128                            fal_intf_mac_entry_t * entry);
129
130    HSL_LOCAL sw_error_t
131    isis_ip_age_time_set(a_uint32_t dev_id, a_uint32_t * time);
132
133    HSL_LOCAL sw_error_t
134    isis_ip_age_time_get(a_uint32_t dev_id, a_uint32_t * time);
135
136    HSL_LOCAL sw_error_t
137    isis_ip_wcmp_entry_set(a_uint32_t dev_id, a_uint32_t wcmp_id, fal_ip_wcmp_t * wcmp);
138
139    HSL_LOCAL sw_error_t
140    isis_ip_wcmp_entry_get(a_uint32_t dev_id, a_uint32_t wcmp_id, fal_ip_wcmp_t * wcmp);
141
142    HSL_LOCAL sw_error_t
143    isis_ip_wcmp_hash_mode_set(a_uint32_t dev_id, a_uint32_t hash_mode);
144
145    HSL_LOCAL sw_error_t
146    isis_ip_wcmp_hash_mode_get(a_uint32_t dev_id, a_uint32_t * hash_mode);
147
148#endif
149
150#ifdef __cplusplus
151}
152#endif                          /* __cplusplus */
153#endif                          /* _ISIS_IP_H_ */
154