diff --git a/ap/app/zte_ping/socketHelper.c b/ap/app/zte_ping/socketHelper.c
new file mode 100755
index 0000000..098004e
--- /dev/null
+++ b/ap/app/zte_ping/socketHelper.c
@@ -0,0 +1,132 @@
+
+#include "socketHelper.h"
+#include "util.h"
+
+void close_one_socket(int sock)
+{
+	int ret;
+	if (sock != INVALID_SOCKET) {
+		ret = close(sock);
+		WARN_errno(ret == SOCKET_ERROR, "close socket failed");
+		sock = INVALID_SOCKET;
+	}
+}
+
+void SockAddr_setHostname(const char* inHostname, zping_sockaddr_t *inSockAddr)
+{
+	int rc = inet_pton(AF_INET, inHostname,
+	                   (void*) & (((struct sockaddr_in*)inSockAddr)->sin_addr));
+	inSockAddr->sin_family = AF_INET;
+	if (rc != 1) {
+		fprintf(stderr, "invalid address: %s\n", inHostname);
+		exit(1);
+	}
+}
+
+int setsock_tcp_windowsize(int inSock, int inTCPWin, int inSend)
+{
+#ifdef SO_SNDBUF
+	int rc;
+	int newTCPWin;
+
+	assert(inSock >= 0);
+
+	if (inTCPWin > 0) {
+
+#ifdef TCP_WINSHIFT
+
+		/* UNICOS requires setting the winshift explicitly */
+		if (inTCPWin > 65535) {
+			int winShift = 0;
+			int scaledWin = inTCPWin >> 16;
+			while (scaledWin > 0) {
+				scaledWin >>= 1;
+				winShift++;
+			}
+
+			/* set TCP window shift */
+			rc = setsockopt(inSock, IPPROTO_TCP, TCP_WINSHIFT,
+			                (char*) &winShift, sizeof(winShift));
+			if (rc < 0) {
+				return rc;
+			}
+
+			/* Note: you cannot verify TCP window shift, since it returns
+			 * a structure and not the same integer we use to set it. (ugh) */
+		}
+#endif /* TCP_WINSHIFT  */
+
+#ifdef TCP_RFC1323
+		/* On AIX, RFC 1323 extensions can be set system-wide,
+		 * using the 'no' network options command. But we can also set them
+		 * per-socket, so let's try just in case. */
+		if (inTCPWin > 65535) {
+			/* enable RFC 1323 */
+			int on = 1;
+			rc = setsockopt(inSock, IPPROTO_TCP, TCP_RFC1323,
+			                (char*) &on, sizeof(on));
+			if (rc < 0) {
+				return rc;
+			}
+		}
+#endif /* TCP_RFC1323 */
+
+		if (!inSend) {
+			/* receive buffer -- set
+			 * note: results are verified after connect() or listen(),
+			 * since some OS's don't show the corrected value until then. */
+			newTCPWin = inTCPWin;
+			rc = setsockopt(inSock, SOL_SOCKET, SO_RCVBUF,
+			                (char*) &newTCPWin, sizeof(newTCPWin));
+		} else {
+			/* send buffer -- set
+			 * note: results are verified after connect() or listen(),
+			 * since some OS's don't show the corrected value until then. */
+			newTCPWin = inTCPWin;
+			rc = setsockopt(inSock, SOL_SOCKET, SO_SNDBUF,
+			                (char*) &newTCPWin, sizeof(newTCPWin));
+		}
+		if (rc < 0) {
+			return rc;
+		}
+	}
+#endif /* SO_SNDBUF */
+
+	return 0;
+} /* end setsock_tcp_windowsize */
+
+const char warn_mss_fail[] = "\
+WARNING: attempt to set TCP maxmimum segment size to %d failed.\n\
+Setting the MSS may not be implemented on this OS.\n";
+
+const char warn_mss_notset[] =
+    "WARNING: attempt to set TCP maximum segment size to %d, but got %d\n";
+
+void setsock_tcp_mss(int inSock, int inMSS)
+{
+#ifdef TCP_MAXSEG
+	int rc;
+	int newMSS;
+	int len;
+
+	assert(inSock != INVALID_SOCKET);
+
+	if (inMSS > 0) {
+		/* set */
+		newMSS = inMSS;
+		len = sizeof(newMSS);
+		rc = setsockopt(inSock, IPPROTO_TCP, TCP_MAXSEG, (char*) &newMSS,  len);
+		if (rc == SOCKET_ERROR) {
+			fprintf(stderr, warn_mss_fail, newMSS);
+			return;
+		}
+
+		/* verify results */
+		rc = getsockopt(inSock, IPPROTO_TCP, TCP_MAXSEG, (char*) &newMSS, &len);
+		WARN_errno(rc == SOCKET_ERROR, "getsockopt TCP_MAXSEG");
+		if (newMSS != inMSS) {
+			fprintf(stderr, warn_mss_notset, inMSS, newMSS);
+		}
+	}
+#endif
+} /* end setsock_tcp_mss */
