}
+/*
+ *----------------------------------------------------------------------------
+ *
+ * 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;
+}
+
+
/*
*----------------------------------------------------------------------------
*
/*********************************************************
- * 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
/*
* 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
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,
AsyncTCPSocketSend,
AsyncTCPSocketIsSendBufferFull,
NULL, /* getNetworkStats */
+ NULL, /* getSNIHostname */
AsyncTCPSocketClose,
AsyncTCPSocketCloseWrite,
AsyncTCPSocketCancelRecv,
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,