config.h (2652B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * File: config.h 8 * Purpose: SAL Configuration file definitions 9 */ 10 11 #ifndef _SAL_CONFIG_H 12 #define _SAL_CONFIG_H 13 14 #if defined(UNIX) || defined(__ECOS) 15 # ifndef SAL_CONFIG_FILE 16 # define SAL_CONFIG_FILE "config.bcm" 17 # endif 18 # ifndef SAL_CONFIG_TEMP 19 # define SAL_CONFIG_TEMP "config.tmp" 20 # endif 21 #else 22 # ifndef SAL_CONFIG_FILE 23 # define SAL_CONFIG_FILE "config.bcm" 24 # ifndef SAL_CONFIG_FILE_FLASH 25 # define SAL_CONFIG_FILE_FLASH "flash:config.bcm" 26 # endif 27 # endif 28 # ifndef SAL_CONFIG_TEMP 29 # define SAL_CONFIG_TEMP "config.tmp" 30 # ifndef SAL_CONFIG_TEMP_FLASH 31 # define SAL_CONFIG_TEMP_FLASH "flash:config.tmp" 32 # endif 33 # endif 34 #endif 35 36 #define SAL_CONFIG_STR_MAX 256 /* Max len of "NAME=VALUE\0" */ 37 38 /* 39 * Defines: SAL_CONFIG_XXX 40 * 41 * SWITCH_MAC Mac address used for management interface 42 * SWITCH_IP IP address used for management interface 43 * ASSIGNED_MAC_BASE Base of MAC address range assigned to switch 44 * (excluding SWITCH_MAC). 45 * ASSIGNED_MAC_COUNT # of MAC addresses assigned to switch 46 * (excluding SWITCH_MAC). 47 */ 48 49 #define SAL_CONFIG_SWITCH_MAC "station_mac_address" 50 #define SAL_CONFIG_SWITCH_IP "station_ip_address" 51 #define SAL_CONFIG_SWITCH_IP_NETMASK "station_ip_netmask" 52 #define SAL_CONFIG_SWITCH_HOSTNAME "station_hostname" 53 #define SAL_CONFIG_ASSIGNED_MAC_BASE "switch_mac_base" 54 #define SAL_CONFIG_ASSIGNED_MAC_COUNT "switch_mac_count" 55 56 #define SAL_CONFIG_RELOAD_BUFFER_SIZE "reload_buffer_size" 57 #define SAL_CONFIG_RELOAD_FILE_NAME "reload_file_name" 58 59 extern int sal_config_refresh(void); 60 extern int sal_config_file_set(const char *fname, const char *tname); 61 extern int sal_config_file_get(const char **fname, const char **tname); 62 extern int sal_config_flush(void); 63 extern int sal_config_save(char *file, char *pattern, int append); 64 extern char *sal_config_get(const char *name); 65 extern int sal_config_get_next(char **name, char **value); 66 extern int sal_config_set(char *name, char *value); 67 extern void sal_config_show(void); 68 extern void sal_config_dump(void); 69 extern int sal_config_init(void); 70 extern int sal_config_file_process(char *fname,int *nof_imported_config_files, char *already_imported_tables[], char *dirname, int override_duplicates); 71 72 /* Declaration for compiled-in config variables. These are generated 73 * automatically from config.bcm by $SDK/make/bcm2c.pl. 74 */ 75 extern void sal_config_init_defaults(void); 76 77 #endif /* !_SAL_CONFIG_H */