Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.4.4.5
openapi_if.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2016-2018 Broadcom.
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 * Licensed under the Apache License, Version 2.0 (the "License");
26 * you may not use this file except in compliance with the License.
27 * You may obtain a copy of the License at
28 *
29 * http://www.apache.org/licenses/LICENSE-2.0
30 *
31 * Unless required by applicable law or agreed to in writing, software
32 * distributed under the License is distributed on an "AS IS" BASIS,
33 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34 * See the License for the specific language governing permissions and
35 * limitations under the License.
36 *
37 **********************************************************************
38 *
39 * @filename openapi_if.h
40 *
41 * @purpose Interface Configuration and Status
42 *
43 * @component OPEN
44 *
45 * @create 10/23/2012
46 *
47 * @end
48 *
49 **********************************************************************/
50 #ifndef OPENAPI_IF_H_INCLUDED
51 #define OPENAPI_IF_H_INCLUDED
52 
53 #include "openapi_common.h"
54 
55 typedef enum
56 {
57  OPEN_PHY_CAP_PORTSPEED_HALF_10 = 0x000000001,
58  OPEN_PHY_CAP_PORTSPEED_FULL_10 = 0x000000002,
59  OPEN_PHY_CAP_PORTSPEED_HALF_100 = 0x000000004,
60  OPEN_PHY_CAP_PORTSPEED_FULL_100 = 0x000000008,
61  OPEN_PHY_CAP_PORTSPEED_HALF_1000 = 0x000000010,
62  OPEN_PHY_CAP_PORTSPEED_FULL_1000 = 0x000000020,
63  OPEN_PHY_CAP_PORTSPEED_FULL_2P5G = 0x000000040,
64  OPEN_PHY_CAP_PORTSPEED_FULL_5G = 0x000000080,
65  OPEN_PHY_CAP_PORTSPEED_FULL_10G = 0x000000100,
66  OPEN_PHY_CAP_PORTSPEED_AUTO_NEG = 0x000000400,
67  OPEN_PHY_CAP_PORTSPEED_SFP = 0x000000800,
68  OPEN_PHY_CAP_PORTSPEED_SFP_DETECT = 0x000001000,
69  OPEN_PHY_CAP_POE_PSE = 0x000002000,
70  OPEN_PHY_CAP_POE_PD = 0x000004000,
71  OPEN_PHY_CAP_INTERNAL = 0x000008000, /* Indicates a blade switch internal port */
72  OPEN_PHY_CAP_NATIVE_EEE = 0x000010000,
73  OPEN_PHY_CAP_AUTO_EEE = 0x000020000,
74  OPEN_PHY_CAP_DUAL_MODE_SUPPORT = 0x000040000, /* Used represent PHYs where phy/port capabilities change
75  dynamically(ex: SFP support in 10G fiber port, Combo port where two phys
76  are used one for fiber, one for copper)*/
77  OPEN_PHY_CAP_POE_PSE_PLUS = 0x000080000,
78  OPEN_PHY_CAP_POE_PD_PLUS = 0x000100000,
79  OPEN_PHY_CAP_ENERGY_DETECT = 0x000200000,
80  OPEN_PHY_CAP_COMBO_PREFERENCE = 0x000400000, /* If the port is a combo port *and* the preferred media can be configured. */
81  OPEN_PHY_CAP_EXPANDABLE_PORT = 0x000800000,
82  OPEN_PHY_CAP_AUTO_CONFIG = 0x001000000,
83  OPEN_PHY_CAP_SHORT_REACH = 0x002000000,
84  OPEN_PHY_CAP_UPOE_PSE = 0x004000000, /* UPOE capability bits */
85  OPEN_PHY_CAP_UPOE_PD = 0x008000000,
86  OPEN_PHY_CAP_DYNAMIC_PORT = 0x010000000, /* This should be used instead of DUAL_MODE */
87  OPEN_PHY_CAP_FIXED_STACK_PORT = 0x020000000,
88 
89  OPEN_PHY_CAP_FEC_SUPPORT = 0x040000000,
90  OPEN_PHY_CAP_PORTSPEED_FULL_20G = 0x080000000,
91  OPEN_PHY_CAP_PORTSPEED_FULL_25G = 0x081000000,
92  OPEN_PHY_CAP_PORTSPEED_FULL_40G = 0x082000000,
93  OPEN_PHY_CAP_PORTSPEED_FULL_50G = 0x084000000,
94  OPEN_PHY_CAP_PORTSPEED_FULL_100G = 0x088000000,
95 /* Add support for 64-Bit. Commenting for now, to be fixed by UI team. overlapping values need to removed
96  pls check commdefs.h
97  OPEN_PHY_CAP_PORTSPEED_FULL_25G = 0x100000000ULL,
98  OPEN_PHY_CAP_PORTSPEED_FULL_40G = 0x200000000ULL,
99  OPEN_PHY_CAP_PORTSPEED_FULL_50G = 0x400000000ULL,
100  OPEN_PHY_CAP_PORTSPEED_FULL_100G = 0x800000000ULL,
101  OPEN_PHY_CAP_PORTSPEED_FULL_200G = 0x1000000000ULL,
102  OPEN_PHY_CAP_PORTSPEED_FULL_400G = 0x2000000000ULL,
103 */
104  /* Add new caps below */
105 
106 } OPEN_PHY_CAPABILITIES_t;
107 
108 typedef enum
109 {
110  OPEN_PORTCTRL_PORTSPEED_AUTO_NEG = 1,
111  OPEN_PORTCTRL_PORTSPEED_HALF_100TX = 2,
112  OPEN_PORTCTRL_PORTSPEED_FULL_100TX = 3,
113  OPEN_PORTCTRL_PORTSPEED_HALF_10T = 4,
114  OPEN_PORTCTRL_PORTSPEED_FULL_10T = 5,
115  OPEN_PORTCTRL_PORTSPEED_FULL_100FX = 6,
116  OPEN_PORTCTRL_PORTSPEED_FULL_1000SX = 7,
117  OPEN_PORTCTRL_PORTSPEED_FULL_10GSX = 8,
118  OPEN_PORTCTRL_PORTSPEED_FULL_20GSX = 9,
119  OPEN_PORTCTRL_PORTSPEED_FULL_40GSX = 10,
120  OPEN_PORTCTRL_PORTSPEED_FULL_25GSX = 11,
121  OPEN_PORTCTRL_PORTSPEED_FULL_50GSX = 12,
122  OPEN_PORTCTRL_PORTSPEED_FULL_100GSX = 13,
123  OPEN_PORTCTRL_PORTSPEED_AAL5_155 = 14,
124  OPEN_PORTCTRL_PORTSPEED_FULL_5FX = 15,
125  OPEN_PORTCTRL_PORTSPEED_FULL_200GSX = 16,
126  OPEN_PORTCTRL_PORTSPEED_FULL_400GSX = 17,
127  OPEN_PORTCTRL_PORTSPEED_FULL_2P5FX = 128, /* Speed 2.5G FD, Bit 7th set */
128  OPEN_PORTCTRL_PORTSPEED_LAG = 129,
129  OPEN_PORTCTRL_PORTSPEED_UNKNOWN = 130
130 } OPEN_PORT_SPEEDS_t;
131 
134 typedef enum
135 {
136  OPEN_DISABLE_REASON_NONE = 1,
137  OPEN_DISABLE_REASON_UDLD = 2,
138  OPEN_DISABLE_REASON_STP = 3,
139  OPEN_DISABLE_REASON_BPDUGUARD = 4,
140  OPEN_DISABLE_REASON_BPDUSTORM = 5,
141  OPEN_DISABLE_REASON_DHCPSNOOPING = 6,
142  OPEN_DISABLE_REASON_ARPINSPECTION = 7,
143  OPEN_DISABLE_REASON_STORMCONTROL_BCAST = 8,
144  OPEN_DISABLE_REASON_STORMCONTROL_MCAST = 9,
145  OPEN_DISABLE_REASON_STORMCONTROL_UCAST = 10,
146  OPEN_DISABLE_REASON_XCEIVER = 11,
147  OPEN_DISABLE_REASON_XCEIVERPLUS = 12,
148  OPEN_DISABLE_REASON_LOOPPROTECT = 13,
149  OPEN_DISABLE_REASON_PML = 14,
150  OPEN_DISABLE_REASON_DOS = 15,
151  OPEN_DISABLE_REASON_LINK_FLAP = 16,
152  OPEN_DISABLE_REASON_AUTHMGR_AUTH_VIOLATION = 17
154 
157 typedef enum
158 {
159  OPEN_PORT_CABLE_MEDIA_TYPE_NONE = 0,
160  OPEN_PORT_CABLE_MEDIA_TYPE_COPPER = 1,
161  OPEN_PORT_CABLE_MEDIA_TYPE_FIBER = 2,
163 
167 typedef enum
168 {
169  OPEN_SPECIAL_PORT_TYPE_NORMAL = 1,
170  OPEN_SPECIAL_PORT_TYPE_TRUNK_MEMBER = 2,
171  OPEN_SPECIAL_PORT_TYPE_MIRRORED_PORT = 3,
172  OPEN_SPECIAL_PORT_TYPE_PROBE_PORT = 4,
173  OPEN_SPECIAL_PORT_TYPE_L2TUNNEL_PORT = 5,
174  OPEN_SPECIAL_PORT_TYPE_SERVICE_PORT = 6
176 
177 typedef enum
178 {
179  OPEN_PORT_DUPLEX_HALF = 0,
180  OPEN_PORT_DUPLEX_FULL = 1,
181  OPEN_PORT_DUPLEX_UNKNOWN = 0xffff
182 
183 } OPEN_PORT_DUPLEX_t;
184 
185 typedef enum
186 {
187  OPEN_PORT_AUTO_NEG_ENABLE = 0,
188  OPEN_PORT_AUTO_NEG_DISABLE = 1,
189  OPEN_PORT_AUTO_NEG_UNKNOWN = 0xffff
190 
191 } OPEN_PORT_AUTO_NEG_t;
192 
193 #define OPENAPI_INTERFACE_NAME_LENGTH 60
194 
195 /******************************************************************************/
211  uint32_t ifNum, OPEN_PORT_SPEEDS_t * speed);
212 
213 /*****************************************************************/
230  uint32_t ifNum, OPEN_PORT_SPEEDS_t speed);
231 
232 
233 /*****************************************************************/
251  uint32_t ifNum, OPEN_PORT_DUPLEX_t * duplex_mode);
252 
253 /*****************************************************************/
268  uint32_t ifNum, OPEN_PORT_AUTO_NEG_t * autoneg);
269 
270 /*****************************************************************/
288  uint32_t ifNum, uint32_t autoneg);
289 
290 /*****************************************************************/
305  uint32_t ifNum, uint32_t *headerSize);
306 
307 /*****************************************************************/
322  uint32_t ifNum, uint32_t * mtu_size);
323 
324 /*****************************************************************/
346  uint32_t ifNum, uint32_t mtu_size);
347 
348 /*****************************************************************/
370  uint32_t ifNum,
371  uint32_t mtu_size);
372 
373 /*****************************************************************/
394  uint32_t ifNum, uint32_t maxFrameSize);
395 
396 /*****************************************************************/
411  uint32_t ifNum, uint32_t *maxFrameSize);
412 
413 /*****************************************************************************************/
434  client_handle, uint32_t ifNum,
435  OPEN_CONTROL_t * soft_shut);
436 
437 /************************************************************************************/
459  client_handle, uint32_t ifNum,
460  OPEN_CONTROL_t soft_shut);
461 
462 /*****************************************************************/
477  uint32_t ifNum, uint32_t * size);
478 
479 
480 /*****************************************************************/
497  uint32_t ifNum, open_buffdesc * mac_addr);
498 
499 /*****************************************************************/
514  uint32_t ifNum, uint32_t* size);
515 
516 
517 /*****************************************************************/
533  uint32_t ifNum, open_buffdesc * descrip);
534 
535 /*****************************************************************/
553  uint32_t ifNum, open_buffdesc * descrip);
554 
555 /*****************************************************************/
572  uint32_t ifNum,
573  OPEN_CONTROL_t adminState);
574 
575 /*****************************************************************/
591  OPEN_INTF_TYPE_t ifType,
592  uint32_t *firstIfNum);
593 
594 /*****************************************************************/
614  OPEN_INTF_TYPE_t ifType,
615  uint32_t ifNum,
616  uint32_t *nextIfNum);
617 
618 /*****************************************************************/
633  uint32_t ifNum,
634  OPEN_LINK_STATE_t *linkState);
635 
636 /*****************************************************************/
651  uint32_t ifNum,
652  OPEN_CONTROL_t *adminState);
653 
654 /*****************************************************************/
671  uint32_t intf,
672  open_buffdesc *intfName);
673 
674 /*****************************************************************/
690  open_buffdesc *intfName, uint32_t *ifNum );
691 
692 /*****************************************************************/
710  uint32_t ifNum,
711  uint32_t *nextIfNum,
712  uint32_t *delete_pending);
713 
714 /*****************************************************************/
730  uint32_t ifNum,
731  OPEN_INTF_TYPE_t *ifType);
732 
733 /*****************************************************************/
748  uint32_t interface, uint32_t *value);
749 
750 /*****************************************************************/
766  uint32_t interface, uint32_t *value);
767 
768 /*****************************************************************/
787  uint32_t interface, uint32_t *value);
788 
789 /*****************************************************************/
807  uint32_t interface, uint32_t *value);
808 
809 /*****************************************************************/
824  uint32_t interface, uint32_t *value);
825 
826 /*****************************************************************/
842  uint32_t interface, uint32_t *value);
843 
844 /*****************************************************************/
860  uint32_t interface, uint32_t *value);
861 
862 /*****************************************************************/
884  uint32_t interface, uint32_t *value);
885 
886 /*****************************************************************/
905  uint32_t interface, uint32_t *value);
906 
907 /*****************************************************************/
923  uint32_t interface, uint32_t *value);
924 
925 /******************************************************************************/
942  uint32_t ifNum, OPEN_PORT_SPEEDS_t *speed);
943 
944 
945 /*****************************************************************/
963  uint32_t ifNum, OPEN_PORT_DUPLEX_t *duplex_mode);
964 
965 /*****************************************************************/
983  uint32_t ifNum, uint64_t *portCapability);
984 
985 /*****************************************************************/
1002  uint32_t ifNum,
1003  OPEN_DISABLE_REASON_t *reason);
1004 
1005 /*****************************************************************/
1025  uint32_t ifNum,
1026  uint32_t *rootSlot,
1027  uint32_t *rootPort);
1028 
1029 /*****************************************************************/
1047  uint32_t ifNum,
1048  uint32_t *laneCount);
1049 
1050 /*****************************************************************/
1068  uint32_t ifNum,
1069  uint32_t *peerIfNum);
1070 
1071 /*****************************************************************/
1089  uint32_t ifNum,
1090  uint32_t *laneCount);
1091 
1092 /*****************************************************************/
1120  uint32_t ifNum,
1121  OPEN_PORT_CABLE_MEDIA_TYPE_t *mediaType);
1122 
1123 /*****************************************************************/
1150  uint32_t ifNum,
1151  OPEN_BOOL_t *rxPauseAllowed,
1152  OPEN_BOOL_t *txPauseAllowed);
1153 
1154 /*****************************************************************/
1177  uint32_t ifNum,
1178  OPEN_SPECIAL_PORT_TYPE_t *specialType);
1179 
1180 #endif /* OPENAPI_IF_H_INCLUDED */
1181