about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2018-05-16 23:26:54 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2018-05-16 23:26:54 +0000
commit47026439e28cec53560b90f6d3e7e32c6b65c0e0 (patch)
treedbbf7018a2f0f9515199bdac099bb4a70ef86f5d /WWW/Library/Implementation
parent95c887eee01b9e2a376e18ed178e32c2bccf3ff5 (diff)
downloadlynx-snapshots-47026439e28cec53560b90f6d3e7e32c6b65c0e0.tar.gz
snapshot of project "lynx", label v2-8-9dev_18d
Diffstat (limited to 'WWW/Library/Implementation')
-rw-r--r--WWW/Library/Implementation/HTFTP.c131
-rw-r--r--WWW/Library/Implementation/HTGopher.c5
-rw-r--r--WWW/Library/Implementation/HTTCP.c25
-rw-r--r--WWW/Library/Implementation/HTTCP.h9
-rw-r--r--WWW/Library/Implementation/HTUtils.h6
-rw-r--r--WWW/Library/Implementation/SGML.c6
-rw-r--r--WWW/Library/Implementation/www_tcp.h24
7 files changed, 92 insertions, 114 deletions
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index 63c8d780..dbe278f6 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTFTP.c,v 1.132 2018/03/28 08:51:10 Gisle.Vanem Exp $
+ * $LynxId: HTFTP.c,v 1.137 2018/05/16 19:36:44 tom Exp $
  *
  *			File Transfer Protocol (FTP) Client
  *			for a WorldWideWeb browser
@@ -1156,15 +1156,11 @@ static int close_master_socket(void)
  */
 static int get_listen_socket(void)
 {
+    LY_SOCKADDR soc_A;
+
 #ifdef INET6
-    struct sockaddr_storage soc_address;	/* Binary network address */
-    struct sockaddr_in *soc_in = (struct sockaddr_in *) &soc_address;
-    int af;
+    unsigned short af;
     LY_SOCKLEN slen;
-
-#else
-    struct sockaddr_in soc_address;	/* Binary network address */
-    struct sockaddr_in *soc_in = &soc_address;
 #endif /* INET6 */
     int new_socket;		/* Will be master_socket */
 
@@ -1178,13 +1174,12 @@ static int get_listen_socket(void)
 
 #ifdef INET6
     /* query address family of control connection */
-    slen = (LY_SOCKLEN) sizeof(soc_address);
-    if (getsockname(control->socket, (struct sockaddr *) &soc_address,
-		    &slen) < 0) {
+    slen = (LY_SOCKLEN) sizeof(soc_A);
+    if (getsockname(control->socket, SOCKADDR_OF(soc_A), &slen) < 0) {
 	return HTInetStatus("getsockname failed");
     }
-    af = ((struct sockaddr *) &soc_address)->sa_family;
-    memset(&soc_address, 0, sizeof(soc_address));
+    af = SOCKADDR_OF(soc_A)->sa_family;
+    memset(&soc_A, 0, sizeof(soc_A));
 #endif /* INET6 */
 
 /*  Create internet socket
@@ -1203,25 +1198,25 @@ static int get_listen_socket(void)
 /*  Search for a free port.
 */
 #ifdef INET6
-    memset(&soc_address, 0, sizeof(soc_address));
-    ((struct sockaddr *) &soc_address)->sa_family = af;
+    memset(&soc_A, 0, sizeof(soc_A));
+    SOCKADDR_OF(soc_A)->sa_family = (unsigned short) af;
     switch (af) {
     case AF_INET:
 #ifdef SIN6_LEN
-	((struct sockaddr *) &soc_address)->sa_len = sizeof(struct sockaddr_in);
+	SOCKADDR_OF(soc_A)->sa_len = sizeof(struct sockaddr_in);
 #endif /* SIN6_LEN */
 	break;
     case AF_INET6:
 #ifdef SIN6_LEN
-	((struct sockaddr *) &soc_address)->sa_len = sizeof(struct sockaddr_in6);
+	SOCKADDR_OF(soc_A)->sa_len = sizeof(struct sockaddr_in6);
 #endif /* SIN6_LEN */
 	break;
     default:
 	HTInetStatus("AF");
     }
 #else
-    soc_in->sin_family = AF_INET;	/* Family = internet, host order  */
-    soc_in->sin_addr.s_addr = INADDR_ANY;	/* Any peer address */
+    soc_A.soc_in.sin_family = AF_INET;	/* Family = internet, host order  */
+    soc_A.soc_in.sin_addr.s_addr = INADDR_ANY;	/* Any peer address */
 #endif /* INET6 */
 #ifdef POLL_PORTS
     {
@@ -1236,23 +1231,21 @@ static int get_listen_socket(void)
 		return HTInetStatus("bind");
 	    }
 #ifdef INET6
-	    soc_in->sin_port = htons(port_number);
+	    soc_A.soc_in.sin_port = htons(port_number);
 #else
-	    soc_address.sin_port = htons(port_number);
+	    soc_A.sin_port = htons(port_number);
 #endif /* INET6 */
 #ifdef SOCKS
 	    if (socks_flag)
 		if ((status = Rbind(new_socket,
-				    (struct sockaddr *) &soc_address,
-		/* Cast to generic sockaddr */
-				    SOCKADDR_LEN(soc_address))) == 0) {
+				    SOCKADDR_OF(soc_A),
+				    SOCKADDR_LEN(soc_A))) == 0) {
 		    break;
 		} else
 #endif /* SOCKS */
 		    if ((status = bind(new_socket,
-				       (struct sockaddr *) &soc_address,
-		    /* Cast to generic sockaddr */
-				       SOCKADDR_LEN(soc_address)
+				       SOCKADDR_OF(soc_A),
+				       SOCKADDR_LEN(soc_A)
 			 )) == 0) {
 		    break;
 		}
@@ -1263,61 +1256,51 @@ static int get_listen_socket(void)
 #else
     {
 	int status;
-	LY_SOCKLEN address_length = (LY_SOCKLEN) sizeof(soc_address);
+	LY_SOCKLEN address_length = (LY_SOCKLEN) sizeof(soc_A);
 
 #ifdef SOCKS
 	if (socks_flag)
 	    status = Rgetsockname(control->socket,
-				  (struct sockaddr *) &soc_address,
+				  SOCKADDR_OF(soc_A),
 				  &address_length);
 	else
 #endif /* SOCKS */
 	    status = getsockname(control->socket,
-				 (struct sockaddr *) &soc_address,
+				 SOCKADDR_OF(soc_A),
 				 &address_length);
 	if (status < 0) {
 	    close(new_socket);
 	    return HTInetStatus("getsockname");
 	}
-#ifdef INET6
 	CTRACE((tfp, "HTFTP: This host is %s\n",
-		HTInetString((void *) soc_in)));
+		HTInetString((void *) &soc_A.soc_in)));
 
-	soc_in->sin_port = 0;	/* Unspecified: please allocate */
-#else
-	CTRACE((tfp, "HTFTP: This host is %s\n",
-		HTInetString(soc_in)));
-
-	soc_address.sin_port = 0;	/* Unspecified: please allocate */
-#endif /* INET6 */
+	soc_A.soc_in.sin_port = 0;	/* Unspecified: please allocate */
 #ifdef SOCKS
 	if (socks_flag)
 	    status = Rbind(new_socket,
-			   (struct sockaddr *) &soc_address,
-	    /* Cast to generic sockaddr */
-			   sizeof(soc_address));
+			   SOCKADDR_OF(soc_A),
+			   sizeof(soc_A));
 	else
 #endif /* SOCKS */
 	    status = bind(new_socket,
-			  (struct sockaddr *) &soc_address,
-	    /* Cast to generic sockaddr */
-			  SOCKADDR_LEN(soc_address)
-		);
+			  SOCKADDR_OF(soc_A),
+			  SOCKADDR_LEN(soc_A));
 	if (status < 0) {
 	    close(new_socket);
 	    return HTInetStatus("bind");
 	}
 
-	address_length = sizeof(soc_address);
+	address_length = sizeof(soc_A);
 #ifdef SOCKS
 	if (socks_flag)
 	    status = Rgetsockname(new_socket,
-				  (struct sockaddr *) &soc_address,
+				  SOCKADDR_OF(soc_A),
 				  &address_length);
 	else
 #endif /* SOCKS */
 	    status = getsockname(new_socket,
-				 (struct sockaddr *) &soc_address,
+				 SOCKADDR_OF(soc_A),
 				 &address_length);
 	if (status < 0) {
 	    close(new_socket);
@@ -1326,15 +1309,9 @@ static int get_listen_socket(void)
     }
 #endif /* POLL_PORTS */
 
-#ifdef INET6
-    CTRACE((tfp, "HTFTP: bound to port %d on %s\n",
-	    (int) ntohs(soc_in->sin_port),
-	    HTInetString((void *) soc_in)));
-#else
     CTRACE((tfp, "HTFTP: bound to port %d on %s\n",
-	    (int) ntohs(soc_in->sin_port),
-	    HTInetString(soc_in)));
-#endif /* INET6 */
+	    (int) ntohs(soc_A.soc_in.sin_port),
+	    HTInetString((void *) &soc_A.soc_in)));
 
 #ifdef REPEAT_LISTEN
     if (have_socket)
@@ -1347,16 +1324,16 @@ static int get_listen_socket(void)
 */
     (void) HTHostName();	/* Make address valid - doesn't work */
 #ifdef INET6
-    switch (((struct sockaddr *) &soc_address)->sa_family) {
+    switch (SOCKADDR_OF(soc_A)->sa_family) {
     case AF_INET:
 #endif /* INET6 */
 	sprintf(port_command, "PORT %d,%d,%d,%d,%d,%d%c%c",
-		(int) *((unsigned char *) (&soc_in->sin_addr) + 0),
-		(int) *((unsigned char *) (&soc_in->sin_addr) + 1),
-		(int) *((unsigned char *) (&soc_in->sin_addr) + 2),
-		(int) *((unsigned char *) (&soc_in->sin_addr) + 3),
-		(int) *((unsigned char *) (&soc_in->sin_port) + 0),
-		(int) *((unsigned char *) (&soc_in->sin_port) + 1),
+		(int) *((unsigned char *) (&soc_A.soc_in.sin_addr) + 0),
+		(int) *((unsigned char *) (&soc_A.soc_in.sin_addr) + 1),
+		(int) *((unsigned char *) (&soc_A.soc_in.sin_addr) + 2),
+		(int) *((unsigned char *) (&soc_A.soc_in.sin_addr) + 3),
+		(int) *((unsigned char *) (&soc_A.soc_in.sin_port) + 0),
+		(int) *((unsigned char *) (&soc_A.soc_in.sin_port) + 1),
 		CR, LF);
 
 #ifdef INET6
@@ -1367,8 +1344,8 @@ static int get_listen_socket(void)
 	    char hostbuf[MAXHOSTNAMELEN];
 	    char portbuf[MAXHOSTNAMELEN];
 
-	    getnameinfo((struct sockaddr *) &soc_address,
-			SOCKADDR_LEN(soc_address),
+	    getnameinfo(SOCKADDR_OF(soc_A),
+			SOCKADDR_LEN(soc_A),
 			hostbuf,
 			(socklen_t) sizeof(hostbuf),
 			portbuf,
@@ -1448,7 +1425,7 @@ static void set_years_and_date(void)
     sprintf(date, "9999%02d%.2s", i, day);
     TheDate = atoi(date);
     LYStrNCpy(ThisYear, printable + 20, 4);
-    sprintf(LastYear, "%d", (atoi(ThisYear) - 1));
+    sprintf(LastYear, "%d", (atoi(ThisYear) - 1) % 10000);
     HaveYears = TRUE;
 }
 
@@ -3359,7 +3336,7 @@ static int setup_connection(const char *name,
 		sprintf(dst, "%d.%d.%d.%d", h0, h1, h2, h3);
 	    } else if (strcmp(p, "EPSV") == 0) {
 		char c0, c1, c2, c3;
-		struct sockaddr_storage ss;
+		LY_SOCKADDR ss;
 		LY_SOCKLEN sslen;
 
 		/*
@@ -3382,13 +3359,12 @@ static int setup_connection(const char *name,
 		passive_port = (PortNumber) p0;
 
 		sslen = (LY_SOCKLEN) sizeof(ss);
-		if (getpeername(control->socket, (struct sockaddr *) &ss,
-				&sslen) < 0) {
+		if (getpeername(control->socket, SOCKADDR_OF(ss), &sslen) < 0) {
 		    fprintf(tfp, "HTFTP: getpeername(control) failed\n");
 		    status = HT_NO_CONNECTION;
 		    break;
 		}
-		if (getnameinfo((struct sockaddr *) &ss,
+		if (getnameinfo(SOCKADDR_OF(ss),
 				sslen,
 				dst,
 				(socklen_t) sizeof(dst),
@@ -4015,23 +3991,18 @@ int HTFTPLoad(const char *name,
   listen:
     if (!ftp_local_passive) {
 	/* Wait for the connection */
-#ifdef INET6
-	struct sockaddr_storage soc_address;
-
-#else
-	struct sockaddr_in soc_address;
-#endif /* INET6 */
-	LY_SOCKLEN soc_addrlen = (LY_SOCKLEN) sizeof(soc_address);
+	LY_SOCKADDR soc_A;
+	LY_SOCKLEN soc_addrlen = (LY_SOCKLEN) sizeof(soc_A);
 
 #ifdef SOCKS
 	if (socks_flag)
 	    status = Raccept((int) master_socket,
-			     (struct sockaddr *) &soc_address,
+			     SOCKADDR_OF(soc_A),
 			     &soc_addrlen);
 	else
 #endif /* SOCKS */
 	    status = accept((int) master_socket,
-			    (struct sockaddr *) &soc_address,
+			    SOCKADDR_OF(soc_A),
 			    &soc_addrlen);
 	if (status < 0) {
 	    init_help_message_cache();	/* to free memory */
diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c
index 1417d9b6..a9ad41e4 100644
--- a/WWW/Library/Implementation/HTGopher.c
+++ b/WWW/Library/Implementation/HTGopher.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTGopher.c,v 1.67 2018/05/04 22:42:37 tom Exp $
+ * $LynxId: HTGopher.c,v 1.68 2018/05/15 21:58:15 tom Exp $
  *
  *			GOPHER ACCESS				HTGopher.c
  *			=============
@@ -970,7 +970,6 @@ static int parse_cso_fields(char *buf,
 	     * Lines beginning with 5 are errors.  Print them and quit.
 	     */
 	    if (*p == '5') {
-		strcpy(buf, p);
 		return 5;
 	    }
 
@@ -1712,7 +1711,7 @@ static char *link_to_URL(const char *arg)
 	result = next + 1;
     }
     /* check if the selector is the special html one */
-    if (!strncmp(result, "hURL:", (size_t)5)) {
+    if (!strncmp(result, "hURL:", (size_t) 5)) {
 	result += 5;
 	next = result;
 	result = temp;
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index ce014ce9..4669efd4 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTTCP.c,v 1.144 2018/03/30 00:13:21 tom Exp $
+ * $LynxId: HTTCP.c,v 1.149 2018/05/16 19:48:49 tom Exp $
  *
  *			Generic Communication Code		HTTCP.c
  *			==========================
@@ -280,18 +280,20 @@ unsigned int HTCardinal(int *pstatus,
  *	returns a pointer to a static string which must be copied if
  *		it is to be kept.
  */
-const char *HTInetString(SockA * soc_in)
+const char *HTInetString(LY_SOCKADDR * soc_A)
 {
 #ifdef INET6
     static char hostbuf[MAXHOSTNAMELEN];
+    struct sockaddr *soc_addr = &(soc_A->soc_address);
 
-    getnameinfo((struct sockaddr *) soc_in,
-		SOCKADDR_LEN(soc_in),
+    getnameinfo(soc_addr,
+		SA_LEN(soc_addr),
 		hostbuf, (socklen_t) sizeof(hostbuf),
 		NULL, 0,
 		NI_NUMERICHOST);
     return hostbuf;
 #else
+    struct sockaddr_in *soc_in = &(soc_A->soc_in);
     static char string[20];
 
     sprintf(string, "%d.%d.%d.%d",
@@ -1832,8 +1834,8 @@ int HTDoConnect(const char *url,
     LYNX_ADDRINFO *res = 0, *res0 = 0;
 
 #else
-    struct sockaddr_in soc_address;
-    struct sockaddr_in *soc_in = &soc_address;
+    struct sockaddr_in sock_A;
+    struct sockaddr_in *soc_in = &sock_A;
 
     /*
      * Set up defaults.
@@ -1950,15 +1952,14 @@ int HTDoConnect(const char *url,
 #ifdef INET6
 	    status = Rconnect(*s, res->ai_addr, res->ai_addrlen);
 #else
-	    status = Rconnect(*s, (struct sockaddr *) &soc_address,
-			      sizeof(soc_address));
+	    status = Rconnect(*s, SOCKADDR_OF(sock_A), sizeof(sock_A));
 #endif /* INET6 */
 	} else
 #endif /* SOCKS */
 #ifdef INET6
 	    status = connect(*s, res->ai_addr, res->ai_addrlen);
 #else
-	    status = connect(*s, (struct sockaddr *) &soc_address, sizeof(soc_address));
+	    status = connect(*s, SOCKADDR_OF(sock_A), sizeof(sock_A));
 #endif /* INET6 */
 
 	/*
@@ -2079,8 +2080,7 @@ int HTDoConnect(const char *url,
 #ifdef INET6
 			status = connect(*s, res->ai_addr, res->ai_addrlen);
 #else
-			status = connect(*s, (struct sockaddr *) &soc_address,
-					 sizeof(soc_address));
+			status = connect(*s, SOCKADDR_OF(sock_A), sizeof(sock_A));
 #endif /* INET6 */
 #ifdef UCX
 			/*
@@ -2132,8 +2132,7 @@ int HTDoConnect(const char *url,
 #ifdef INET6
 		    status = connect(*s, res->ai_addr, res->ai_addrlen);
 #else
-		    status = connect(*s, (struct sockaddr *) &soc_address,
-				     sizeof(soc_address));
+		    status = connect(*s, SOCKADDR_OF(sock_A), sizeof(sock_A));
 #endif /* INET6 */
 		    if ((status < 0) &&
 			(SOCKET_ERRNO != EALREADY
diff --git a/WWW/Library/Implementation/HTTCP.h b/WWW/Library/Implementation/HTTCP.h
index 878053ce..a15b2903 100644
--- a/WWW/Library/Implementation/HTTCP.h
+++ b/WWW/Library/Implementation/HTTCP.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTTCP.h,v 1.25 2018/03/28 21:14:18 tom Exp $
+ * $LynxId: HTTCP.h,v 1.27 2018/05/16 19:48:16 tom Exp $
  *
  *                               /Net/dxcern/userd/timbl/hypertext/WWW/Library/src/HTTCP.html
  *                             GENERIC TCP/IP COMMUNICATION
@@ -23,12 +23,7 @@ extern "C" {
  *           returns a pointer to a static string which must be copied if
  *                it is to be kept.
  */
-#ifdef INET6
-    extern const char *HTInetString(SockA * mysin);
-
-#else
-    extern const char *HTInetString(struct sockaddr_in *mysin);
-#endif				/* INET6 */
+    extern const char *HTInetString(LY_SOCKADDR * mysin);
 
 /*      Encode INET status (as in sys/errno.h)                    inet_status()
  *      ------------------
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index 571cc17f..cffa3b6e 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTUtils.h,v 1.128 2018/03/17 15:56:11 tom Exp $
+ * $LynxId: HTUtils.h,v 1.129 2018/05/16 22:16:05 tom Exp $
  *
  * Utility macros for the W3 code library
  * MACROS FOR GENERAL USE
@@ -706,7 +706,7 @@ extern int WWW_TraceMask;
  * definitions have to be included everywhere, since they're making wrappers
  * for the stdio functions as well as the network functions.
  */
-#if defined(USE_SOCKS5) && !defined(DONT_USE_SOCKS5)
+#if defined(USE_SOCKS5)
 #define SOCKS4TO5		/* turn on the Rxxxx definitions used in Lynx */
 #include <socks.h>
 
@@ -744,6 +744,8 @@ extern int WWW_TraceMask;
 #define Rselect       select
 #endif
 
+#elif defined(SOCKS)
+#include <socks.h>
 #endif /* USE_SOCKS5 */
 
 #ifdef USE_SSL
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index fab1ad95..193e68dd 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: SGML.c,v 1.162 2018/05/11 23:46:28 tom Exp $
+ * $LynxId: SGML.c,v 1.163 2018/05/15 21:55:21 tom Exp $
  *
  *			General SGML Parser code		SGML.c
  *			========================
@@ -53,8 +53,8 @@ static char *entity_string;	/* this is used for printing entity name.
 
 				   Unconditionally added since redundant assigments don't hurt much */
 
-static void fake_put_character(void *p GCC_UNUSED,
-			       char c GCC_UNUSED)
+static void fake_put_character(HTStream *p GCC_UNUSED,
+			       int c GCC_UNUSED)
 {
 }
 
diff --git a/WWW/Library/Implementation/www_tcp.h b/WWW/Library/Implementation/www_tcp.h
index 29b47adf..8a081a5a 100644
--- a/WWW/Library/Implementation/www_tcp.h
+++ b/WWW/Library/Implementation/www_tcp.h
@@ -1,5 +1,5 @@
 /*                System dependencies in the W3 library
- * $LynxId: www_tcp.h,v 1.54 2013/07/20 14:08:29 tom Exp $
+ * $LynxId: www_tcp.h,v 1.59 2018/05/16 20:31:43 tom Exp $
  *
                                    SYSTEM DEPENDENCIES
 
@@ -970,12 +970,19 @@ typedef TYPE_FD_SET fd_set;
 #endif
 #endif /* HAVE_GETADDRINFO && ENABLE_IPV6 */
 
+typedef union {
+    struct sockaddr_in soc_in;
+    struct sockaddr soc_address;
+#ifdef INET6
+    struct sockaddr_storage soc_storage;
+#endif
+} LY_SOCKADDR;
+
 #ifdef INET6
 typedef struct sockaddr_storage SockA;
 
-#ifdef SIN6_LEN
-#define SOCKADDR_LEN(soc_address) (((struct sockaddr *)&soc_address)->sa_len)
-#else
+#define SOCKADDR_OF(param) (&((param).soc_address))
+
 #ifndef SA_LEN
 #define SA_LEN(x) (((x)->sa_family == AF_INET6) \
 		   ? sizeof(struct sockaddr_in6) \
@@ -983,12 +990,17 @@ typedef struct sockaddr_storage SockA;
 		      ? sizeof(struct sockaddr_in) \
 		      : sizeof(struct sockaddr)))	/* AF_UNSPEC? */
 #endif
-#define SOCKADDR_LEN(soc_address) (socklen_t) (SA_LEN((struct sockaddr *)&soc_address))
+
+#ifdef SIN6_LEN
+#define SOCKADDR_LEN(param) (SOCKADDR_OF(param)->sa_len)
+#else
+#define SOCKADDR_LEN(param) (socklen_t) SA_LEN(SOCKADDR_OF(param))
 #endif /* SIN6_LEN */
 #else
 typedef struct sockaddr_in SockA;
 
-#define SOCKADDR_LEN(soc_address) sizeof(soc_address)
+#define SOCKADDR_OF(param) ((struct sockaddr *)&(param))
+#define SOCKADDR_LEN(param) sizeof(param)
 #endif /* INET6 */
 
 #ifndef MAXHOSTNAMELEN