blob: f8db0110914dda447b263967c92a4768d0520639 [file] [log] [blame]
Shad Ansari2f7f9be2017-06-07 13:34:53 -07001/*
2 * BAL Programmers Guide - introduction
3 */
4
5/** \mainpage BAL Public Interface Concept
6
7\section intro Introduction
8This document describes the BAL user interface. The user interface is constructed from a
9small set of public APIs and an objects model.
10
11The objects model is designed to manage different entities in the system, and enables a simple and intuitive
12approach for managing line card.
13
14The API layer is designed to enable the management of line card containing muultiple MAC and SWITCH devices
15and support any host application architecture. It includes a set of APIs to access the line card configuration and
16asynchronous indications to send events to the host application.
17
18The API layer is part of the Broadcom® BAL SDK, which is provided as C source code, which is
19independent of the CPU and operating system being used.
20
21\section object_model_table BAL Object Model
22
23The system is modeled as a set of managed objects. The term “object” here doesn’t imply any inheritance, it
24means an entity that can be addressed individually and has a set of properties (attributes) and methods
25(operations), for example, access_terminal, flow, etc.
26
27Each object can have multiple properties (aka attributes), whereas a property is an object parameter that can be set or
28retrieved independently.
29 - A property is a simple type or a structure containing one or more fields, where fields can themselves be
30structures
31 - Each property has a specific permission type, such as Read-Only (RO) and Read-Write (RW).
32
33Object properties are grouped into sections/management groups. The following sections can contain zero or
34more properties:
35 - Key—Field(s) that uniquely identify the object instance (for example, subscriber_terminal key = {subs_id, intf_id}).
36 - Configuration
37 - Read-Write, Read-Only and Write-Only configuration properties
38 - Statistics
39 - Performance monitoring counters
40 - Debug counters
41 - Autonomous Indications
42 - Notifications that are generated asynchronously.
43 Indications can be either autonomous (such as alarms) or asynchronous responses to previously
44 submitted configuration change (for instance, subscriber_terminal admin_state=up request).
45
46\section object_model_prop Object and Properties Implementation
47
48\subsection object_model_structs Object Structures
49
50The main input parameter of all the APIs is an object structure, referred to as the Object Request Message. Each
51object section has a different structure that includes a generic header, object key, and a specific section structure
52according to the section type (for example, configuration, statics, etc).
53 - Generic header: A basic component of all the different section structures is the object generic header
54 \ref bcmbal_obj
55
56 - The configuration structure bcmbal_xx_cfg contains:
57 - The generic header \ref bcmbal_cfg
58 - The object key, if any
59 - The structure bcmbal_xx_cfg_data, containing all object configuration properties
60
61 - This statistics structure bcmbal_xx_stat contains:
62 - The generic header \ref bcmbal_stat
63 - The object key, if any
64 - The structure bcmbal_xx_stat_data, containing all the object statistics
65
66 - The per-autonomous indication structure bcmbal_xx_auto_yy contains:
67 - The generic header \ref bcmbal_auto
68 - The autonomous message ID is stored in the subgroup field.
69 - The object key, if any
70 - The structure bcmbal_xx_auto_yy_data, containing all indication properties, if any
71
72\subsection object_model_init_macros Structure Initialization Macros
73The following macros are used for initializing objects:
74 - \ref BCMBAL_CFG_INIT(cfg_msg, _object, _key)
75 - \ref BCMBAL_STAT_INIT(stat_msg, _object, _key)
76
77The macros perform the following tasks:
78 - Check that the structure matches the object section.
79 - Clear all control fields in the generic header \ref bcmbal_obj.
80
81\subsection object_model_prop_macros Property Presence Mask Manipulation Macros
82The presence mask indicates which of the properties in the object structure need to be accessed (set/get, etc.)
83The mask is a bit field, wherein each bit corresponds to a specific property. The following macros should be used
84for setting the presence mask:
85
86 - Set configuration parameter value:\n
87 \ref BCMBAL_CFG_PROP_SET(_msg, _object, _parm_name, _parm_value)
88 - Indicate that the property should be fetched by a bcmolt_cfg_get() request:\n
89 \ref BCMBAL_CFG_PROP_GET(_msg, _object, _parm_name)
90 - Indicate that the statistic should be fetched by a bcmolt_stat_get() request:\n
91 \ref BCMBAL_STAT_PROP_GET(_msg, _object, _parm_name)
92
93\subsection object_model_enums Enumerations
94In the following descriptions, XX is the object name and YY is the property name from the XML model.
95
96The system model includes the enumerations:
97 - The bcmbal_obj_id enumeration lists all objects. It includes per-object BCMBAL_OBJ_ID_XX constants,
98 where XX is the object name from the XML model.
99 - The bcmbal_xx_cfg_id enumeration lists all XX objects' properties from the “Configuration” section in the
100 XML model. It includes the BCMBAL_XX_CFG_ID_YY constants.
101 - The bcmbal_xx_stat_id enumeration lists all XX object's properties from the “Statistics” section in the XML
102 model. It includes the BCMBAL_XX_STAT_ID_YY constants.
103 - The bcmbal_xx_auto_id enumeration lists all XX object's indications from the “Autonomous Indications”
104 section in the XML model. It includes the BCMBAL_XX_AUTO_ID_YY constants.
105
106\section api_section BAL Public API
107 See \ref api in API Reference chapter
108*/