aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/config/controlListListeners.c
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2019-10-07 09:52:33 +0200
committerJordan Augé <jordan.auge+fdio@cisco.com>2019-10-07 15:55:42 +0200
commit6b84ec54083da9911f5ad4816d0eb4f4745afad4 (patch)
treee4296ebb218fff02dc0bbea73ce1c8d12aba7bcc /hicn-light/src/hicn/config/controlListListeners.c
parent85a791ac2cdd35d79c00141e748b4c68fbdafb0d (diff)
[HICN-298] Release new hICN app for Android
Change-Id: I43adc62fadf00690b687078d739788dffdc5e566 Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'hicn-light/src/hicn/config/controlListListeners.c')
-rw-r--r--hicn-light/src/hicn/config/controlListListeners.c21
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);