mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2026-01-11 17:45:34 +00:00
Add new onlp_sys_hdr_get() wrapper around onlp_sysi_oids_get() to improve OID iteration.
We don't need the full system information (ONIE and platform) retrieved each time we want to iterate the OIDs.
This commit is contained in:
@@ -62,6 +62,11 @@ int onlp_sys_info_get(onlp_sys_info_t* rv);
|
||||
*/
|
||||
void onlp_sys_info_free(onlp_sys_info_t* info);
|
||||
|
||||
/**
|
||||
* @brief Get the system header.
|
||||
*/
|
||||
int onlp_sys_hdr_get(onlp_oid_hdr_t* hdr);
|
||||
|
||||
/**
|
||||
* @brief SYS OID debug dump.
|
||||
* @param id The SYS OID.
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
@@ -80,11 +80,7 @@ oid_type_unknown_dump__(onlp_oid_t oid, aim_pvs_t* pvs, uint32_t flags)
|
||||
static int
|
||||
oid_type_SYS_hdr_get__(onlp_oid_t oid, onlp_oid_hdr_t* hdr)
|
||||
{
|
||||
int rv;
|
||||
onlp_sys_info_t si;
|
||||
rv = onlp_sys_info_get(&si);
|
||||
memcpy(hdr, &si.hdr, sizeof(si.hdr));
|
||||
return rv;
|
||||
return onlp_sys_hdr_get(hdr);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -168,6 +168,15 @@ onlp_sys_info_free(onlp_sys_info_t* info)
|
||||
onlp_sysi_platform_info_free(&info->platform_info);
|
||||
}
|
||||
|
||||
static int
|
||||
onlp_sys_hdr_get_locked__(onlp_oid_hdr_t* hdr)
|
||||
{
|
||||
memset(hdr, 0, sizeof(*hdr));
|
||||
return onlp_sysi_oids_get(hdr->coids, AIM_ARRAYSIZE(hdr->coids));
|
||||
}
|
||||
ONLP_LOCKED_API1(onlp_sys_hdr_get, onlp_oid_hdr_t*, hdr);
|
||||
|
||||
|
||||
void
|
||||
onlp_sys_dump(onlp_oid_t id, aim_pvs_t* pvs, uint32_t flags)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user