text: /* 
   * 
   * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
   * 
   * Copyright 2007-2020 Broadcom Inc. All rights reserved.
   * 
   * DO NOT EDIT THIS FILE!
   * This file is auto-generated.
   * Edits to this file will be lost when it is regenerated.
  */
  #include <sal/core/libc.h>
  #include <shared/swstate/sw_state.h>
  #include <shared/error.h>
  #include <shared/swstate/sw_state_defs.h>
  #include <shared/swstate/sw_state_utils.h>
  #include <shared/bsl.h>
  #include <shared/swstate/layout/sw_state_layout.h>
  #include <shared/swstate/layout/sw_state_dpp_soc_config_layout.h>
  
  #ifdef _ERR_MSG_MODULE_NAME  
    #error "_ERR_MSG_MODULE_NAME redefined"  
  #endif  
  #define _ERR_MSG_MODULE_NAME BSL_LS_SHARED_SWSTATE 
  #ifdef BCM_PETRA_SUPPORT
  #if defined(BCM_PETRA_SUPPORT)
  int sw_state_dpp_soc_config_layout_node_create(int unit, int* root_node_id, uint32* next_free_node_id){  
  
  #if (defined(BCM_PETRA_SUPPORT))
     int younger_brother_node_id = 0; 
     int offset = 0; 
     soc_dpp_soc_config_t* dummy_struct; 
  #endif /* (defined(BCM_PETRA_SUPPORT)) */ 
     SOC_INIT_FUNC_DEFS;
     /* alloc dummy struct */ 
     dummy_struct = sal_alloc(sizeof(soc_dpp_soc_config_t),"soc_dpp_soc_config_t"); 
  
     /* update current root node */  
     *root_node_id = *next_free_node_id; 
     /* add node */    
     _SOC_IF_ERR_EXIT(shr_sw_state_ds_layout_node_set(unit, 
                                     *root_node_id,                 /* node id var */      
                                     "config",             /* name */         
                                     sizeof(soc_dpp_soc_config_t),    /* size of the element's type*/          
                                     0,                 /* nof pointers */ 
                                     "soc_dpp_soc_config_t",              /* param type */
                                     0,                 /* array size 0 */ 
                                     0));             /* array size 1 */ 
     /* update next free node id */ 
      SW_STATE_NODE_ID_CHECK(unit, ++(*next_free_node_id));  
  
  #if defined(BCM_PETRA_SUPPORT)
     /* add node */ 
     _SOC_IF_ERR_EXIT(sw_state_dpp_soc_config_autosync_layout_node_create(unit, &younger_brother_node_id, next_free_node_id));
     /* connect node (1st child) to its parent */ 
     _SOC_IF_ERR_EXIT(shr_sw_state_ds_layout_add_child(unit, *root_node_id, younger_brother_node_id)); 
     /* update offset */ 
     offset = ((uint8*) &(dummy_struct->autosync)) - (( uint8*) dummy_struct); 
     _SOC_IF_ERR_EXIT(shr_sw_state_ds_layout_update_offset(unit, younger_brother_node_id, offset)); 
  #endif /* defined(BCM_PETRA_SUPPORT)*/ 
  
  #if defined(BCM_PETRA_SUPPORT)
     /* add node */ 
     _SOC_IF_ERR_EXIT(sw_state_dpp_soc_config_version_layout_node_create(unit, &younger_brother_node_id, next_free_node_id));
     /* connect node (1st child) to its parent */ 
     _SOC_IF_ERR_EXIT(shr_sw_state_ds_layout_add_child(unit, *root_node_id, younger_brother_node_id)); 
     /* update offset */ 
     offset = ((uint8*) &(dummy_struct->version)) - (( uint8*) dummy_struct); 
     _SOC_IF_ERR_EXIT(shr_sw_state_ds_layout_update_offset(unit, younger_brother_node_id, offset)); 
  #endif /* defined(BCM_PETRA_SUPPORT)*/ 
  
  #if defined(BCM_PETRA_SUPPORT)
     /* add node */ 
     _SOC_IF_ERR_EXIT(sw_state_dpp_soc_config_nested_api_counter_layout_node_create(unit, &younger_brother_node_id, next_free_node_id));
     /* connect node (1st child) to its parent */ 
     _SOC_IF_ERR_EXIT(shr_sw_state_ds_layout_add_child(unit, *root_node_id, younger_brother_node_id)); 
     /* update offset */ 
     offset = ((uint8*) &(dummy_struct->nested_api_counter)) - (( uint8*) dummy_struct); 
     _SOC_IF_ERR_EXIT(shr_sw_state_ds_layout_update_offset(unit, younger_brother_node_id, offset)); 
  #endif /* defined(BCM_PETRA_SUPPORT)*/ 
  
     SOC_EXIT;
   exit:
  #if (defined(BCM_PETRA_SUPPORT))
     /* free dummy struct */ 
     sal_free(dummy_struct); 
  #endif /* (defined(BCM_PETRA_SUPPORT)) */ 
     SOC_FUNC_RETURN;
  }
  
  #endif /* defined(BCM_PETRA_SUPPORT)*/ 
  #endif /* BCM_PETRA_SUPPORT*/ 
  #ifdef BCM_PETRA_SUPPORT
  #if defined(BCM_PETRA_SUPPORT)
  int sw_state_dpp_soc_config_autosync_layout_node_create(int unit, int* root_node_id, uint32* next_free_node_id){  
  
     SOC_INIT_FUNC_DEFS;
  
     /* update current root node */  
     *root_node_id = *next_free_node_id; 
     /* add node */    
     _SOC_IF_ERR_EXIT(shr_sw_state_ds_layout_node_set(unit, 
                                     *root_node_id,                 /* node id var */      
                                     "autosync",             /* name */         
                                     sizeof(uint32),    /* size of the element's type*/          
                                     0,                 /* nof pointers */ 
                                     "uint32",              /* param type */
                                     0,                 /* array size 0 */ 
                                     0));             /* array size 1 */ 
     /* update next free node id */ 
      SW_STATE_NODE_ID_CHECK(unit, ++(*next_free_node_id));  
  
     SOC_EXIT;
   exit:
     SOC_FUNC_RETURN;
  }
  
  #endif /* defined(BCM_PETRA_SUPPORT)*/ 
  #endif /* BCM_PETRA_SUPPORT*/ 
  #ifdef BCM_PETRA_SUPPORT
  #if defined(BCM_PETRA_SUPPORT)
  int sw_state_dpp_soc_config_version_layout_node_create(int unit, int* root_node_id, uint32* next_free_node_id){  
  
     SOC_INIT_FUNC_DEFS;
  
     /* update current root node */  
     *root_node_id = *next_free_node_id; 
     /* add node */    
     _SOC_IF_ERR_EXIT(shr_sw_state_ds_layout_node_set(unit, 
                                     *root_node_id,                 /* node id var */      
                                     "version",             /* name */         
                                     sizeof(char),    /* size of the element's type*/          
                                     0,                 /* nof pointers */ 
                                     "char",              /* param type */
                                     DPP_SOC_CONFIG_VERSION_LENGTH_MAX,                 /* array size 0 */ 
                                     0));             /* array size 1 */ 
     /* update next free node id */ 
      SW_STATE_NODE_ID_CHECK(unit, ++(*next_free_node_id));  
  
     SOC_EXIT;
   exit:
     SOC_FUNC_RETURN;
  }
  
  #endif /* defined(BCM_PETRA_SUPPORT)*/ 
  #endif /* BCM_PETRA_SUPPORT*/ 
  #ifdef BCM_PETRA_SUPPORT
  #if defined(BCM_PETRA_SUPPORT)
  int sw_state_dpp_soc_config_nested_api_counter_layout_node_create(int unit, int* root_node_id, uint32* next_free_node_id){  
  
     SOC_INIT_FUNC_DEFS;
  
     /* update current root node */  
     *root_node_id = *next_free_node_id; 
     /* add node */    
     _SOC_IF_ERR_EXIT(shr_sw_state_ds_layout_node_set(unit, 
                                     *root_node_id,                 /* node id var */      
                                     "nested_api_counter",             /* name */         
                                     sizeof(int),    /* size of the element's type*/          
                                     0,                 /* nof pointers */ 
                                     "int",              /* param type */
                                     0,                 /* array size 0 */ 
                                     0));             /* array size 1 */ 
     /* update next free node id */ 
      SW_STATE_NODE_ID_CHECK(unit, ++(*next_free_node_id));  
  
     SOC_EXIT;
   exit:
     SOC_FUNC_RETURN;
  }
  
  #endif /* defined(BCM_PETRA_SUPPORT)*/ 
  #endif /* BCM_PETRA_SUPPORT*/ 
  