Do I have to pass filename of config file and policy file as arguments or the pointer to file? Is this code right or should I pass only the filename?
Here I am passing pointer to the file:
FILE *pcd_file, *cfg_file;
cfg_file = fopen("/usr/etc/usdpaa_config_t4_serdes_1_1_6_6.xml", "a+");
pcd_file = fopen("/usr/etc/usdpaa_policy_hash_ipv4.xml", "a+");
netcfg = usdpaa_netcfg_acquire( (const char *)pcd_file, (const char *)cfg_file);
Or should I pass the filenames:
const char * cfg_file, *pcd_file;
cfg_file = "/usr/etc/usdpaa_config_t4_serdes_1_1_6_6.xml";
pcd_file = "/usr/etc/usdpaa_policy_hash_ipv4.xml";
netcfg = usdpaa_netcfg_acquire( (pcd_file,cfg_file);
Hello Priya Agarwal,
It's not a good method to hard code the configuration file path to your source code. I assume that you are using PPAC/PPAM programming structure, and usdpaa_netcfg_acquire is invoked in apps/ppac/main.c, you need to to specify the configuration and policy files as parameters of your application, then the file path is passed to usdpaa_netcfg_acquire.
For example,
cd /usr/etc
fmc -c usdpaa_config_t4_serdes_1_1_6_6.xml -p usdpaa_policy_hash_ipv4.xml -a
reflector -c usdpaa_config_t4_serdes_1_1_6_6.xml -p usdpaa_policy_hash_ipv4.xml
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
You should pass file path. The libxml will open and parse it.