Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
openapi_macal.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_macal.h
28 *
29 * @purpose This code implements the OpEN Management Access Control and
30 * Administration List (MACAL) API
31 *
32 * @component OPEN
33 *
34 * @create 01/26/2023
35 *
36 * @end
37 *
38 *********************************************************************/
39 #ifndef OPENAPI_MACAL_H_INCLUDED
40 #define OPENAPI_MACAL_H_INCLUDED
41 
42 #include "openapi_common.h"
43 
44 typedef enum
45 {
46  OPEN_MACAL_ACTION_DENY,
47  OPEN_MACAL_ACTION_PERMIT
48 } OPEN_MACAL_ACTION_t;
49 
50 typedef enum
51 {
52  OPEN_MACAL_PROTOCOL_NONE,
53  OPEN_MACAL_PROTOCOL_TELNET,
54  OPEN_MACAL_PROTOCOL_HTTP,
55  OPEN_MACAL_PROTOCOL_HTTPS,
56  OPEN_MACAL_PROTOCOL_SNMP,
57  OPEN_MACAL_PROTOCOL_SSH,
58  OPEN_MACAL_PROTOCOL_TFTP,
59  OPEN_MACAL_PROTOCOL_SNTP,
60  OPEN_MACAL_PROTOCOL_JAVA,
61  OPEN_MACAL_PROTOCOL_NTP,
62  OPEN_MACAL_CUSTOM_PORT
63 } OPEN_MACAL_SERVICE_t;
64 
65 typedef enum
66 {
67  OPEN_MACAL_SERVICE = (1 << 0),
68  OPEN_MACAL_SRCIP = (1 << 1),
69  OPEN_MACAL_SRCIP_MASK = (1 << 2),
70  OPEN_MACAL_VLAN = (1 << 3),
71  OPEN_MACAL_IF = (1 << 4),
72  OPEN_MACAL_SERVICE_PORT = (1 << 5),
73  OPEN_MACAL_TCP_UDP_PORT = (1 << 6)
74 
75 } OPEN_MACAL_RULE_FIELD_t;
76 
77 #define OPEN_MACAL_REQUEST_PRIORITY 0xFFFF
78 #define OPEN_MACAL_MIN_PRIORITY 1
79 #define OPEN_MACAL_MAX_PRIORITY 64
80 
81 /*************************************************************************/
98  open_buffdesc *macalName);
99 
100 /*************************************************************************/
117  open_buffdesc *macalName);
118 
119 /*************************************************************************/
136  open_buffdesc *vrfName);
137 
138 /*************************************************************************/
154  open_buffdesc *vrfName);
155 
156 /*************************************************************************/
173  open_buffdesc *macalName);
174 
175 /*************************************************************************/
192  open_buffdesc *macalName);
193 
194 /*************************************************************************/
217  open_buffdesc *macalName,
218  uint32_t *macalRulePrio);
219 
220 /*************************************************************************/
239  open_buffdesc *macalName,
240  uint32_t macalRulePrio);
241 
242 /*************************************************************************/
262  open_buffdesc *macalName,
263  uint32_t macalRulePrio,
264  OPEN_MACAL_ACTION_t action);
265 
266 /*************************************************************************/
287  open_buffdesc *macalName,
288  uint32_t macalRulePrio,
289  uint32_t ipAddr, uint32_t mask);
290 
291 /*************************************************************************/
311  open_buffdesc *macalName,
312  uint32_t macalRulePrio, uint32_t ifNum);
313 
314 /*************************************************************************/
334  open_buffdesc *macalName,
335  uint32_t macalRulePrio, uint32_t vlanId);
336 
337 /*************************************************************************/
358  open_buffdesc *macalName,
359  uint32_t macalRulePrio,
360  OPEN_BOOL_t isServicePort);
361 
362 /*************************************************************************/
382  open_buffdesc *macalName,
383  uint32_t macalRulePrio,
384  OPEN_BOOL_t *isRuleForServicePort);
385 
386 /*************************************************************************/
406  open_buffdesc *macalName,
407  uint32_t macalRulePrio,
408  OPEN_MACAL_SERVICE_t service);
409 
410 /*************************************************************************/
426  open_buffdesc *macalName);
427 
428 /*************************************************************************/
444  open_buffdesc *macalName);
445 
446 /*************************************************************************/
463  open_buffdesc *macalName,
464  uint32_t *macalRulePrio);
465 
466 /*************************************************************************/
485  open_buffdesc *macalName,
486  uint32_t macalRulePrio,
487  uint32_t *nextMacalRulePrio);
488 
489 /*************************************************************************/
508  open_buffdesc *macalName,
509  uint32_t macalRulePrio,
510  OPEN_BOOL_t *isIndexExists);
511 
512 /*************************************************************************/
531  open_buffdesc *macalName,
532  uint32_t macalRulePrio,
533  OPEN_MACAL_ACTION_t *action);
534 
535 /*************************************************************************/
555  open_buffdesc *macalName,
556  uint32_t macalRulePrio,
557  uint32_t *ipAddr, uint32_t *mask);
558 
559 /*************************************************************************/
578  open_buffdesc *macalName,
579  uint32_t macalRulePrio,
580  uint32_t *ifNum);
581 
582 /*************************************************************************/
601  open_buffdesc *macalName,
602  uint32_t macalRulePrio,
603  uint32_t *vlanId);
604 
605 /*************************************************************************/
624  open_buffdesc *macalName,
625  uint32_t macalRulePrio,
626  OPEN_MACAL_SERVICE_t *service);
627 
628 /*************************************************************************/
648  open_buffdesc *macalName,
649  uint32_t macalRulePrio,
650  uint32_t *packets,
651  uint32_t *bytes);
652 
653 /*************************************************************************/
672  open_buffdesc *macalName,
673  uint32_t macalRulePrio,
674  uint32_t *portNum);
675 
676 /*************************************************************************/
696  open_buffdesc *macalName,
697  uint32_t macalRulePrio,
698  uint32_t portNum);
699 
700 /*************************************************************************/
720  open_buffdesc *macalName,
721  uint32_t macalRulePrio,
722  OPEN_MACAL_RULE_FIELD_t ruleField,
723  OPEN_BOOL_t *isConfigured);
724 
725 /*************************************************************************/
741  OPEN_BOOL_t *isCreated);
742 
743 /*************************************************************************/
759  OPEN_BOOL_t *isActivated);
760 
761 /*************************************************************************/
777  uint32_t *filtPackets);
778 
779 /*************************************************************************/
795  uint32_t *interval);
796 
797 /*************************************************************************/
814  uint32_t interval);
815 
816 /*************************************************************************/
834  open_buffdesc *macalName,
835  uint32_t *macalRulePrio);
836 
837 /*************************************************************************/
853  open_buffdesc *vrfName,
854  OPEN_BOOL_t *isValid);
855 
856 /*************************************************************************/
871 
872 /*************************************************************************/
888  OPEN_BOOL_t *isSupported);
889 
890 
891 #endif /* OPENAPI_MACAL_H_INCLUDED */
892 
open_error_t openapiMacalRuleServiceAdd(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, OPEN_MACAL_SERVICE_t service)
To add a service to management ACAL rule.
open_error_t openapiMacalRuleActionGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, OPEN_MACAL_ACTION_t *action)
Get the action for a management ACAL rule.
open_error_t openapiMacalRuleRemove(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio)
To remove a management rule from an existing ACAL.
open_error_t openapiMacalRuleInterfaceAdd(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, uint32_t ifNum)
To add an interface (ethernet/LAG) to an existing management ACAL rule.
open_error_t openapiMacalIsAnyListCreated(openapiClientHandle_t *client_handle, OPEN_BOOL_t *isCreated)
Check if a MACAL list is created.
open_error_t openapiMacalListCreate(openapiClientHandle_t *client_handle, open_buffdesc *macalName)
To create a new management ACAL.
open_error_t openapiMacalStatsPacketsFilteredGet(openapiClientHandle_t *client_handle, uint32_t *filtPackets)
Get the number of packets filtered.
open_error_t openapiMacalIsNetFilterTablesFeatureSupported(openapiClientHandle_t *client_handle, OPEN_BOOL_t *isSupported)
Check if the Net Filter table support is present on this platform.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiMacalListVrfGet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName)
Gets VRF of a management ACAL.
open_error_t openapiMacalDenyCounterIntervalGet(openapiClientHandle_t *client_handle, uint32_t *interval)
Get the macal deny counter interval.
open_error_t openapiMacalClearServicePortStatistics(openapiClientHandle_t *client_handle)
Clears macal service port statistics.
open_error_t openapiMacalListDelete(openapiClientHandle_t *client_handle, open_buffdesc *macalName)
To delete an existing management ACAL.
open_error_t openapiMacalActivate(openapiClientHandle_t *client_handle, open_buffdesc *macalName)
Activate a management ACAL.
open_error_t openapiMacalDenyCounterIntervalSet(openapiClientHandle_t *client_handle, uint32_t interval)
Set the macal deny counter interval.
open_error_t openapiMacalRuleIsServicePortSet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, OPEN_BOOL_t *isRuleForServicePort)
Check if this management ACAL rule is for the service port.
open_error_t openapiMacalServicePortRuleStatisticsGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, uint32_t *packets, uint32_t *bytes)
Get the service port statistics for a management ACAL rule.
open_error_t openapiMacalRulePriorityIndexGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t *macalRulePrio)
Get the first available priority (index) for the specified management ACAL.
open_error_t openapiMacalRuleVlanAdd(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, uint32_t vlanId)
To add a vlan to an existing management ACAL rule.
open_error_t openapiMacalRuleEntryAdd(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t *macalRulePrio)
To add a management ACAL rule.
open_error_t openapiMacalRuleTcpUdpPortNumberAdd(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, uint32_t portNum)
Add the TCP/UDP port number to a management ACAL rule.
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
open_error_t openapiMacalRuleServiceGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, OPEN_MACAL_SERVICE_t *service)
Get the service of a management ACAL rule.
open_error_t openapiMacalRuleInterfaceGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, uint32_t *ifNum)
Get the interface (ethernet/LAG) of an existing management ACAL rule.
open_error_t openapiMacalIsFieldConfigured(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, OPEN_MACAL_RULE_FIELD_t ruleField, OPEN_BOOL_t *isConfigured)
Checks to see if a user has configured a field in a management ACAL rule.
open_error_t openapiMacalRuleServicePortSet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, OPEN_BOOL_t isServicePort)
To add a serviceport to an existing management ACAL rule.
open_error_t openapiMacalVrfNameValid(openapiClientHandle_t *client_handle, open_buffdesc *vrfName, OPEN_BOOL_t *isValid)
Checks the specified VRF name is valid or not.
open_error_t openapiMacalDeactivate(openapiClientHandle_t *client_handle, open_buffdesc *macalName)
Deactivate a management ACAL.
open_error_t openapiMacalRuleSrcIpMaskAdd(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, uint32_t ipAddr, uint32_t mask)
To add the source ip address and net mask to a management ACAL rule.
open_error_t openapiMacalListVrfSet(openapiClientHandle_t *client_handle, open_buffdesc *vrfName)
Sets VRF of a management ACAL.
open_error_t openapiMacalRuleNextGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, uint32_t *nextMacalRulePrio)
Get the next management ACAL rule.
open_error_t openapiMacalRuleExists(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, OPEN_BOOL_t *isIndexExists)
Check if this management ACAL rule with given priority exists.
open_error_t openapiMacalRuleTcpUdpPortNumberGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, uint32_t *portNum)
Get the TCP/UDP port number of a management ACAL rule.
open_error_t openapiMacalRuleActionAdd(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, OPEN_MACAL_ACTION_t action)
To add an action to management ACAL rule.
open_error_t openapiMacalRuleSrcIpMaskGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, uint32_t *ipAddr, uint32_t *mask)
Get the source ip address and net mask of a management ACAL rule.
open_error_t openapiMacalRuleFirstGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t *macalRulePrio)
Get the first management ACAL rule.
open_error_t openapiMacalRuleVlanGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName, uint32_t macalRulePrio, uint32_t *vlanId)
Gets the vlan ID of an existing management ACAL rule.
open_error_t openapiMacalActiveListGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName)
Get the active management ACAL.
open_error_t openapiMacalIsAnyListActivated(openapiClientHandle_t *client_handle, OPEN_BOOL_t *isActivated)
Check if a MACAL list is activated.
open_error_t openapiMacalNameGet(openapiClientHandle_t *client_handle, open_buffdesc *macalName)
Get the name of the management ACAL already existing.