OpenNSL API Guide and Reference Manual
trunk.h
Go to the documentation of this file.
1 
4 /*****************************************************************************
5  *
6  * (C) Copyright Broadcom Corporation 2013-2016
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  *
11  * You may obtain a copy of the License at
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  ***************************************************************************/
24 #ifndef __OPENNSL_TRUNK_H__
25 #define __OPENNSL_TRUNK_H__
26 
27 #include <opennsl/types.h>
28 
29 #define OPENNSL_TRUNK_MAX_PORTCNT 256
31 #define OPENNSL_TRUNK_UNSPEC_INDEX -1
32 #define OPENNSL_TRUNK_PSC_SRCDSTMAC 3
33 #define OPENNSL_TRUNK_PSC_DSTIP 5
34 #define OPENNSL_TRUNK_PSC_SRCDSTIP 6
35 #define OPENNSL_TRUNK_PSC_PORTFLOW 9
36 #define OPENNSL_TRUNK_FLAG_FAILOVER_NEXT 0x0001
39 #define OPENNSL_TRUNK_FLAG_FAILOVER_NEXT_LOCAL 0x0002
43 #define OPENNSL_TRUNK_FLAG_FAILOVER OPENNSL_TRUNK_FLAG_FAILOVER_NEXT_LOCAL
45 #define OPENNSL_TRUNK_FLAG_WITH_ID 0x0010
47 #define OPENNSL_TRUNK_FLAG_IPMC_CLEAVE 0x0020
50 #define OPENNSL_TRUNK_MEMBER_EGRESS_DISABLE 0x0002
55 typedef struct opennsl_trunk_info_s {
56  int psc;
57  int dlf_index;
58  int mc_index;
59  int ipmc_index;
61 /* __doxy_func_body_end__ */
62 
64 typedef struct opennsl_trunk_chip_info_s {
74  int vp_id_min;
75  int vp_id_max;
79 /* __doxy_func_body_end__ */
80 
82 typedef struct opennsl_trunk_member_s {
85  int reserved1;
86  int reserved2;
87  int reserved3;
89 /* __doxy_func_body_end__ */
90 
91 /***************************************************************************/
101 extern void opennsl_trunk_info_t_init(
103 
104 /***************************************************************************/
114 extern void opennsl_trunk_member_t_init(
116 
117 #ifndef OPENNSL_HIDE_DISPATCHABLE
118 
119 /***************************************************************************/
131 extern int opennsl_trunk_init(
132  int unit) LIB_DLL_EXPORTED ;
133 
134 /***************************************************************************/
144 extern int opennsl_trunk_detach(
145  int unit) LIB_DLL_EXPORTED ;
146 
147 /***************************************************************************/
171 extern int opennsl_trunk_create(
172  int unit,
173  uint32 flags,
175 
176 /***************************************************************************/
192 extern int opennsl_trunk_psc_set(
193  int unit,
194  opennsl_trunk_t tid,
195  int psc) LIB_DLL_EXPORTED ;
196 
197 /***************************************************************************/
211 extern int opennsl_trunk_chip_info_get(
212  int unit,
214 
215 /***************************************************************************/
238 extern int opennsl_trunk_get(
239  int unit,
240  opennsl_trunk_t tid,
241  opennsl_trunk_info_t *t_data,
242  int member_max,
243  opennsl_trunk_member_t *member_array,
244  int *member_count) LIB_DLL_EXPORTED ;
245 
246 /***************************************************************************/
268 extern int opennsl_trunk_set(
269  int unit,
270  opennsl_trunk_t tid,
271  opennsl_trunk_info_t *trunk_info,
272  int member_count,
274 
275 /***************************************************************************/
290 extern int opennsl_trunk_destroy(
291  int unit,
293 
294 #endif /* OPENNSL_HIDE_DISPATCHABLE */
295 
296 #ifndef OPENNSL_HIDE_DISPATCHABLE
297 
298 /***************************************************************************/
317 extern int opennsl_trunk_find(
318  int unit,
319  opennsl_module_t modid,
320  opennsl_gport_t gport,
322 
323 /***************************************************************************/
351 extern int opennsl_trunk_failover_set(
352  int unit,
353  opennsl_trunk_t tid,
354  opennsl_gport_t failport,
355  int psc,
356  uint32 flags,
357  int count,
358  opennsl_gport_t *fail_to_array) LIB_DLL_EXPORTED ;
359 
360 /***************************************************************************/
385 extern int opennsl_trunk_failover_get(
386  int unit,
387  opennsl_trunk_t tid,
388  opennsl_gport_t failport,
389  int *psc,
390  uint32 *flags,
391  int array_size,
392  opennsl_gport_t *fail_to_array,
393  int *array_count) LIB_DLL_EXPORTED ;
394 
395 /***************************************************************************/
410 extern int opennsl_trunk_member_add(
411  int unit,
412  opennsl_trunk_t tid,
414 
415 /***************************************************************************/
427 extern int opennsl_trunk_member_delete(
428  int unit,
429  opennsl_trunk_t tid,
431 
432 #endif /* OPENNSL_HIDE_DISPATCHABLE */
433 
434 #include <opennsl/trunkX.h>
435 #endif /* __OPENNSL_TRUNK_H__ */
436