Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.12.0.1
openapi_diffserv_class_conf.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2023 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 **********************************************************************
26 *
27 * @filename openapi_diffserv_class_conf.h
28 *
29 * @purpose DiffServ Class Configuration and Status
30 *
31 * @component OpEN
32 *
33 * @create 17/05/2023
34 *
35 * @end
36 *
37 **********************************************************************/
38 #ifndef OPENAPI_DIFFSERV_CLASS_CONF_H_INCLUDED
39 #define OPENAPI_DIFFSERV_CLASS_CONF_H_INCLUDED
40 
41 #include "openapi_common.h"
42 #include "openapi_routing.h"
43 
45 typedef enum
46 {
51 
53 typedef enum
54 {
59 
61 typedef enum
62 {
91 
93 typedef enum
94 {
110 
111 #define OPEN_DIFFSERV_CLASS_NAME_MAX 31
112 #define OPEN_RULE_VAL_MAX_STRING_LENGTH 129
113 
114 /* User Keyword Translations for Layer 4 Port Numbers */
115 #define OPEN_DIFFSERV_LAYER_4_PORT_NUM_DOMAIN 53
116 #define OPEN_DIFFSERV_LAYER_4_PORT_NUM_ECHO 7
117 #define OPEN_DIFFSERV_LAYER_4_PORT_NUM_FTP 21
118 #define OPEN_DIFFSERV_LAYER_4_PORT_NUM_FTPDATA 20
119 #define OPEN_DIFFSERV_LAYER_4_PORT_NUM_HTTP 80
120 #define OPEN_DIFFSERV_LAYER_4_PORT_NUM_SMTP 25
121 #define OPEN_DIFFSERV_LAYER_4_PORT_NUM_SNMP 161
122 #define OPEN_DIFFSERV_LAYER_4_PORT_NUM_TELNET 23
123 #define OPEN_DIFFSERV_LAYER_4_PORT_NUM_TFTP 69
124 #define OPEN_DIFFSERV_LAYER_4_PORT_NUM_WWW 80
125 
126 /* User Keyword Translations for IP DSCP Values */
127 #define OPEN_DIFFSERV_IP_DSCP_AF11 10
128 #define OPEN_DIFFSERV_IP_DSCP_AF12 12
129 #define OPEN_DIFFSERV_IP_DSCP_AF13 14
130 #define OPEN_DIFFSERV_IP_DSCP_AF21 18
131 #define OPEN_DIFFSERV_IP_DSCP_AF22 20
132 #define OPEN_DIFFSERV_IP_DSCP_AF23 22
133 #define OPEN_DIFFSERV_IP_DSCP_AF31 26
134 #define OPEN_DIFFSERV_IP_DSCP_AF32 28
135 #define OPEN_DIFFSERV_IP_DSCP_AF33 30
136 #define OPEN_DIFFSERV_IP_DSCP_AF41 34
137 #define OPEN_DIFFSERV_IP_DSCP_AF42 36
138 #define OPEN_DIFFSERV_IP_DSCP_AF43 38
139 #define OPEN_DIFFSERV_IP_DSCP_BE 0
140 #define OPEN_DIFFSERV_IP_DSCP_CS0 0
141 #define OPEN_DIFFSERV_IP_DSCP_CS1 8
142 #define OPEN_DIFFSERV_IP_DSCP_CS2 16
143 #define OPEN_DIFFSERV_IP_DSCP_CS3 24
144 #define OPEN_DIFFSERV_IP_DSCP_CS4 32
145 #define OPEN_DIFFSERV_IP_DSCP_CS5 40
146 #define OPEN_DIFFSERV_IP_DSCP_CS6 48
147 #define OPEN_DIFFSERV_IP_DSCP_CS7 56
148 #define OPEN_DIFFSERV_IP_DSCP_EF 46
149 
150 /* User Keyword Translations for Layer 4 Protocols */
151 #define OPEN_DIFFSERV_LAYER_4_PROTOCOL_ICMP 1
152 #define OPEN_DIFFSERV_LAYER_4_PROTOCOL_IGMP 2
153 #define OPEN_DIFFSERV_LAYER_4_PROTOCOL_IP 255
154 #define OPEN_DIFFSERV_LAYER_4_PROTOCOL_TCP 6
155 #define OPEN_DIFFSERV_LAYER_4_PROTOCOL_UDP 17
156 #define OPEN_DIFFSERV_LAYER_4_PROTOCOL_GRE 47
157 #define OPEN_DIFFSERV_LAYER_4_PROTOCOL_IPV6 254
158 #define OPEN_DIFFSERV_LAYER_6_PROTOCOL_ICMP 58
159 
160 /*****************************************************************/
182  open_buffdesc *className,
183  OPEN_DIFFSERV_CLASS_TYPE_t classType,
184  OPEN_DIFFSERV_CLASS_L3PROTOCOL_t classL3Protocol);
185 
186 /*****************************************************************/
202  uint32_t classIndex);
203 
204 /*****************************************************************/
221  open_buffdesc *className, uint32_t *classIndex);
222 
223 /*****************************************************************/
243  uint32_t classIndex, uint32_t *classIndexNext);
244 
245 /*****************************************************************/
262  uint32_t classIndex, open_buffdesc *className);
263 
264 /*****************************************************************/
281  uint32_t classIndex, OPEN_DIFFSERV_CLASS_TYPE_t *classType);
282 
283 /*****************************************************************/
300  uint32_t classIndex, OPEN_DIFFSERV_CLASS_L3PROTOCOL_t *classProtoType);
301 
302 /*****************************************************************/
329  uint32_t classIndex,
331  open_buffdesc *ruleVal1,
332  open_buffdesc *ruleVal2);
333 
334 /*****************************************************************/
351  uint32_t classIndex, open_buffdesc *refClassName);
352 
353 /*****************************************************************/
377  uint32_t classIndex,
378  uint32_t classRuleIndex,
379  uint32_t *nextClassIndex,
380  uint32_t *nextClassRuleIndex);
381 
382 /*****************************************************************/
399  uint32_t classIndex,
400  uint32_t *ruleCount);
401 
402 /*****************************************************************/
420  uint32_t classIndex,
421  uint32_t classRuleIndex,
423 
424 /*****************************************************************/
449  uint32_t classIndex,
450  uint32_t classRuleIndex,
452  open_buffdesc *ruleVal1,
453  open_buffdesc *ruleVal2);
454 
455 #endif
456 
OPEN_DIFFSERV_CLASS_TYPE_t
Values for DiffServ Class type.
open_error_t openapiDiffServClassL3ProtoGet(openapiClientHandle_t *client_handle, uint32_t classIndex, OPEN_DIFFSERV_CLASS_L3PROTOCOL_t *classProtoType)
Get the class L3 protocol.
OPEN_QOS_ETYPE_KEYID_t
QOS Ethertype keyword list.
open_error_t openapiDiffServClassRuleMatchRefClassRemove(openapiClientHandle_t *client_handle, uint32_t classIndex, open_buffdesc *refClassName)
Remove the referenced class from the specified class.
open_error_t
OPEN uses these enumerators to indicate the error codes.
Source IPV6 : val1 - (IPV6 address), val2 - (1..128) prefix length.
IP DSCP : val1 - (0..63) Refer OPEN_DIFFSERV_IP_DSCP macros for user keyword translations.
open_error_t openapiDiffServClassNameToIndex(openapiClientHandle_t *client_handle, open_buffdesc *className, uint32_t *classIndex)
Translate a class name into its associated Class Table index.
open_error_t openapiDiffServClassRuleMatchEntryValueGet(openapiClientHandle_t *client_handle, uint32_t classIndex, uint32_t classRuleIndex, OPEN_DIFFSERV_CLASS_RULE_TYPE_t ruleType, open_buffdesc *ruleVal1, open_buffdesc *ruleVal2)
Get the Class Rule match entry type value.
open_error_t openapiDiffServClassGetNext(openapiClientHandle_t *client_handle, uint32_t classIndex, uint32_t *classIndexNext)
Determine next sequential row in the Class Table.
Source IP : val1 - (ip address), val2 - (ip mask)
open_error_t openapiDiffServClassRuleCountGet(openapiClientHandle_t *client_handle, uint32_t classIndex, uint32_t *ruleCount)
Get the number of match rules in the Class.
open_error_t openapiDiffServClassRuleMatchEntryTypeGet(openapiClientHandle_t *client_handle, uint32_t classIndex, uint32_t classRuleIndex, OPEN_DIFFSERV_CLASS_RULE_TYPE_t *ruleType)
Get the Class Rule match entry type.
OPEN_DIFFSERV_CLASS_RULE_TYPE_t
Values for DiffServ Class Rule types supported as match conditions.
Reference Class : Val1 - (className)
Destination IP : val1 - (ip address), val2 - (ip mask)
Every : Flag to indicate to match on any packet.
open_error_t openapiDiffServClassCreate(openapiClientHandle_t *client_handle, open_buffdesc *className, OPEN_DIFFSERV_CLASS_TYPE_t classType, OPEN_DIFFSERV_CLASS_L3PROTOCOL_t classL3Protocol)
Create the DiffServ class.
Destination port : val1 - (0-65535) Refer OPEN_DIFFSERV_LAYER_4_PORT_NUM macros for user keyword tran...
Destination IPV6 : val1 - (IPV6 address), val2 - (1..128) prefix length.
Destination port : val1 - (0-65535) Refer OPEN_DIFFSERV_LAYER_4_PORT_NUM macros for user keyword tran...
Ether type : val1 - (OPEN_QOS_ETYPE_KEYID_t), val2 - (0x0600..0xffff) valid for OPEN_QOS_ETYPE_KEYID_...
Destination MAC : val1 - (MAC address), val2 - (MAC address bit mask)
open_error_t openapiDiffServClassTypeGet(openapiClientHandle_t *client_handle, uint32_t classIndex, OPEN_DIFFSERV_CLASS_TYPE_t *classType)
Get the class type.
Secondary VLAN ID : val1 - (1..4093)
Source MAC : val1 - (MAC address), val2 - (MAC address bit mask)
Flow Label V6 : val1 - (0..1048575)
OPEN_DIFFSERV_CLASS_L3PROTOCOL_t
Values for DiffServ Class Layer3 Protocol type.
open_error_t openapiDiffServClassDelete(openapiClientHandle_t *client_handle, uint32_t classIndex)
Delete the DiffServ class.
open_error_t openapiDiffServClassRuleGetNext(openapiClientHandle_t *client_handle, uint32_t classIndex, uint32_t classRuleIndex, uint32_t *nextClassIndex, uint32_t *nextClassRuleIndex)
Determine next sequential row in the Class rule Table.
open_error_t openapiDiffServClassRuleCreate(openapiClientHandle_t *client_handle, uint32_t classIndex, OPEN_DIFFSERV_CLASS_RULE_TYPE_t ruleType, open_buffdesc *ruleVal1, open_buffdesc *ruleVal2)
Create a new rule in the Class Rule Table for the specified indexes.
PROTOCOL NUM : val1 - (0..255) Refer OPEN_DIFFSERV_LAYER_4_PROTOCOL & OPEN_DIFFSERV_LAYER_6_PROTOCOL ...
open_error_t openapiDiffServClassNameGet(openapiClientHandle_t *client_handle, uint32_t classIndex, open_buffdesc *className)
Get the class name for the given class index.
IP TOS : val1 - (00..ff) TOS bits value, val2 - (00..ff) TOS mask.