]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to common source files not applicable to open-vm-tools.
authorKaty Feng <fkaty@vmware.com>
Thu, 5 Oct 2023 17:35:27 +0000 (10:35 -0700)
committerKaty Feng <fkaty@vmware.com>
Thu, 5 Oct 2023 17:35:27 +0000 (10:35 -0700)
open-vm-tools/lib/asyncsocket/asyncSocketInterface.c
open-vm-tools/lib/asyncsocket/asyncSocketVTable.h
open-vm-tools/lib/asyncsocket/asyncsocket.c
open-vm-tools/lib/include/asyncsocket.h

index fe5b2c91cadba35a58a0d3940036ea51a35e2d79..b00ac212c2803f5e30849e90575ab6286a6eea31 100644 (file)
@@ -1222,6 +1222,38 @@ AsyncSocket_GetNetworkStats(AsyncSocket *asock,              // IN
 }
 
 
+/*
+ *----------------------------------------------------------------------------
+ *
+ * AsyncSocket_GetSNIHostname --
+ *
+ *      Get SNI hostname from the active socket.
+ *
+ * Results:
+ *      ASOCKERR_*
+ *
+ * Side effects:
+ *      None.
+ *
+ *----------------------------------------------------------------------------
+ */
+
+int
+AsyncSocket_GetSNIHostname(AsyncSocket *asock,          // IN
+                           const char **sniHostname)    // OUT
+{
+   int ret;
+   if (VALID(asock, getSNIHostname)) {
+      AsyncSocketLock(asock);
+      ret = VT(asock)->getSNIHostname(asock, sniHostname);
+      AsyncSocketUnlock(asock);
+   } else {
+      ret = ASOCKERR_INVAL;
+   }
+   return ret;
+}
+
+
 /*
  *----------------------------------------------------------------------------
  *
index 4c2e4fa6d3620c54c6ad1d582c3bb2641e9f8a8b..04d161a629aca642d397bce870d429b3c3582f2f 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (c) 2011,2014-2017,2019-2022 VMware, Inc. All rights reserved.
+ * Copyright (c) 2011,2014-2017,2019-2023 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -41,6 +41,8 @@
 
 /*
  * If we change the AsyncSocketVTable, we also need to change the follow files:
+ * apps/asyncSocketProxy/asyncVvcSocket.c
+ * lib/blastSockets/asyncBweSocket.c
  * lib/blastSockets/asyncProxySocket.c
  * lib/asyncsocket/asyncsocket.c
  * lib/asyncsocket/asyncWebSocket.c
@@ -108,6 +110,8 @@ typedef struct AsyncSocketVTable {
    int (*isSendBufferFull)(AsyncSocket *asock);
    int (*getNetworkStats)(AsyncSocket *asock,
                           AsyncSocketNetworkStats *stats);
+   int (*getSNIHostname)(AsyncSocket *asock,
+                         const char **sniHostname);
    int (*close)(AsyncSocket *asock);
    int (*closeWrite)(AsyncSocket *asock);
    int (*cancelRecv)(AsyncSocket *asock, int *partialRecvd, void **recvBuf,
index 26aee553a5d4942cf0d22eec3a72a498ce6822e4..4f7b1843afa1a1871afe6835c91763b06fdb684f 100644 (file)
@@ -413,6 +413,7 @@ static const AsyncSocketVTable asyncTCPSocketVTable = {
    AsyncTCPSocketSend,
    AsyncTCPSocketIsSendBufferFull,
    NULL,                        /* getNetworkStats */
+   NULL,                        /* getSNIHostname */
    AsyncTCPSocketClose,
    AsyncTCPSocketCloseWrite,
    AsyncTCPSocketCancelRecv,
index 21c2d27a448f2304667819d64d7e28ce14405cbc..57d49157071f043b5e3cd292e62aeb84f29df40d 100644 (file)
@@ -729,6 +729,8 @@ int AsyncSocket_SendWithFd(AsyncSocket *asock, void *buf, int len, int passFd,
 int AsyncSocket_IsSendBufferFull(AsyncSocket *asock);
 int AsyncSocket_GetNetworkStats(AsyncSocket *asock,
                                 AsyncSocketNetworkStats *stats);
+int AsyncSocket_GetSNIHostname(AsyncSocket *asock,
+                               const char **sniHostname);
 int AsyncSocket_CancelRecv(AsyncSocket *asock, int *partialRecvd, void **recvBuf,
                            void **recvFn);
 int AsyncSocket_CancelRecvEx(AsyncSocket *asock, int *partialRecvd, void **recvBuf,