[Ttssh2-commit] [6738] NO_INET6 マクロを削除

svnno****@sourc***** svnno****@sourc*****
2017年 5月 20日 (土) 15:38:01 JST


Revision: 6738
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6738
Author:   maya
Date:     2017-05-20 15:38:01 +0900 (Sat, 20 May 2017)
Log Message:
-----------
NO_INET6 マクロを削除

Modified Paths:
--------------
    trunk/teraterm/common/teraterm.h
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/commlib.c
    trunk/teraterm/teraterm/ttwsk.c
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/ttpdlg/ttdlg.c
    trunk/teraterm/ttpset/ttset.c
    trunk/ttssh2/ttxssh/fwd.c
    trunk/ttssh2/ttxssh/fwd.h
    trunk/ttssh2/ttxssh/ttxssh.c
    trunk/ttssh2/ttxssh/ttxssh.h

-------------- next part --------------
Modified: trunk/teraterm/common/teraterm.h
===================================================================
--- trunk/teraterm/common/teraterm.h	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/teraterm/common/teraterm.h	2017-05-20 06:38:01 UTC (rev 6738)
@@ -5,11 +5,9 @@
 
 #pragma once
 
-#ifndef NO_INET6
 #ifndef _WINSOCKAPI_
 #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */
 #endif /* _WINSOCKAPI_ */
-#endif /* NO_INET6 */
 #include <windows.h>
 
 /* _MSC_VER \x82̒l

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/teraterm/common/tttypes.h	2017-05-20 06:38:01 UTC (rev 6738)
@@ -131,9 +131,7 @@
 
 #define HostNameMaxLength 1024
 //#define HostNameMaxLength 80
-#ifndef NO_INET6
 #define ProtocolFamilyMaxLength 80
-#endif /* NO_INET6 */
 
   /* internal WM_USER messages */
 #define WM_USER_ACCELCOMMAND WM_USER+1
@@ -488,10 +486,8 @@
 	WORD EnableContinuedLineCopy;
 #endif /* NO_COPYLINE_FIX */
 	COLORREF ANSIColor[16];
-#ifndef NO_INET6
 	/* protocol used in connect() */
 	int ProtocolFamily;
-#endif /* NO_INET6 */
   char MouseCursorName[16];
 	int AlphaBlend;
 	char CygwinDirectory[MAX_PATH];
@@ -755,9 +751,7 @@
 	WORD Telnet; // non-zero: enable telnet
 	WORD TelPort; // default TCP port# for telnet
 	WORD TCPPort; // TCP port #
-#ifndef NO_INET6
 	WORD ProtocolFamily; // Protocol Family (AF_INET/AF_INET6/AF_UNSPEC)
-#endif /* NO_INET6 */
 	WORD ComPort; // serial port #
 	WORD MaxComPort; // max serial port #
 } TGetHNRec;
@@ -1013,12 +1007,10 @@
 	BOOL ProtoFlag;
 	/* message flag */
 	WORD NoMsg;
-#ifndef NO_INET6
 	/* if TRUE, teraterm trys to connect other protocol family */
 	BOOL RetryWithOtherProtocol;
 	struct addrinfo FAR * res0;
 	struct addrinfo FAR * res;
-#endif /* NO_INET6 */
 	char *Locale;
 	int *CodePage;
 	int *ConnetingTimeout;

Modified: trunk/teraterm/teraterm/commlib.c
===================================================================
--- trunk/teraterm/teraterm/commlib.c	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/teraterm/teraterm/commlib.c	2017-05-20 06:38:01 UTC (rev 6738)
@@ -16,15 +16,12 @@
 #include "ttplug.h" /* TTPLUG */
 
 #include "commlib.h"
-#ifndef NO_INET6
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#endif /* NO_INET6 */
 #include <stdio.h> /* for _snprintf() */
 #include <time.h>
 #include <locale.h>
 
-#ifndef NO_INET6
 static SOCKET OpenSocket(PComVar);
 static void AsyncConnect(PComVar);
 static int CloseSocket(SOCKET);
@@ -74,7 +71,6 @@
 {
 	return Pclosesocket(s);
 }
-#endif /* NO_INET6 */
 
 #define CommInQueSize 8192
 #define CommOutQueSize 2048
@@ -258,26 +254,14 @@
 
 void CommOpen(HWND HW, PTTSet ts, PComVar cv)
 {
-#ifdef NO_INET6
-	int Err;
-#endif /* NO_INET6 */
 	char ErrMsg[21+256];
 	char P[50+256];
 
 	MSG Msg;
-#ifndef NO_INET6
 	ADDRINFO hints;
 	char pname[NI_MAXSERV];
-#else
-	char HEntBuff[MAXGETHOSTSTRUCT];
-	u_long addr;
-	SOCKADDR_IN saddr;
-#endif /* NO_INET6 */
 
 	BOOL InvalidHost;
-#ifdef NO_INET6
-	BOOL BBuf;
-#endif /* NO_INET6 */
 
 	char uimsg[MAX_UIMSG];
 
@@ -299,9 +283,7 @@
 	cv->PortType = ts->PortType;
 	cv->ComPort = 0;
 	cv->RetryCount = 0;
-#ifndef NO_INET6
 	cv->RetryWithOtherProtocol = TRUE;
-#endif /* NO_INET6 */
 	cv->s = INVALID_SOCKET;
 	cv->ComID = INVALID_HANDLE_VALUE;
 	cv->CanSend = TRUE;
@@ -365,7 +347,6 @@
 			else {
 				TTXOpenTCP(); /* TTPLUG */
 				cv->Open = TRUE;
-#ifndef NO_INET6
 				/* resolving address */
 				memset(&hints, 0, sizeof(hints));
 				hints.ai_family = ts->ProtocolFamily;
@@ -430,105 +411,7 @@
 				break; /* break for-loop immediately */
 			}
 			break;
-#else
-	if ((ts->HostName[0] >= 0x30) && (ts->HostName[0] <= 0x39))
-	{
-	  addr = Pinet_addr(ts->HostName);
-	  InvalidHost = (addr == 0xffffffff);
-	}
-	else {
-	  HAsync = PWSAAsyncGetHostByName(HW,WM_USER_GETHOST,
-	  ts->HostName,HEntBuff,sizeof(HEntBuff));
-	  if (HAsync == 0)
-	    InvalidHost = TRUE;
-	  else {
-	    cv->ComPort = 1; // set "getting host" flag
-			     //  (see CVTWindow::OnSysCommand())
-	    do {
-	      if (GetMessage(&Msg,0,0,0))
-	      {
-		if ((Msg.hwnd==HW) &&
-		    ((Msg.message == WM_SYSCOMMAND) &&
-		     ((Msg.wParam & 0xfff0) == SC_CLOSE) ||
-		     (Msg.message == WM_COMMAND) &&
-		     (LOWORD(Msg.wParam) == ID_FILE_EXIT) ||
-		     (Msg.message == WM_CLOSE)))
-		{ /* Exit when the user closes Tera Term */
-		  PWSACancelAsyncRequest(HAsync);
-		  HAsync = 0;
-		  cv->ComPort = 0; // clear "getting host" flag
-		  PostMessage(HW,Msg.message,Msg.wParam,Msg.lParam);
-		  return;
-		}
-		if (Msg.message != WM_USER_GETHOST)
-		{ /* Prosess messages */
-		  TranslateMessage(&Msg);
-		  DispatchMessage(&Msg);
-		}
-	      }
-	      else {
-		return;
-	      }
-	    } while (Msg.message!=WM_USER_GETHOST);
-	    cv->ComPort = 0; // clear "getting host" flag
-	    HAsync = 0;
-	    InvalidHost = WSAGETASYNCERROR(Msg.lParam) != 0;
-	    if (! InvalidHost)
-	    {
-	      if (((PHOSTENT)HEntBuff)->h_addr_list != NULL)
-		memcpy(&addr,
-		  ((PHOSTENT)HEntBuff)->h_addr_list[0],sizeof(addr));
-	      else
-		InvalidHost = TRUE;
-	    }
-	  }
 
-	}
-
-	if (InvalidHost)
-	{
-	  if (cv->NoMsg==0) {
-	    get_lang_msg("MSG_TT_ERROR", uimsg, sizeof(uimsg), "Tera Term: Error", ts->UILanguageFile);
-	    get_lang_msg("MSG_INVALID_HOST_ERROR", ts->UIMsg, sizeof(ts->UIMsg), "Invalid host", ts->UILanguageFile);
-	    MessageBox(cv->HWin, ts->UIMsg, uimsg, MB_TASKMODAL | MB_ICONEXCLAMATION);
-	  }
-	}
-	else {
-	  cv->s= Psocket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
-	  if (cv->s==INVALID_SOCKET)
-	  {
-	    InvalidHost = TRUE;
-	    if (cv->NoMsg==0) {
-	      get_lang_msg("MSG_TT_ERROR", uimsg, sizeof(uimsg), "Tera Term: Error", ts->UILanguageFile);
-	      get_lang_msg("MSG_COMM_TIMEOUT_ERROR", ts->UIMsg, sizeof(ts->UIMsg), "Cannot connect the host", ts->UILanguageFile);
-	      MessageBox(cv->HWin, ts->UIMsg, uimsg, MB_TASKMODAL | MB_ICONEXCLAMATION);
-	    }
-	  }
-	  else {
-	    BBuf = TRUE;
-	    Psetsockopt(cv->s,(int)SOL_SOCKET,SO_OOBINLINE,(char FAR *)&BBuf,sizeof(BBuf));
-
-	    PWSAAsyncSelect(cv->s,cv->HWin,WM_USER_COMMOPEN, FD_CONNECT);
-	    saddr.sin_family = AF_INET;
-	    saddr.sin_port = Phtons(ts->TCPPort);
-	    saddr.sin_addr.s_addr = addr;
-	    memset(saddr.sin_zero,0,8);
-
-	    Err = Pconnect(cv->s,(LPSOCKADDR)&saddr,sizeof(saddr));
-	    if (Err!=0 ) Err = PWSAGetLastError();
-	    if (Err==WSAEWOULDBLOCK )
-	    {
-	      /* Do nothing */
-	    }
-	    else if (Err!=0 )
-	      PostMessage(cv->HWin, WM_USER_COMMOPEN,0,
-			  MAKELONG(FD_CONNECT,Err));
-	  }
-	}
-      }
-      break;
-#endif /* NO_INET6 */
-
 		case IdSerial:
 			InitFileIO(IdSerial);  /* TTPLUG */
 			TTXOpenFile(); /* TTPLUG */
@@ -630,9 +513,7 @@
 
 	} /* end of "switch" */
 
-#ifndef NO_INET6
 BreakSC:
-#endif /* NO_INET6 */
 	if (InvalidHost) {
 		PostMessage(cv->HWin, WM_USER_COMMNOTIFY, 0, FD_CLOSE);
 		if ( (ts->PortType==IdTCPIP) && cv->Open ) {
@@ -757,7 +638,6 @@
 					_snprintf_s(ErrMsg, sizeof(ErrMsg), _TRUNCATE, "%s", ts->UIMsg);
 			}
 			if (HIWORD(lParam)>0) {
-#ifndef NO_INET6
 				/* connect() failed */
 				if (cv->res->ai_next != NULL) {
 					/* try to connect with other protocol */
@@ -784,20 +664,10 @@
 					cv->RetryWithOtherProtocol = FALSE;
 					return;
 				}
-#else
-	if (cv->NoMsg==0) {
-	  get_lang_msg("MSG_TT_ERROR", uimsg, sizeof(uimsg), "Tera Term: Error", ts->UILanguageFile);
-	  MessageBox(cv->HWin, ErrMsg, uimsg, MB_TASKMODAL | MB_ICONEXCLAMATION);
-	}
-	PostMessage(cv->HWin, WM_USER_COMMNOTIFY, 0, FD_CLOSE);
-	return;
-#endif /* NO_INET6 */
 			}
 
-#ifndef NO_INET6
 			/* here is connection established */
 			cv->RetryWithOtherProtocol = FALSE;
-#endif /* NO_INET6 */
 			PWSAAsyncSelect(cv->s,cv->HWin,WM_USER_COMMNOTIFY, FD_READ | FD_OOB | FD_CLOSE);
 			TCPIPClosed = FALSE;
 			break;
@@ -891,9 +761,7 @@
 				PWSACancelAsyncRequest(HAsync);
 			}
 			HAsync = 0;
-#ifndef NO_INET6
 			Pfreeaddrinfo(cv->res0);
-#endif /* NO_INET6 */
 			if ( cv->s!=INVALID_SOCKET ) {
 				Pclosesocket(cv->s);
 			}

Modified: trunk/teraterm/teraterm/ttwsk.c
===================================================================
--- trunk/teraterm/teraterm/ttwsk.c	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/teraterm/teraterm/ttwsk.c	2017-05-20 06:38:01 UTC (rev 6738)
@@ -6,9 +6,7 @@
 
 #include "teraterm.h"
 #include "ttwsk.h"
-#ifndef NO_INET6
 #include "WSAAsyncGetAddrInfo.h"
-#endif /* NO_INET6 */
 
 static HANDLE HWinsock = NULL;
 
@@ -152,13 +150,11 @@
     PWSACleanup = (TWSACleanup)GetProcAddress(HWinsock, MAKEINTRESOURCE(IdWSACLEANUP));
     if (PWSACleanup==NULL) Err = TRUE;
 
-#ifndef NO_INET6
 //    Pgetaddrinfo = (Tgetaddrinfo)GetProcAddress(HWinsock, "getaddrinfo");
 //    if (Pgetaddrinfo==NULL) Err = TRUE;
 
     Pfreeaddrinfo = freeaddrinfo;
     PWSAAsyncGetAddrInfo = WSAAsyncGetAddrInfo;
-#endif /* NO_INET6 */
 
     if (Err)
     {

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/teraterm/teraterm/vtwin.cpp	2017-05-20 06:38:01 UTC (rev 6738)
@@ -29,12 +29,8 @@
 #include "ttlib.h"
 #include "helpid.h"
 #include "teraprn.h"
-#ifndef NO_INET6
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#else
-#include <winsock.h>
-#endif /* NO_INET6 */
 #include "ttplug.h"  /* TTPLUG */
 
 #include <stdio.h>
@@ -3643,7 +3639,6 @@
 	AutoDisconnectedPort = -1;
 
 	CommStart(&cv,lParam,&ts);
-#ifndef NO_INET6
 	if (ts.PortType == IdTCPIP && cv.RetryWithOtherProtocol == TRUE) {
 		Connecting = TRUE;
 	}
@@ -3650,9 +3645,7 @@
 	else {
 		Connecting = FALSE;
 	}
-#else
-	Connecting = FALSE;
-#endif /* NO_INET6 */
+
 	ChangeTitle();
 	if (! cv.Ready) {
 		return 0;
@@ -3853,9 +3846,7 @@
 	GetHNRec.Telnet = ts.Telnet;
 	GetHNRec.TelPort = ts.TelPort;
 	GetHNRec.TCPPort = ts.TCPPort;
-#ifndef NO_INET6
 	GetHNRec.ProtocolFamily = ts.ProtocolFamily;
-#endif /* NO_INET6 */
 	GetHNRec.ComPort = ts.ComPort;
 	GetHNRec.MaxComPort = ts.MaxComPort;
 
@@ -3881,9 +3872,7 @@
 			ts.PortType = GetHNRec.PortType;
 			ts.Telnet = GetHNRec.Telnet;
 			ts.TCPPort = GetHNRec.TCPPort;
-#ifndef NO_INET6
 			ts.ProtocolFamily = GetHNRec.ProtocolFamily;
-#endif /* NO_INET6 */
 			ts.ComPort = GetHNRec.ComPort;
 
 			if ((GetHNRec.PortType==IdTCPIP) &&
@@ -3924,7 +3913,6 @@
 					_snprintf_s(tcpport, sizeof(tcpport), _TRUNCATE, "%d", GetHNRec.TCPPort);
 					strncat_s(Command,sizeof(Command),tcpport,_TRUNCATE);
 				}
-#ifndef NO_INET6
 				/********************************/
 				/* \x82\xB1\x82\xB1\x82Ƀv\x83\x8D\x83g\x83R\x83\x8B\x8F\x88\x97\x9D\x82\xF0\x93\xFC\x82\xEA\x82\xE9 */
 				/********************************/
@@ -3933,7 +3921,6 @@
 				} else if (GetHNRec.ProtocolFamily == AF_INET6) {
 					strncat_s(Command,sizeof(Command)," /6",_TRUNCATE);
 				}
-#endif /* NO_INET6 */
 				strncat_s(Command,sizeof(Command)," ",_TRUNCATE);
 				strncat_s(Command,sizeof(Command),Command2,_TRUNCATE);
 			}

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2017-05-20 06:38:01 UTC (rev 6738)
@@ -24,10 +24,8 @@
 #include "oniguruma.h"
 #undef ONIG_EXTERN
 
-#ifndef NO_INET6
 #include <winsock2.h>
 static char FAR * ProtocolFamilyList[] = { "UNSPEC", "IPv6", "IPv4", NULL };
-#endif /* NO_INET6 */
 
 #undef EFFECT_ENABLED	// \x83G\x83t\x83F\x83N\x83g\x82̗L\x8C\xF8\x89”\xDB
 #undef TEXTURE_ENABLED	// \x83e\x83N\x83X\x83`\x83\x83\x82̗L\x8C\xF8\x89”\xDB
@@ -2054,7 +2052,6 @@
 			SetRB(Dialog,GetHNRec->Telnet,IDC_HOSTTELNET,IDC_HOSTTELNET);
 			SendDlgItemMessage(Dialog, IDC_HOSTTCPPORT, EM_LIMITTEXT,5,0);
 			SetDlgItemInt(Dialog,IDC_HOSTTCPPORT,GetHNRec->TCPPort,FALSE);
-#ifndef NO_INET6
 			for (i=0; ProtocolFamilyList[i]; ++i) {
 				SendDlgItemMessage(Dialog, IDC_HOSTTCPPROTOCOL, CB_ADDSTRING,
 				                   0, (LPARAM)ProtocolFamilyList[i]);
@@ -2062,9 +2059,7 @@
 			SendDlgItemMessage(Dialog, IDC_HOSTTCPPROTOCOL, EM_LIMITTEXT,
 			                   ProtocolFamilyMaxLength-1, 0);
 			SendDlgItemMessage(Dialog, IDC_HOSTTCPPROTOCOL, CB_SETCURSEL,0,0);
-#endif /* NO_INET6 */
 
-
 			j = 0;
 			w = 1;
 			if ((comports=DetectComPorts(ComPortTable, GetHNRec->MaxComPort, ComPortDesc)) >= 0) {
@@ -2119,16 +2114,9 @@
 			if ( GetHNRec->PortType==IdTCPIP ) {
 				DisableDlgItem(Dialog,IDC_HOSTCOMLABEL,IDC_HOSTCOM);
 			}
-#ifndef INET6
 			else {
 				DisableDlgItem(Dialog,IDC_HOSTNAMELABEL,IDC_HOSTTCPPORT);
 			}
-#else
-			else {
-				DisableDlgItem(Dialog,IDC_HOSTNAMELABEL,IDC_HOSTTCPPORT);
-				DisableDlgItem(Dialog,IDC_HOSTTCPPROTOCOLLABEL,IDC_HOSTTCPPROTOCOL);
-			}
-#endif /* NO_INET6 */
 
 			return TRUE;
 
@@ -2137,9 +2125,7 @@
 				case IDOK:
 					GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER);
 					if ( GetHNRec!=NULL ) {
-#ifndef NO_INET6
 						char afstr[BUFSIZ];
-#endif /* NO_INET6 */
 						GetRB(Dialog,&GetHNRec->PortType,IDC_HOSTTCPIP,IDC_HOSTSERIAL);
 						if ( GetHNRec->PortType==IdTCPIP ) {
 							GetDlgItemText(Dialog, IDC_HOSTNAME, GetHNRec->HostName, HostNameMaxLength);
@@ -2152,7 +2138,6 @@
 						if (Ok) {
 							GetHNRec->TCPPort = i;
 						}
-#ifndef NO_INET6
 #define getaf(str) \
 	((strcmp((str), "IPv6") == 0) ? AF_INET6 : \
 	((strcmp((str), "IPv4") == 0) ? AF_INET : AF_UNSPEC))
@@ -2159,7 +2144,6 @@
 						memset(afstr, 0, sizeof(afstr));
 						GetDlgItemText(Dialog, IDC_HOSTTCPPROTOCOL, afstr, sizeof(afstr));
 						GetHNRec->ProtocolFamily = getaf(afstr);
-#endif /* NO_INET6 */
 						memset(EntName,0,sizeof(EntName));
 						GetDlgItemText(Dialog, IDC_HOSTCOM, EntName, sizeof(EntName)-1);
 						if (strncmp(EntName, "COM", 3) == 0 && EntName[3] != '\0') {
@@ -2195,9 +2179,7 @@
 
 				case IDC_HOSTTCPIP:
 					EnableDlgItem(Dialog,IDC_HOSTNAMELABEL,IDC_HOSTTCPPORT);
-#ifndef NO_INET6
 					EnableDlgItem(Dialog,IDC_HOSTTCPPROTOCOLLABEL,IDC_HOSTTCPPROTOCOL);
-#endif /* NO_INET6 */
 					DisableDlgItem(Dialog,IDC_HOSTCOMLABEL,IDC_HOSTCOM);
 					return TRUE;
 
@@ -2204,9 +2186,7 @@
 				case IDC_HOSTSERIAL:
 					EnableDlgItem(Dialog,IDC_HOSTCOMLABEL,IDC_HOSTCOM);
 					DisableDlgItem(Dialog,IDC_HOSTNAMELABEL,IDC_HOSTTCPPORT);
-#ifndef NO_INET6
 					DisableDlgItem(Dialog,IDC_HOSTTCPPROTOCOLLABEL,IDC_HOSTTCPPROTOCOL);
-#endif /* NO_INET6 */
 					break;
 
 				case IDC_HOSTTELNET:

Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/teraterm/ttpset/ttset.c	2017-05-20 06:38:01 UTC (rev 6738)
@@ -4,10 +4,8 @@
 /* IPv6 modification is Copyright(C) 2000 Jun-ya kato <kato****@win6*****> */
 
 /* TTSET.DLL, setup file routines*/
-#ifndef NO_INET6
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#endif							/* NO_INET6 */
 #include "teraterm.h"
 #include "tttypes.h"
 #include <stdio.h>
@@ -3615,7 +3613,6 @@
 	return (strlen(Temp) > 0);
 }
 #endif
-#ifndef NO_INET6
 static void ParseHostName(char *HostStr, WORD * port)
 {
 	/*
@@ -3700,7 +3697,6 @@
 		*port = 23;
 	}
 }
-#endif							/* NO_INET6 */
 
 
 void FAR PASCAL ParseParam(PCHAR Param, PTTSet ts, PCHAR DDETopic)
@@ -3707,9 +3703,6 @@
 {
 	int i, pos, c;
 	//int param_top;
-#ifdef NO_INET6
-	BYTE b;
-#endif							/* NO_INET6 */
 	char Temp[MaxStrLen]; // ttpmacro\x82\xA9\x82\xE7\x8CĂ΂\xEA\x82邱\x82Ƃ\xF0\x91z\x92肵MaxStrLen\x83T\x83C\x83Y\x82Ƃ\xB7\x82\xE9
 	char Temp2[MaxStrLen];
 	char TempDir[MAXPATHLEN];
@@ -3729,11 +3722,6 @@
 	/* Set AutoConnect true as default (2008.2.16 by steven)*/
 	ts->ComAutoConnect = TRUE;
 
-#ifndef NO_INET6
-	/* user specifies the protocol connecting to the host */
-	/* ts->ProtocolFamily = AF_UNSPEC; */
-#endif							/* NO_INET6 */
-
 	/* Get command line parameters */
 	if (DDETopic != NULL)
 		DDETopic[0] = 0;
@@ -3947,12 +3935,10 @@
 					ts->VTPos.x = 0;
 			}
 		}
-#ifndef NO_INET6
 		else if (_stricmp(Temp, "/4") == 0)	/* Protocol Tera Term speaking */
 			ts->ProtocolFamily = AF_INET;
 		else if (_stricmp(Temp, "/6") == 0)
 			ts->ProtocolFamily = AF_INET6;
-#endif
 		else if (_stricmp(Temp, "/DUPLICATE") == 0) {	// duplicate session (2004.12.7. yutaka)
 			ts->DuplicateSession = 1;
 
@@ -3995,28 +3981,7 @@
 		ts->MacroFN[0] = 0;
 
 	if ((ts->HostName[0] != 0) && (ParamPort == IdTCPIP)) {
-#ifndef NO_INET6
 		ParseHostName(ts->HostName, &ParamTCP);
-#else							/* NO_INET6 */
-		if ((_strnicmp(ts->HostName, "telnet://", 9) == 0) ||
-		    (_strnicmp(ts->HostName, "tn3270://", 9) == 0)) {
-			memmove(ts->HostName, &(ts->HostName[9]),
-			        strlen(ts->HostName) - 8);
-			i = strlen(ts->HostName);
-			if ((i > 0) && (ts->HostName[i - 1] == '/'))
-				ts->HostName[i - 1] = 0;
-		}
-		i = 0;
-		do {
-			b = ts->HostName[i];
-			i++;
-		} while ((b != 0) && (b != ':'));
-		if (b == ':') {
-			ts->HostName[i - 1] = 0;
-			if (sscanf(&(ts->HostName[i]), "%d", &ParamTCP) != 1)
-				ParamTCP = 0;
-		}
-#endif							/* NO_INET6 */
 	}
 
 	switch (ParamPort) {

Modified: trunk/ttssh2/ttxssh/fwd.c
===================================================================
--- trunk/ttssh2/ttxssh/fwd.c	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/ttssh2/ttxssh/fwd.c	2017-05-20 06:38:01 UTC (rev 6738)
@@ -40,9 +40,7 @@
 #include "ttcommon.h"
 
 #include <assert.h>
-#ifndef NO_INET6
 #include "WSAAsyncGetAddrInfo.h"
-#endif							/* NO_INET6 */
 
 #define WM_SOCK_ACCEPT (WM_APP+9999)
 #define WM_SOCK_IO     (WM_APP+9998)
@@ -56,14 +54,11 @@
 static int find_request_num(PTInstVar pvar, SOCKET s)
 {
 	int i;
-#ifndef NO_INET6
 	int j;
-#endif							/* NO_INET6 */
 
 	if (s == INVALID_SOCKET)
 		return -1;
 
-#ifndef NO_INET6
 	for (i = 0; i < pvar->fwd_state.num_requests; i++) {
 		for (j = 0; j < pvar->fwd_state.requests[i].num_listening_sockets;
 			 ++j) {
@@ -73,14 +68,6 @@
 			}
 		}
 	}
-#else
-	for (i = 0; i < pvar->fwd_state.num_requests; i++) {
-		if ((pvar->fwd_state.requests[i].status & FWD_DELETED) == 0
-			&& pvar->fwd_state.requests[i].listening_socket == s) {
-			return i;
-		}
-	}
-#endif							/* NO_INET6 */
 
 	return -1;
 }
@@ -119,7 +106,6 @@
 	return -1;
 }
 
-#ifndef NO_INET6
 static int find_listening_socket_num(PTInstVar pvar, int request_num,
                                      SOCKET s)
 {
@@ -133,7 +119,6 @@
 	/* not found */
 	return -1;
 }
-#endif							/* NO_INET6 */
 
 static void drain_matching_messages(HWND wnd, UINT msg, WPARAM wParam)
 {
@@ -222,15 +207,10 @@
 
 static void request_error(PTInstVar pvar, int request_num, int err)
 {
-#ifndef NO_INET6
 	SOCKET FAR *s =
 		pvar->fwd_state.requests[request_num].listening_sockets;
 	int i;
-#else
-	SOCKET s = pvar->fwd_state.requests[request_num].listening_socket;
-#endif							/* NO_INET6 */
 
-#ifndef NO_INET6
 	for (i = 0;
 	     i < pvar->fwd_state.requests[request_num].num_listening_sockets;
 	     ++i) {
@@ -240,13 +220,6 @@
 				INVALID_SOCKET;
 		}
 	}
-#else
-	if (s != INVALID_SOCKET) {
-		safe_closesocket(pvar, s);
-		pvar->fwd_state.requests[request_num].listening_socket =
-			INVALID_SOCKET;
-	}
-#endif							/* NO_INET6 */
 
 	UTIL_get_lang_msg("MSG_FWD_REQUEST_ERROR", pvar,
 	                  "Communications error while listening for a connection to forward.\n"
@@ -288,13 +261,9 @@
 		safe_WSACancelAsyncRequest(pvar, request->to_host_lookup_handle);
 		request->to_host_lookup_handle = 0;
 	}
-#ifndef NO_INET6
+
   /*****/
 	/* freeaddrinfo(); */
-#else
-	free(request->to_host_hostent_buf);
-	request->to_host_hostent_buf = NULL;
-#endif							/* NO_INET6 */
 }
 
 void FWD_free_channel(PTInstVar pvar, uint32 local_channel_num)
@@ -586,7 +555,7 @@
 	FWDChannel FAR *channel = pvar->fwd_state.channels + channel_num;
 	FWDRequest FAR *request =
 		pvar->fwd_state.requests + channel->request_num;
-#ifndef NO_INET6
+
 	for (channel->to_host_addrs = request->to_host_addrs;
 	     channel->to_host_addrs;
 	     channel->to_host_addrs = channel->to_host_addrs->ai_next) {
@@ -619,74 +588,30 @@
 	}
 
 	channel_opening_error(pvar, channel_num, WSAGetLastError());
-#else
-	struct sockaddr_in addr;
-
-	addr.sin_family = AF_INET;
-	addr.sin_port = htons((unsigned short) request->spec.to_port);
-	addr.sin_addr.s_addr = htonl(request->to_host_addr);
-
-	if ((channel->local_socket =
-	     socket(AF_INET, SOCK_STREAM, 0)) != INVALID_SOCKET
-	  && WSAAsyncSelect(channel->local_socket, make_accept_wnd(pvar),
-	                    WM_SOCK_IO,
-	                    FD_CONNECT | FD_READ | FD_CLOSE | FD_WRITE) !=
-	     SOCKET_ERROR) {
-		if (connect
-		    (channel->local_socket, (struct sockaddr FAR *) &addr,
-		     sizeof(addr)) != SOCKET_ERROR) {
-			connected_local_connection(pvar, channel_num);
-			return;
-		} else if (WSAGetLastError() == WSAEWOULDBLOCK) {
-			/* do nothing, we'll just wait */
-			return;
-		}
-	}
-
-	channel_opening_error(pvar, channel_num, WSAGetLastError());
-#endif							/* NO_INET6 */
 }
 
-#ifndef NO_INET6
 static void accept_local_connection(PTInstVar pvar, int request_num,
                                     int listening_socket_num)
 {
-#else
-static void accept_local_connection(PTInstVar pvar, int request_num)
-{
-#endif							/* NO_INET6 */
 	int channel_num;
 	SOCKET s;
-#ifndef NO_INET6
 	struct sockaddr_storage addr;
 	char hname[NI_MAXHOST];
 	char strport[NI_MAXSERV]; // ws2tcpip.h
-#else
-	struct sockaddr addr;
-#endif							/* NO_INET6 */
 	int addrlen = sizeof(addr);
 	char buf[1024];
-#ifndef INET6
 	BYTE FAR *IP;
-#endif							/* NO_INET6 */
 	FWDChannel FAR *channel;
 	FWDRequest FAR *request = &pvar->fwd_state.requests[request_num];
 	BOOL is_localhost = FALSE;
 
-#ifndef NO_INET6
 	s = accept(request->listening_sockets[listening_socket_num],
 	           (struct sockaddr FAR *) &addr, &addrlen);
-#else
-	s = accept(request->listening_socket, &addr, &addrlen);
-#endif							/* NO_INET6 */
 	if (s == INVALID_SOCKET)
 		return;
 
-#ifndef INET6
 	IP = (BYTE FAR *) & ((struct sockaddr_in *) (&addr))->sin_addr.s_addr;
-#endif
 
-#ifndef NO_INET6
 	// SSH2 port-forwarding\x82ɐڑ\xB1\x8C\xB3\x82̃\x8A\x83\x82\x81[\x83g\x83|\x81[\x83g\x82\xAA\x95K\x97v\x81B(2005.2.27 yutaka)
 	if (getnameinfo
 	    ((struct sockaddr FAR *) &addr, addrlen, hname, sizeof(hname),
@@ -697,21 +622,9 @@
 	          "Host %s connecting to port %d; forwarding to %s:%d",
 	          hname, request->spec.from_port, request->spec.to_host,
 	          request->spec.to_port);
-#else
-	_snprintf(buf, sizeof(buf),
-	          "Host %d.%d.%d.%d connecting to port %d; forwarding to %s:%d",
-	          IP[0], IP[1], IP[2], IP[3], request->spec.from_port,
-	          request->spec.to_host, request->spec.to_port);
-	buf[NUM_ELEM(buf) - 1] = 0;
-#endif							/* NO_INET6 */
 	notify_verbose_message(pvar, buf, LOG_LEVEL_VERBOSE);
 
-#ifndef NO_INET6
 	strncpy_s(buf, sizeof(buf), hname, _TRUNCATE);
-#else
-	_snprintf(buf, sizeof(buf), "%d.%d.%d.%d", IP[0], IP[1], IP[2], IP[3]);
-	buf[NUM_ELEM(buf) - 1] = 0;
-#endif
 
 	channel_num = alloc_channel(pvar, FWD_LOCAL_CONNECTED, request_num);
 	channel = pvar->fwd_state.channels + channel_num;
@@ -809,13 +722,6 @@
 {
 	int i;
 
-#ifdef NO_INET6
-	pvar->fwd_state.requests[request_num].to_host_addr =
-		ntohl(*(uint32 FAR *)
-			  ((HOSTENT FAR *) pvar->fwd_state.requests[request_num].
-			   to_host_hostent_buf)->h_addr_list[0]);
-#endif							/* NO_INET6 */
-
 	for (i = 0; i < pvar->fwd_state.num_channels; i++) {
 		if (pvar->fwd_state.channels[i].request_num == request_num) {
 			make_local_connection(pvar, i);
@@ -844,12 +750,9 @@
 			if (HIWORD(lParam) != 0) {
 				request_error(pvar, request_num, HIWORD(lParam));
 			} else {
-#ifndef NO_INET6
 				int listening_socket_num;
-#endif							/* NO_INET6 */
 				switch (LOWORD(lParam)) {
 				case FD_ACCEPT:
-#ifndef NO_INET6
 					listening_socket_num =
 						find_listening_socket_num(pvar, request_num,
 						                          (SOCKET) wParam);
@@ -857,9 +760,6 @@
 						return FALSE;
 					accept_local_connection(pvar, request_num,
 					                        listening_socket_num);
-#else
-					accept_local_connection(pvar, request_num);
-#endif							/* NO_INET6 */
 					break;
 				}
 			}
@@ -879,27 +779,18 @@
 				found_to_host_addr(pvar, request_num);
 			}
 			pvar->fwd_state.requests[request_num].to_host_lookup_handle = 0;
-#ifdef NO_INET6
-			free(pvar->fwd_state.requests[request_num].
-			     to_host_hostent_buf);
-			pvar->fwd_state.requests[request_num].to_host_hostent_buf =
-				NULL;
-#endif							/* NO_INET6 */
 			return TRUE;
 		}
 
 	case WM_SOCK_IO:{
 			int channel_num = find_channel_num(pvar, (SOCKET) wParam);
-#ifndef NO_INET6
 			FWDChannel FAR *channel =
 				pvar->fwd_state.channels + channel_num;
-#endif							/* NO_INET6 */
 
 			if (channel_num < 0)
 				return TRUE;
 
 			if (HIWORD(lParam) != 0) {
-#ifndef NO_INET6
 				if (LOWORD(lParam) == FD_CONNECT) {
 					if (channel->to_host_addrs->ai_next == NULL) {
 						/* all protocols were failed */
@@ -951,15 +842,6 @@
 					              HIWORD(lParam));
 					return TRUE;
 				}
-#else
-				if (LOWORD(lParam) == FD_CONNECT) {
-					channel_opening_error(pvar, channel_num,
-					                      HIWORD(lParam));
-				} else {
-					channel_error(pvar, "accessing", channel_num,
-					              HIWORD(lParam));
-				}
-#endif							/* NO_INET6 */
 			} else {
 				switch (LOWORD(lParam)) {
 				case FD_CONNECT:
@@ -1074,25 +956,15 @@
    It returns the listening socket for the request, if there is one.
    The caller must close this socket if it is not INVALID_SOCKET.
 */
-#ifndef NO_INET6
 static SOCKET FAR *delete_request(PTInstVar pvar, int request_num,
                                   int *p_num_listening_sockets)
 {
-#else
-static SOCKET delete_request(PTInstVar pvar, int request_num)
-{
-#endif							/* NO_INET6 */
 	FWDRequest FAR *request = pvar->fwd_state.requests + request_num;
-#ifndef NO_INET6
 	SOCKET FAR *lp_listening_sockets;
-#else
-	SOCKET result = INVALID_SOCKET;
-#endif							/* NO_INET6 */
 
 /* safe to shut down the listening socket here. Any pending connections
    that haven't yet been turned into channels will be broken, but that's
    just tough luck. */
-#ifndef NO_INET6
 	*p_num_listening_sockets = request->num_listening_sockets;
 	lp_listening_sockets = request->listening_sockets;
 	if (request->listening_sockets != NULL) {
@@ -1107,20 +979,6 @@
 	}
 
 	return lp_listening_sockets;
-#else
-	if (request->listening_socket != INVALID_SOCKET) {
-		result = request->listening_socket;
-		request->listening_socket = INVALID_SOCKET;
-	}
-
-	request->status |= FWD_DELETED;
-
-	if (request->num_channels == 0) {
-		really_delete_request(pvar, request_num);
-	}
-
-	return result;
-#endif							/* NO_INET6 */
 }
 
 static BOOL are_specs_identical(FWDRequestSpec FAR * spec1,
@@ -1139,7 +997,6 @@
 	FWDRequest FAR *request = pvar->fwd_state.requests + request_num;
 
 	if (request->spec.type == FWD_LOCAL_TO_REMOTE) {
-#ifndef NO_INET6
 		struct addrinfo hints;
 		struct addrinfo FAR *res;
 		struct addrinfo FAR *res0;
@@ -1211,50 +1068,16 @@
 	}
 
 	return TRUE;
-#else
-		SOCKET s = socket(AF_INET, SOCK_STREAM, 0);
-		struct sockaddr_in addr;
-
-		addr.sin_family = AF_INET;
-		addr.sin_port = htons((unsigned short) request->spec.from_port);
-		addr.sin_addr.s_addr = htonl(INADDR_ANY);
-
-		request->listening_socket = s;
-		if (s == INVALID_SOCKET
-			|| WSAAsyncSelect(s, make_accept_wnd(pvar), WM_SOCK_ACCEPT,
-							  FD_ACCEPT | FD_READ | FD_CLOSE | FD_WRITE) ==
-			SOCKET_ERROR
-			|| bind(s, (struct sockaddr FAR *) &addr,
-					sizeof(addr)) == SOCKET_ERROR
-			|| listen(s, SOMAXCONN) == SOCKET_ERROR) {
-			if (report_error) {
-				notify_nonfatal_error(pvar,
-									  "Some socket(s) required for port forwarding could not be initialized.\n"
-									  "Some port forwarding services may not be available.");
-			}
-			return FALSE;
-		}
-	}
-
-	return TRUE;
-#endif							/* NO_INET6 */
 }
 
 /* This function will only be called on a request when all its channels are
    closed. */
-#ifndef NO_INET6
 static BOOL init_request(PTInstVar pvar, int request_num,
                          BOOL report_error, SOCKET FAR * listening_sockets,
                          int num_listening_sockets)
 {
-#else
-static BOOL init_request(PTInstVar pvar, int request_num,
-						 BOOL report_error, SOCKET listening_socket)
-{
-#endif							/* NO_INET6 */
 	FWDRequest FAR *request = pvar->fwd_state.requests + request_num;
 
-#ifndef NO_INET6
 	request->num_listening_sockets = 0;
 	request->listening_sockets = NULL;
 	request->to_host_addrs = NULL;
@@ -1274,26 +1097,6 @@
 		assert(listening_sockets == NULL);
 		return TRUE;
 	}
-#else
-	request->listening_socket = INVALID_SOCKET;
-	request->to_host_addr = 0;
-	request->to_host_hostent_buf = NULL;
-	request->to_host_lookup_handle = 0;
-	request->status = 0;
-
-	if (pvar->fwd_state.in_interactive_mode) {
-		if (listening_socket != INVALID_SOCKET) {
-			request->listening_socket = listening_socket;
-			return TRUE;
-		} else {
-			return interactive_init_request(pvar, request_num,
-											report_error);
-		}
-	} else {
-		assert(listening_socket == INVALID_SOCKET);
-		return TRUE;
-	}
-#endif							/* NO_INET6 */
 }
 
 void FWD_set_request_specs(PTInstVar pvar, FWDRequestSpec FAR * specs,
@@ -1302,15 +1105,11 @@
 	FWDRequestSpec FAR *new_specs =
 		(FWDRequestSpec FAR *) malloc(sizeof(FWDRequestSpec) * num_specs);
 	char FAR *specs_accounted_for;
-#ifndef NO_INET6
 	typedef struct _saved_sockets {
 		SOCKET FAR *listening_sockets;
 		int num_listening_sockets;
 	} saved_sockets_t;
 	saved_sockets_t FAR *ptr_to_saved_sockets;
-#else
-	SOCKET FAR *saved_sockets;
-#endif							/* NO_INET6 */
 	int i;
 	int num_new_requests = num_specs;
 	int num_free_requests = 0;
@@ -1331,22 +1130,14 @@
 	}
 
 	specs_accounted_for = (char FAR *) malloc(sizeof(char) * num_specs);
-#ifndef NO_INET6
 	ptr_to_saved_sockets =
 		(saved_sockets_t FAR *) malloc(sizeof(saved_sockets_t) *
 		                               num_specs);
-#else
-	saved_sockets = (SOCKET FAR *) malloc(sizeof(SOCKET) * num_specs);
-#endif							/* NO_INET6 */
 
 	memset(specs_accounted_for, 0, num_specs);
 	for (i = 0; i < num_specs; i++) {
-#ifndef NO_INET6
 		ptr_to_saved_sockets[i].listening_sockets = NULL;
 		ptr_to_saved_sockets[i].num_listening_sockets = 0;
-#else
-		saved_sockets[i] = INVALID_SOCKET;
-#endif							/* NO_INET6 */
 	}
 
 	for (i = pvar->fwd_state.num_requests - 1; i >= 0; i--) {
@@ -1362,16 +1153,11 @@
 				specs_accounted_for[new_spec - new_specs] = 1;
 				num_new_requests--;
 			} else {
-#ifndef NO_INET6
 				int num_listening_sockets;
 				SOCKET FAR *listening_sockets;
 				listening_sockets =
 					delete_request(pvar, i, &num_listening_sockets);
-#else
-				SOCKET listening_socket = delete_request(pvar, i);
-#endif							/* NO_INET6 */
 
-#ifndef NO_INET6
 				if (new_spec != NULL) {
 					ptr_to_saved_sockets[new_spec -  new_specs].
 						listening_sockets = listening_sockets;
@@ -1383,13 +1169,6 @@
 					for (i = 0; i < num_listening_sockets; ++i)
 						safe_closesocket(pvar, listening_sockets[i]);
 				}
-#else
-				if (new_spec != NULL) {
-					saved_sockets[new_spec - new_specs] = listening_socket;
-				} else if (listening_socket != INVALID_SOCKET) {
-					safe_closesocket(pvar, listening_socket);
-				}
-#endif							/* NO_INET6 */
 
 				if (pvar->fwd_state.requests[i].num_channels == 0) {
 					num_free_requests++;
@@ -1427,14 +1206,9 @@
 			assert(free_request < pvar->fwd_state.num_requests);
 
 			pvar->fwd_state.requests[free_request].spec = new_specs[i];
-#ifndef NO_INET6
 			if (!init_request(pvar, free_request, report_err,
 			                  ptr_to_saved_sockets[i].listening_sockets,
 			                  ptr_to_saved_sockets[i].num_listening_sockets)) {
-#else
-			if (!init_request
-				(pvar, free_request, report_err, saved_sockets[i])) {
-#endif							/* NO_INET6 */
 				report_err = FALSE;
 			}
 
@@ -1442,11 +1216,7 @@
 		}
 	}
 
-#ifndef NO_INET6
 	free(ptr_to_saved_sockets);
-#else
-	free(saved_sockets);
-#endif							/* NO_INET6 */
 	free(specs_accounted_for);
 	free(new_specs);
 }
@@ -1541,28 +1311,13 @@
 	int channel_num;
 	FWDChannel FAR *channel;
 	FWDRequest FAR *request = pvar->fwd_state.requests + request_num;
-#ifndef NO_INET6
 	struct addrinfo hints;
 	char pname[NI_MAXSERV];
-#endif							/* NO_INET6 */
 
-#ifndef NO_INET6
 	if (request->to_host_addrs == NULL
 	 && request->to_host_lookup_handle == 0) {
 		HANDLE task_handle;
-#else
-	if (request->to_host_addr == 0 && request->to_host_lookup_handle == 0) {
-		HANDLE task_handle;
-#endif							/* NO_INET6 */
 
-#ifdef NO_INET6
-		if (request->to_host_hostent_buf == NULL) {
-			request->to_host_hostent_buf =
-				(char FAR *) malloc(MAXGETHOSTSTRUCT);
-		}
-#endif							/* NO_INET6 */
-
-#ifndef NO_INET6
 		_snprintf_s(pname, sizeof(pname), _TRUNCATE, "%d", request->spec.to_port);
 		memset(&hints, 0, sizeof(hints));
 		hints.ai_family = AF_UNSPEC;
@@ -1571,13 +1326,6 @@
 			WSAAsyncGetAddrInfo(make_accept_wnd(pvar), WM_SOCK_GOTNAME,
 			                    request->spec.to_host, pname, &hints,
 			                    &request->to_host_addrs);
-#else
-		task_handle =
-			WSAAsyncGetHostByName(make_accept_wnd(pvar), WM_SOCK_GOTNAME,
-								  request->spec.to_host,
-								  request->to_host_hostent_buf,
-								  MAXGETHOSTSTRUCT);
-#endif							/* NO_INET6 */
 
 		if (task_handle == 0) {
 			SSH_fail_channel_open(pvar, remote_channel_num);
@@ -1589,13 +1337,7 @@
 			            pvar->ts->UIMsg,
 			            request->spec.to_host, request->spec.to_port_name);
 			notify_nonfatal_error(pvar, buf);
-#ifndef NO_INET6
-	  /*****/
 			freeaddrinfo(request->to_host_addrs);
-#else
-			free(request->to_host_hostent_buf);
-			request->to_host_hostent_buf = NULL;
-#endif							/* NO_INET6 */
 			return;
 		} else {
 			request->to_host_lookup_handle = task_handle;
@@ -1617,15 +1359,9 @@
 		*chan_num = channel_num;
 	}
 
-#ifndef NO_INET6
 	if (request->to_host_addrs != NULL) {
 		make_local_connection(pvar, channel_num);
 	}
-#else
-	if (request->to_host_addr != 0) {
-		make_local_connection(pvar, channel_num);
-	}
-#endif							/* NO_INET6 */
 }
 
 void FWD_open(PTInstVar pvar, uint32 remote_channel_num,
@@ -1889,7 +1625,7 @@
 		}
 		free(pvar->fwd_state.channels);
 	}
-#ifndef NO_INET6
+
 	if (pvar->fwd_state.requests != NULL) {
 		for (i = 0; i < pvar->fwd_state.num_requests; i++) {
 			int j;
@@ -1906,19 +1642,7 @@
 		}
 		free(pvar->fwd_state.requests);
 	}
-#else
-	if (pvar->fwd_state.requests != NULL) {
-		for (i = 0; i < pvar->fwd_state.num_requests; i++) {
-			SOCKET s = delete_request(pvar, i);
 
-			if (s != INVALID_SOCKET) {
-				closesocket(s);
-			}
-		}
-		free(pvar->fwd_state.requests);
-	}
-#endif							/* NO_INET6 */
-
 	free(pvar->fwd_state.local_host_IP_numbers);
 	free(pvar->fwd_state.server_listening_specs);
 

Modified: trunk/ttssh2/ttxssh/fwd.h
===================================================================
--- trunk/ttssh2/ttxssh/fwd.h	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/ttssh2/ttxssh/fwd.h	2017-05-20 06:38:01 UTC (rev 6738)
@@ -63,9 +63,7 @@
 
   void FAR * filter_closure;
   FWDFilter filter;
-#ifndef NO_INET6
   struct addrinfo FAR * to_host_addrs;
-#endif /* NO_INET6 */
 
   // for agent forwarding
   buffer_t *agent_msg;
@@ -98,20 +96,11 @@
 
 #define FWD_DELETED                      0x01
 
-#ifndef NO_INET6
 #define MAX_LISTENING_SOCKETS 4096
-#endif
 typedef struct {
-#ifndef NO_INET6
   int num_listening_sockets;
   SOCKET FAR * listening_sockets;
   struct addrinfo FAR * to_host_addrs;
-#else
-  SOCKET listening_socket;
-
-  uint32 to_host_addr;
-  char FAR * to_host_hostent_buf;
-#endif /* NO_INET6 */
   HANDLE to_host_lookup_handle;
 
   int num_channels;
@@ -130,11 +119,7 @@
   FWDRequest FAR * requests;
   int num_channels;
   FWDChannel FAR * channels;
-#ifndef NO_INET6
   struct sockaddr_storage FAR * local_host_IP_numbers;
-#else
-  uint32 * local_host_IP_numbers;
-#endif /* NO_INET6 */
   struct _X11AuthData FAR * X11_auth_data;
   BOOL in_interactive_mode;
 } FWDState;

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2017-05-20 06:38:01 UTC (rev 6738)
@@ -53,12 +53,8 @@
 #include "resource.h"
 #include <commctrl.h>
 #include <commdlg.h>
-#ifndef NO_INET6
 #include <winsock2.h>
 static char FAR *ProtocolFamilyList[] = { "UNSPEC", "IPv6", "IPv4", NULL };
-#else
-#include <winsock.h>
-#endif							/* NO_INET6 */
 
 #include <Lmcons.h>
 
@@ -666,7 +662,6 @@
 static unsigned short find_local_port(PTInstVar pvar)
 {
 	int tries;
-#ifndef NO_INET6
 	SOCKET connecter;
 	struct addrinfo hints;
 	struct addrinfo FAR *res;
@@ -673,7 +668,6 @@
 	struct addrinfo FAR *res0;
 	unsigned short port;
 	char pname[NI_MAXHOST];
-#endif							/* NO_INET6 */
 
 	if (pvar->session_settings.DefaultAuthMethod != SSH_AUTH_RHOSTS) {
 		return 0;
@@ -686,7 +680,6 @@
 	 */
 	srand((unsigned) GetTickCount());
 
-#ifndef NO_INET6
 	for (tries = 20; tries > 0; tries--) {
 		memset(&hints, 0, sizeof(hints));
 		hints.ai_family = pvar->ts->ProtocolFamily;
@@ -727,34 +720,6 @@
 	}
 
 	return 0;
-#else
-	for (tries = 20; tries > 0; tries--) {
-		SOCKET connecter = socket(AF_INET, SOCK_STREAM, 0);
-		struct sockaddr_in connecter_addr;
-
-		connecter_addr.sin_family = AF_INET;
-		connecter_addr.sin_port = (unsigned) rand() % 512 + 512;
-		connecter_addr.sin_addr.s_addr = htonl(INADDR_ANY);
-
-		if (connecter == INVALID_SOCKET) {
-			return 0;
-		}
-
-		if (bind
-		    (connecter, (struct sockaddr FAR *) &connecter_addr,
-		     sizeof(connecter_addr)) != SOCKET_ERROR) {
-		    closesocket(connecter);
-			return connecter_addr.sin_port;
-		} else if (WSAGetLastError() != WSAEADDRINUSE) {
-			closesocket(connecter);
-			return 0;
-		}
-
-		closesocket(connecter);
-	}
-
-	return 0;
-#endif							/* NO_INET6 */
 }
 
 static int PASCAL FAR TTXconnect(SOCKET s,
@@ -761,7 +726,6 @@
                                  const struct sockaddr FAR * name,
                                  int namelen)
 {
-#ifndef NO_INET6
 	if (pvar->socket == INVALID_SOCKET || pvar->socket != s) {
 		struct sockaddr_storage ss;
 		int len;
@@ -792,21 +756,7 @@
 
 		bind(s, (struct sockaddr FAR *) &ss, len);
 	}
-#else
-	if (pvar->socket == INVALID_SOCKET) {
-		struct sockaddr_in addr;
 
-		pvar->socket = s;
-
-		addr.sin_family = AF_INET;
-		addr.sin_port = htons(find_local_port(pvar));
-		addr.sin_addr.s_addr = INADDR_ANY;
-		memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
-
-		bind(s, (struct sockaddr FAR *) &addr, sizeof(addr));
-	}
-#endif							/* NO_INET6 */
-
 	return (pvar->Pconnect) (s, name, namelen);
 }
 
@@ -1380,7 +1330,6 @@
 		                 Telnet ? IDC_HOSTTELNET : IDC_HOSTOTHER);
 		SendDlgItemMessage(dlg, IDC_HOSTTCPPORT, EM_LIMITTEXT, 5, 0);
 		SetDlgItemInt(dlg, IDC_HOSTTCPPORT, GetHNRec->TCPPort, FALSE);
-#ifndef NO_INET6
 		for (i = 0; ProtocolFamilyList[i]; ++i) {
 			SendDlgItemMessage(dlg, IDC_HOSTTCPPROTOCOL, CB_ADDSTRING,
 			                   0, (LPARAM) ProtocolFamilyList[i]);
@@ -1388,7 +1337,6 @@
 		SendDlgItemMessage(dlg, IDC_HOSTTCPPROTOCOL, EM_LIMITTEXT,
 		                   ProtocolFamilyMaxLength - 1, 0);
 		SendDlgItemMessage(dlg, IDC_HOSTTCPPROTOCOL, CB_SETCURSEL, 0, 0);
-#endif							/* NO_INET6 */
 
 		/////// SSH version
 		for (i = 0; ssh_version[i]; ++i) {
@@ -1472,7 +1420,6 @@
 
 			enable_dlg_items(dlg, IDC_HISTORY, IDC_HISTORY, TRUE); // enabled
 		}
-#ifndef NO_INET6
 		else {
 			enable_dlg_items(dlg, IDC_HOSTNAMELABEL, IDC_HOSTTCPPORT,
 			                 FALSE);
@@ -1484,11 +1431,6 @@
 
 			enable_dlg_items(dlg, IDC_HISTORY, IDC_HISTORY, FALSE); // disabled
 		}
-#else
-		else
-			enable_dlg_items(dlg, IDC_HOSTNAMELABEL, IDC_HOSTTCPPORT,
-							 FALSE);
-#endif							/* NO_INET6 */
 
 		// Host dialog\x82Ƀt\x83H\x81[\x83J\x83X\x82\xF0\x82\xA0\x82Ă\xE9 (2004.10.2 yutaka)
 		if (GetHNRec->PortType == IdTCPIP) {
@@ -1539,9 +1481,7 @@
 			GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER);
 			if (GetHNRec != NULL) {
 				if (IsDlgButtonChecked(dlg, IDC_HOSTTCPIP)) {
-#ifndef NO_INET6
 					char afstr[BUFSIZ];
-#endif							/* NO_INET6 */
 					i = GetDlgItemInt(dlg, IDC_HOSTTCPPORT, &Ok, FALSE);
 					if (Ok) {
 						GetHNRec->TCPPort = i;
@@ -1552,7 +1492,6 @@
 						           "Tera Term", MB_OK | MB_ICONEXCLAMATION);
 						return TRUE;
 					}
-#ifndef NO_INET6
 #define getaf(str) \
 ((strcmp((str), "IPv6") == 0) ? AF_INET6 : \
  ((strcmp((str), "IPv4") == 0) ? AF_INET : AF_UNSPEC))
@@ -1560,7 +1499,6 @@
 					GetDlgItemText(dlg, IDC_HOSTTCPPROTOCOL, afstr,
 					               sizeof(afstr));
 					GetHNRec->ProtocolFamily = getaf(afstr);
-#endif							/* NO_INET6 */
 					GetHNRec->PortType = IdTCPIP;
 					GetDlgItemText(dlg, IDC_HOSTNAME, GetHNRec->HostName,
 					               HostNameMaxLength);
@@ -1628,10 +1566,8 @@
 		case IDC_HOSTTCPIP:
 			enable_dlg_items(dlg, IDC_HOSTNAMELABEL, IDC_HOSTTCPPORT,
 			                 TRUE);
-#ifndef NO_INET6
 			enable_dlg_items(dlg, IDC_HOSTTCPPROTOCOLLABEL,
 			                 IDC_HOSTTCPPROTOCOL, TRUE);
-#endif							/* NO_INET6 */
 			enable_dlg_items(dlg, IDC_HOSTCOMLABEL, IDC_HOSTCOM, FALSE);
 
 			enable_dlg_items(dlg, IDC_SSH_VERSION_LABEL, IDC_SSH_VERSION_LABEL, TRUE); // disabled (2004.11.23 yutaka)
@@ -1649,10 +1585,8 @@
 			enable_dlg_items(dlg, IDC_HOSTCOMLABEL, IDC_HOSTCOM, TRUE);
 			enable_dlg_items(dlg, IDC_HOSTNAMELABEL, IDC_HOSTTCPPORT,
 			                 FALSE);
-#ifndef NO_INET6
 			enable_dlg_items(dlg, IDC_HOSTTCPPROTOCOLLABEL,
 			                 IDC_HOSTTCPPROTOCOL, FALSE);
-#endif							/* NO_INET6 */
 			enable_dlg_items(dlg, IDC_SSH_VERSION, IDC_SSH_VERSION, FALSE); // disabled
 			enable_dlg_items(dlg, IDC_SSH_VERSION_LABEL, IDC_SSH_VERSION_LABEL, FALSE); // disabled (2004.11.23 yutaka)
 
@@ -2108,12 +2042,8 @@
 			option[hostlen] = 0;
 
 			// \x83|\x81[\x83g\x8Ew\x92肪\x96\xB3\x82\xA2\x8E\x9E\x82\xCD":22"\x82𑫂\xB7
-#ifndef NO_INET6
 			if (option[0] == '[' && option[hostlen-1] == ']' ||     // IPv6 raw address without port
 			    option[0] != '[' && _mbschr(option, ':') == NULL) { // hostname or IPv4 raw address without port
-#else
-			if (_mbschr(option, ':') == NULL) {
-#endif							/* NO_INET6 */
 				memcpy_s(option+hostlen, optlen-hostlen, ":22", 3);
 				hostlen += 3;
 			}

Modified: trunk/ttssh2/ttxssh/ttxssh.h
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.h	2017-05-19 16:18:53 UTC (rev 6737)
+++ trunk/ttssh2/ttxssh/ttxssh.h	2017-05-20 06:38:01 UTC (rev 6738)
@@ -46,7 +46,6 @@
 	#endif
 #endif
 
-#ifndef NO_INET6
 #include <winsock2.h>
 #include <ws2tcpip.h>
 /* actual body of in6addr_any and in6addr_loopback is disappeared?? */
@@ -58,7 +57,6 @@
          (*(unsigned int *)(&(a)->s6_addr[12]) == ntohl(1)))
 /* work around for MS Platform SDK Oct 2000 */
 #include <malloc.h> /* prevent of conflict stdlib.h */
-#endif /* NO_INET6 */
 #include <stdlib.h>
 #include <stdarg.h>
 #include <crtdbg.h>



Ttssh2-commit メーリングリストの案内