diff options
Diffstat (limited to 'hicn-light/src/hicn/config/controlListListeners.c')
-rw-r--r-- | hicn-light/src/hicn/config/controlListListeners.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/hicn-light/src/hicn/config/controlListListeners.c b/hicn-light/src/hicn/config/controlListListeners.c index 1f4ad7f2c..5be7b0a9b 100644 --- a/hicn-light/src/hicn/config/controlListListeners.c +++ b/hicn-light/src/hicn/config/controlListListeners.c @@ -95,7 +95,8 @@ static CommandReturn _controlListListeners_Execute(CommandParser *parser, char *addrString = NULL; if (receivedHeader->length > 0) { - printf("%6.6s %50.70s %s\n", "iface", "address", "type"); + printf("%6.6s %16s %50.70s %6s %10s\n", "iface", "name", "address", "type", "interface"); + } else { printf(" --- No entry in the list \n"); } @@ -111,16 +112,26 @@ static CommandReturn _controlListListeners_Execute(CommandParser *parser, PARCBufferComposer *composer = parcBufferComposer_Create(); - parcBufferComposer_Format(composer, "%6u %50.70s %3s", - listListenersCommand->connid, addrString, - listenerType[listListenersCommand->encapType]); + if (strcmp(listenerType[listListenersCommand->encapType], "UDP") == 0 || + strcmp(listenerType[listListenersCommand->encapType], "TCP") == 0) { + parcBufferComposer_Format(composer, "%6u %16s %50.70s %6s %10s", + listListenersCommand->connid, + listListenersCommand->listenerName,addrString, + listenerType[listListenersCommand->encapType], + listListenersCommand->interfaceName); + } else { + parcBufferComposer_Format(composer, "%6u %16s %50.70s %6s", + listListenersCommand->connid, + listListenersCommand->listenerName,addrString, + listenerType[listListenersCommand->encapType]); + } PARCBuffer *tempBuffer = parcBufferComposer_ProduceBuffer(composer); char *result = parcBuffer_ToString(tempBuffer); parcBuffer_Release(&tempBuffer); if (!controlState_IsInteractive(state)) { - strcpy(commandOutputMain[i], result); + strncpy(commandOutputMain[i], result, 128); } puts(result); |