2019-06-18 07:54:42 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "rpc.h"
|
|
|
|
#include "configm.h"
|
|
|
|
#include "ipconfig.h"
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
2019-07-06 06:10:08 +00:00
|
|
|
FILE *f = fopen("configtest","r+");
|
|
|
|
char config_linebuf[512];
|
2019-06-18 07:54:42 +00:00
|
|
|
char* output = NULL;
|
|
|
|
int output_len;
|
2019-07-06 06:10:08 +00:00
|
|
|
ret_code code;
|
2019-06-18 07:54:42 +00:00
|
|
|
|
2019-07-06 06:10:08 +00:00
|
|
|
if(f == NULL)
|
2019-06-27 07:27:41 +00:00
|
|
|
{
|
2019-07-06 06:10:08 +00:00
|
|
|
printf("OPEN CONFIG test file FALID\n");
|
2019-06-27 07:27:41 +00:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2019-06-26 08:48:45 +00:00
|
|
|
|
2019-07-06 06:10:08 +00:00
|
|
|
memset(config_linebuf, 0, sizeof(config_linebuf));
|
|
|
|
while(fgets(config_linebuf, 512, f) != NULL)
|
2019-06-26 08:48:45 +00:00
|
|
|
{
|
2019-07-06 06:10:08 +00:00
|
|
|
|
|
|
|
printf("configure: %s\n", config_linebuf);
|
|
|
|
|
|
|
|
code = web_config_exec_sync(CM_CONFIG_GET, IPCONFIG_V4,
|
|
|
|
config_linebuf, strlen(config_linebuf) + 1, &output, &output_len);
|
|
|
|
|
|
|
|
printf("call config type retturn:%s,result:%s\n", rpc_code_format(code), output);
|
2019-06-18 07:54:42 +00:00
|
|
|
|
2019-07-06 06:10:08 +00:00
|
|
|
memset(config_linebuf, 0, sizeof(config_linebuf));
|
2019-06-18 07:54:42 +00:00
|
|
|
}
|
2019-07-06 06:10:08 +00:00
|
|
|
|
|
|
|
fclose(f);
|
2019-06-18 07:54:42 +00:00
|
|
|
|
2019-07-06 06:10:08 +00:00
|
|
|
return EXIT_SUCCESS;
|
2019-06-18 07:54:42 +00:00
|
|
|
}
|
2019-07-06 06:10:08 +00:00
|
|
|
|