aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/config/controlCacheServe.c
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-06-15 10:02:57 +0000
committerGerrit Code Review <gerrit@fd.io>2020-06-15 10:02:57 +0000
commit961352d7801c4f4bbee2990690b7d5ac5e3c88d6 (patch)
tree20f3915fa8220caec629cfbc1dd918acc359e0e4 /hicn-light/src/hicn/config/controlCacheServe.c
parent0f3841ea94ed9019a538516d774f5936b301e9a0 (diff)
parent9e2c045d6118ef264d6cf8fc655b72d7c4c403dc (diff)
Merge "[HICN-626] Return output from libhicnlight"
Diffstat (limited to 'hicn-light/src/hicn/config/controlCacheServe.c')
-rw-r--r--hicn-light/src/hicn/config/controlCacheServe.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/hicn-light/src/hicn/config/controlCacheServe.c b/hicn-light/src/hicn/config/controlCacheServe.c
index 881c49ed3..a4454037d 100644
--- a/hicn-light/src/hicn/config/controlCacheServe.c
+++ b/hicn-light/src/hicn/config/controlCacheServe.c
@@ -31,10 +31,14 @@
static CommandReturn _controlCacheServe_Execute(CommandParser *parser,
CommandOps *ops,
- PARCList *args);
+ PARCList *args,
+ char *output,
+ size_t output_size);
static CommandReturn _controlCacheServe_HelpExecute(CommandParser *parser,
CommandOps *ops,
- PARCList *args);
+ PARCList *args,
+ char *output,
+ size_t output_size);
static const char *_commandCacheServe = "cache serve";
static const char *_commandCacheServeHelp = "help cache serve";
@@ -55,18 +59,20 @@ CommandOps *controlCacheServe_HelpCreate(ControlState *state) {
static CommandReturn _controlCacheServe_HelpExecute(CommandParser *parser,
CommandOps *ops,
- PARCList *args) {
- printf("cache serve [on|off]\n");
- printf("\n");
-
+ PARCList *args,
+ char *output,
+ size_t output_size) {
+ snprintf(output, output_size, "cache serve [on|off]\n\n");
return CommandReturn_Success;
}
static CommandReturn _controlCacheServe_Execute(CommandParser *parser,
CommandOps *ops,
- PARCList *args) {
+ PARCList *args,
+ char *output,
+ size_t output_size) {
if (parcList_Size(args) != 3) {
- _controlCacheServe_HelpExecute(parser, ops, args);
+ _controlCacheServe_HelpExecute(parser, ops, args, output, output_size);
return CommandReturn_Failure;
}
@@ -76,7 +82,7 @@ static CommandReturn _controlCacheServe_Execute(CommandParser *parser,
} else if (strcmp(parcList_GetAtIndex(args, 2), "off") == 0) {
active = false;
} else {
- _controlCacheServe_HelpExecute(parser, ops, args);
+ _controlCacheServe_HelpExecute(parser, ops, args, output, output_size);
return CommandReturn_Failure;
}