From ea537e7b364377a01d480ed3394d20d7640a7b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Mon, 20 Jun 2016 16:01:50 +0200 Subject: [PATCH] Add SASL to virNetSocket{Local,Remote}AddrString Rename them to virNetSocket{Local,Remote}AddrStringSASL to make their format more obvious. --- src/libvirt_remote.syms | 4 ++-- src/rpc/virnetclient.c | 4 ++-- src/rpc/virnetserverclient.c | 4 ++-- src/rpc/virnetsocket.c | 4 ++-- src/rpc/virnetsocket.h | 4 ++-- tests/virnetsockettest.c | 12 ++++++------ 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms index fd80e46dac..3858f4de89 100644 --- a/src/libvirt_remote.syms +++ b/src/libvirt_remote.syms @@ -212,7 +212,7 @@ virNetSocketHasPassFD; virNetSocketHasPendingData; virNetSocketIsLocal; virNetSocketListen; -virNetSocketLocalAddrString; +virNetSocketLocalAddrStringSASL; virNetSocketNewConnectCommand; virNetSocketNewConnectExternal; virNetSocketNewConnectLibSSH2; @@ -227,7 +227,7 @@ virNetSocketNewPostExecRestart; virNetSocketPreExecRestart; virNetSocketRead; virNetSocketRecvFD; -virNetSocketRemoteAddrString; +virNetSocketRemoteAddrStringSASL; virNetSocketRemoteAddrStringURI; virNetSocketRemoveIOCallback; virNetSocketSendFD; diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 9c0d190d36..c43cd08869 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -946,12 +946,12 @@ void virNetClientRemoveStream(virNetClientPtr client, const char *virNetClientLocalAddrString(virNetClientPtr client) { - return virNetSocketLocalAddrString(client->sock); + return virNetSocketLocalAddrStringSASL(client->sock); } const char *virNetClientRemoteAddrString(virNetClientPtr client) { - return virNetSocketRemoteAddrString(client->sock); + return virNetSocketRemoteAddrStringSASL(client->sock); } #if WITH_GNUTLS diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index 15715a919b..5aa7634866 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -907,7 +907,7 @@ const char *virNetServerClientLocalAddrString(virNetServerClientPtr client) { if (!client->sock) return NULL; - return virNetSocketLocalAddrString(client->sock); + return virNetSocketLocalAddrStringSASL(client->sock); } @@ -915,7 +915,7 @@ const char *virNetServerClientRemoteAddrString(virNetServerClientPtr client) { if (!client->sock) return NULL; - return virNetSocketRemoteAddrString(client->sock); + return virNetSocketRemoteAddrStringSASL(client->sock); } const char *virNetServerClientRemoteAddrStringURI(virNetServerClientPtr client) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 00dc4172f3..405f5ba30e 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -1461,12 +1461,12 @@ int virNetSocketSetBlocking(virNetSocketPtr sock, } -const char *virNetSocketLocalAddrString(virNetSocketPtr sock) +const char *virNetSocketLocalAddrStringSASL(virNetSocketPtr sock) { return sock->localAddrStrSASL; } -const char *virNetSocketRemoteAddrString(virNetSocketPtr sock) +const char *virNetSocketRemoteAddrStringSASL(virNetSocketPtr sock) { return sock->remoteAddrStrSASL; } diff --git a/src/rpc/virnetsocket.h b/src/rpc/virnetsocket.h index 25ca14eb3f..ec064bbb2e 100644 --- a/src/rpc/virnetsocket.h +++ b/src/rpc/virnetsocket.h @@ -148,8 +148,8 @@ void virNetSocketSetSASLSession(virNetSocketPtr sock, bool virNetSocketHasCachedData(virNetSocketPtr sock); bool virNetSocketHasPendingData(virNetSocketPtr sock); -const char *virNetSocketLocalAddrString(virNetSocketPtr sock); -const char *virNetSocketRemoteAddrString(virNetSocketPtr sock); +const char *virNetSocketLocalAddrStringSASL(virNetSocketPtr sock); +const char *virNetSocketRemoteAddrStringSASL(virNetSocketPtr sock); const char *virNetSocketRemoteAddrStringURI(virNetSocketPtr sock); int virNetSocketListen(virNetSocketPtr sock, int backlog); diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 4d78d272a0..cafdca997d 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -249,12 +249,12 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) if (virNetSocketNewListenUNIX(path, 0700, -1, getegid(), &lsock) < 0) goto cleanup; - if (STRNEQ(virNetSocketLocalAddrString(lsock), "127.0.0.1;0")) { + if (STRNEQ(virNetSocketLocalAddrStringSASL(lsock), "127.0.0.1;0")) { VIR_DEBUG("Unexpected local address"); goto cleanup; } - if (virNetSocketRemoteAddrString(lsock) != NULL) { + if (virNetSocketRemoteAddrStringSASL(lsock) != NULL) { VIR_DEBUG("Unexpected remote address"); goto cleanup; } @@ -265,12 +265,12 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) if (virNetSocketNewConnectUNIX(path, false, NULL, &csock) < 0) goto cleanup; - if (STRNEQ(virNetSocketLocalAddrString(csock), "127.0.0.1;0")) { + if (STRNEQ(virNetSocketLocalAddrStringSASL(csock), "127.0.0.1;0")) { VIR_DEBUG("Unexpected local address"); goto cleanup; } - if (STRNEQ(virNetSocketRemoteAddrString(csock), "127.0.0.1;0")) { + if (STRNEQ(virNetSocketRemoteAddrStringSASL(csock), "127.0.0.1;0")) { VIR_DEBUG("Unexpected remote address"); goto cleanup; } @@ -287,12 +287,12 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) } - if (STRNEQ(virNetSocketLocalAddrString(ssock), "127.0.0.1;0")) { + if (STRNEQ(virNetSocketLocalAddrStringSASL(ssock), "127.0.0.1;0")) { VIR_DEBUG("Unexpected local address"); goto cleanup; } - if (STRNEQ(virNetSocketRemoteAddrString(ssock), "127.0.0.1;0")) { + if (STRNEQ(virNetSocketRemoteAddrStringSASL(ssock), "127.0.0.1;0")) { VIR_DEBUG("Unexpected remote address"); goto cleanup; }