mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
You can pre-validate your OID ids prior to any other calls to your module. If onlp_<type>_id_validate() returns ONLP_STATUS_OK then the ID will be passed to your implementation. If onlp_<type>_id_validate() returns ONLP_STATUS_E_INVALID then it will not be passed to your implementation. The goal here is to avoid all of the boilerplate ID bounds checking in all of the platform implemenations that use static OID info arrays. Instead of validating in each function you should provide a single onlp_<type>_id_validate() and assume the ID is valid in all other functions. The default implementation returns ONLP_STATUS_OK for backwards compatibility.