sonic-buildimage/src/systemd-sonic-generator/systemd-sonic-generator.h
anamehra 3b30127913
[multi-asic] Fixed systemd-sonic-generator for multi-asic (#7954)
Why I did it

systemd-sonic-generator limits multi-asic unit file instances to 10 (single digit instance number 0 - 10). This limitation needs to be removed to handle more than 10 asics.
MAX_NUM_TARGETS and MAX_NUM_INSTALL_LINES limits to 15 which is not sufficient for systems with more than 15 asics.
Inside get_unit_files(), strcmp produce incorrect results due to non null terminated string being compared.

 Added build UT support for systemd-sonic-generator
2021-07-07 17:14:21 -07:00

36 lines
1.1 KiB
C

/*------------------------------------------------------------------
* systemd-sonic-generator.h - Header file
*
* Initial: Apr 2021
*
* Copyright (c) 2021 by Cisco Systems, Inc.
*------------------------------------------------------------------
*/
#ifdef __cplusplus
extern "C" {
#endif
/* expose global vars for testing purpose */
extern const char* UNIT_FILE_PREFIX;
extern const char* CONFIG_FILE;
extern const char* MACHINE_CONF_FILE;
extern const char* ASIC_CONF_FORMAT;
extern const char* g_unit_file_prefix;
extern const char* g_config_file;
extern const char* g_machine_config_file;
extern const char* g_asic_conf_format;
/* C-functions under test */
extern const char* get_unit_file_prefix();
extern const char* get_config_file();
extern const char* get_machine_config_file();
extern const char* get_asic_conf_format();
extern char* insert_instance_number(char* unit_file, int instance);
extern int ssg_main(int argc, char** argv);
extern int get_num_of_asic();
extern int get_install_targets(char* unit_file, char* targets[]);
extern int get_unit_files(char* unit_files[]);
#ifdef __cplusplus
}
#endif