亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? telnetd.c

?? 早期freebsd實現
?? C
?? 第 1 頁 / 共 3 頁
字號:
	/* NOTREACHED */}  /* end of main */	voidusage(){	fprintf(stderr, "Usage: telnetd");#ifdef	AUTHENTICATION	fprintf(stderr, " [-a (debug|other|user|valid|off|none)]\n\t");#endif#ifdef BFTPDAEMON	fprintf(stderr, " [-B]");#endif	fprintf(stderr, " [-debug]");#ifdef DIAGNOSTICS	fprintf(stderr, " [-D (options|report|exercise|netdata|ptydata)]\n\t");#endif#ifdef	AUTHENTICATION	fprintf(stderr, " [-edebug]");#endif	fprintf(stderr, " [-h]");#if	defined(CRAY) && defined(NEWINIT)	fprintf(stderr, " [-Iinitid]");#endif#if	defined(LINEMODE) && defined(KLUDGELINEMODE)	fprintf(stderr, " [-k]");#endif#ifdef LINEMODE	fprintf(stderr, " [-l]");#endif	fprintf(stderr, " [-n]");#ifdef	CRAY	fprintf(stderr, " [-r[lowpty]-[highpty]]");#endif	fprintf(stderr, "\n\t");#ifdef	SecurID	fprintf(stderr, " [-s]");#endif#ifdef	HAS_GETTOS	fprintf(stderr, " [-S tos]");#endif#ifdef	AUTHENTICATION	fprintf(stderr, " [-X auth-type]");#endif	fprintf(stderr, " [-u utmp_hostname_length] [-U]");	fprintf(stderr, " [port]\n");	exit(1);}/* * getterminaltype * *	Ask the other end to send along its terminal type and speed. * Output is the variable terminaltype filled in. */static unsigned char ttytype_sbbuf[] = {	IAC, SB, TELOPT_TTYPE, TELQUAL_SEND, IAC, SE};    intgetterminaltype(name)    char *name;{    int retval = -1;    void _gettermname();    settimer(baseline);#if	defined(AUTHENTICATION)    /*     * Handle the Authentication option before we do anything else.     */    send_do(TELOPT_AUTHENTICATION, 1);    while (his_will_wont_is_changing(TELOPT_AUTHENTICATION))	ttloop();    if (his_state_is_will(TELOPT_AUTHENTICATION)) {	retval = auth_wait(name);    }#endif#ifdef	ENCRYPTION    send_will(TELOPT_ENCRYPT, 1);#endif	/* ENCRYPTION */    send_do(TELOPT_TTYPE, 1);    send_do(TELOPT_TSPEED, 1);    send_do(TELOPT_XDISPLOC, 1);    send_do(TELOPT_NEW_ENVIRON, 1);    send_do(TELOPT_OLD_ENVIRON, 1);    while (#ifdef	ENCRYPTION	   his_do_dont_is_changing(TELOPT_ENCRYPT) ||#endif	/* ENCRYPTION */	   his_will_wont_is_changing(TELOPT_TTYPE) ||	   his_will_wont_is_changing(TELOPT_TSPEED) ||	   his_will_wont_is_changing(TELOPT_XDISPLOC) ||	   his_will_wont_is_changing(TELOPT_NEW_ENVIRON) ||	   his_will_wont_is_changing(TELOPT_OLD_ENVIRON)) {	ttloop();    }#ifdef	ENCRYPTION    /*     * Wait for the negotiation of what type of encryption we can     * send with.  If autoencrypt is not set, this will just return.     */    if (his_state_is_will(TELOPT_ENCRYPT)) {	encrypt_wait();    }#endif	/* ENCRYPTION */    if (his_state_is_will(TELOPT_TSPEED)) {	static unsigned char sb[] =			{ IAC, SB, TELOPT_TSPEED, TELQUAL_SEND, IAC, SE };	bcopy(sb, nfrontp, sizeof sb);	nfrontp += sizeof sb;    }    if (his_state_is_will(TELOPT_XDISPLOC)) {	static unsigned char sb[] =			{ IAC, SB, TELOPT_XDISPLOC, TELQUAL_SEND, IAC, SE };	bcopy(sb, nfrontp, sizeof sb);	nfrontp += sizeof sb;    }    if (his_state_is_will(TELOPT_NEW_ENVIRON)) {	static unsigned char sb[] =			{ IAC, SB, TELOPT_NEW_ENVIRON, TELQUAL_SEND, IAC, SE };	bcopy(sb, nfrontp, sizeof sb);	nfrontp += sizeof sb;    }    else if (his_state_is_will(TELOPT_OLD_ENVIRON)) {	static unsigned char sb[] =			{ IAC, SB, TELOPT_OLD_ENVIRON, TELQUAL_SEND, IAC, SE };	bcopy(sb, nfrontp, sizeof sb);	nfrontp += sizeof sb;    }    if (his_state_is_will(TELOPT_TTYPE)) {	bcopy(ttytype_sbbuf, nfrontp, sizeof ttytype_sbbuf);	nfrontp += sizeof ttytype_sbbuf;    }    if (his_state_is_will(TELOPT_TSPEED)) {	while (sequenceIs(tspeedsubopt, baseline))	    ttloop();    }    if (his_state_is_will(TELOPT_XDISPLOC)) {	while (sequenceIs(xdisplocsubopt, baseline))	    ttloop();    }    if (his_state_is_will(TELOPT_NEW_ENVIRON)) {	while (sequenceIs(environsubopt, baseline))	    ttloop();    }    if (his_state_is_will(TELOPT_OLD_ENVIRON)) {	while (sequenceIs(oenvironsubopt, baseline))	    ttloop();    }    if (his_state_is_will(TELOPT_TTYPE)) {	char first[256], last[256];	while (sequenceIs(ttypesubopt, baseline))	    ttloop();	/*	 * If the other side has already disabled the option, then	 * we have to just go with what we (might) have already gotten.	 */	if (his_state_is_will(TELOPT_TTYPE) && !terminaltypeok(terminaltype)) {	    (void) strncpy(first, terminaltype, sizeof(first));	    for(;;) {		/*		 * Save the unknown name, and request the next name.		 */		(void) strncpy(last, terminaltype, sizeof(last));		_gettermname();		if (terminaltypeok(terminaltype))		    break;		if ((strncmp(last, terminaltype, sizeof(last)) == 0) ||		    his_state_is_wont(TELOPT_TTYPE)) {		    /*		     * We've hit the end.  If this is the same as		     * the first name, just go with it.		     */		    if (strncmp(first, terminaltype, sizeof(first)) == 0)			break;		    /*		     * Get the terminal name one more time, so that		     * RFC1091 compliant telnets will cycle back to		     * the start of the list.		     */		     _gettermname();		    if (strncmp(first, terminaltype, sizeof(first)) != 0)			(void) strncpy(terminaltype, first, sizeof(first));		    break;		}	    }	}    }    return(retval);}  /* end of getterminaltype */    void_gettermname(){    /*     * If the client turned off the option,     * we can't send another request, so we     * just return.     */    if (his_state_is_wont(TELOPT_TTYPE))	return;    settimer(baseline);    bcopy(ttytype_sbbuf, nfrontp, sizeof ttytype_sbbuf);    nfrontp += sizeof ttytype_sbbuf;    while (sequenceIs(ttypesubopt, baseline))	ttloop();}    intterminaltypeok(s)    char *s;{    char buf[1024];    if (terminaltype == NULL)	return(1);    /*     * tgetent() will return 1 if the type is known, and     * 0 if it is not known.  If it returns -1, it couldn't     * open the database.  But if we can't open the database,     * it won't help to say we failed, because we won't be     * able to verify anything else.  So, we treat -1 like 1.     */    if (tgetent(buf, s) == 0)	return(0);    return(1);}#ifndef	MAXHOSTNAMELEN#define	MAXHOSTNAMELEN 64#endif	/* MAXHOSTNAMELEN */char *hostname;char host_name[MAXHOSTNAMELEN];char remote_host_name[MAXHOSTNAMELEN];#ifndef	convexextern void telnet P((int, int));#elseextern void telnet P((int, int, char *));#endif/* * Get a pty, scan input lines. */doit(who)	struct sockaddr_in *who;{	char *host, *inet_ntoa();	int t;	struct hostent *hp;	int level;	int ptynum;	char user_name[256];	/*	 * Find an available pty to use.	 */#ifndef	convex	pty = getpty(&ptynum);	if (pty < 0)		fatal(net, "All network ports in use");#else	for (;;) {		char *lp;		extern char *line, *getpty();		if ((lp = getpty()) == NULL)			fatal(net, "Out of ptys");		if ((pty = open(lp, 2)) >= 0) {			strcpy(line,lp);			line[5] = 't';			break;		}	}#endif#if	defined(_SC_CRAY_SECURE_SYS)	/*	 *	set ttyp line security label 	 */	if (secflag) {		char slave_dev[16];		sprintf(tty_dev, "/dev/pty/%03d", ptynum);		if (setdevs(tty_dev, &dv) < 0)		 	fatal(net, "cannot set pty security");		sprintf(slave_dev, "/dev/ttyp%03d", ptynum);		if (setdevs(slave_dev, &dv) < 0)		 	fatal(net, "cannot set tty security");	}#endif	/* _SC_CRAY_SECURE_SYS */	/* get name of connected client */	hp = gethostbyaddr((char *)&who->sin_addr, sizeof (struct in_addr),		who->sin_family);	if (hp == NULL && registerd_host_only) {		fatal(net, "Couldn't resolve your address into a host name.\r\n\         Please contact your net administrator");	} else if (hp &&	    (strlen(hp->h_name) <= ((utmp_len < 0) ? -utmp_len : utmp_len))) {		host = hp->h_name;	} else {		host = inet_ntoa(who->sin_addr);	}	/*	 * We must make a copy because Kerberos is probably going	 * to also do a gethost* and overwrite the static data...	 */	strncpy(remote_host_name, host, sizeof(remote_host_name)-1);	remote_host_name[sizeof(remote_host_name)-1] = 0;	host = remote_host_name;	(void) gethostname(host_name, sizeof (host_name));	hostname = host_name;#if	defined(AUTHENTICATION) || defined(ENCRYPTION)	auth_encrypt_init(hostname, host, "TELNETD", 1);#endif	init_env();	/*	 * get terminal type.	 */	*user_name = 0;	level = getterminaltype(user_name);	setenv("TERM", terminaltype ? terminaltype : "network", 1);	/*	 * Start up the login process on the slave side of the terminal	 */#ifndef	convex	startslave(host, level, user_name);#if	defined(_SC_CRAY_SECURE_SYS)	if (secflag) {		if (setulvl(dv.dv_actlvl) < 0)			fatal(net,"cannot setulvl()");		if (setucmp(dv.dv_actcmp) < 0)			fatal(net, "cannot setucmp()");	}#endif	/* _SC_CRAY_SECURE_SYS */	telnet(net, pty);  /* begin server processing */#else	telnet(net, pty, host);#endif	/*NOTREACHED*/}  /* end of doit */#if	defined(CRAY2) && defined(UNICOS5) && defined(UNICOS50)	intXterm_output(ibufp, obuf, icountp, ocount)	char **ibufp, *obuf;	int *icountp, ocount;{	int ret;	ret = term_output(*ibufp, obuf, *icountp, ocount);	*ibufp += *icountp;	*icountp = 0;	return(ret);}#define	term_output	Xterm_output#endif	/* defined(CRAY2) && defined(UNICOS5) && defined(UNICOS50) *//* * Main loop.  Select from pty and network, and * hand data to telnet receiver finite state machine. */	void#ifndef	convextelnet(f, p)#elsetelnet(f, p, host)#endif	int f, p;#ifdef convex	char *host;#endif{	int on = 1;#define	TABBUFSIZ	512	char	defent[TABBUFSIZ];	char	defstrs[TABBUFSIZ];#undef	TABBUFSIZ	char *HE;	char *HN;	char *IM;	void netflush();	/*	 * Initialize the slc mapping table.	 */	get_slc_defaults();	/*	 * Do some tests where it is desireable to wait for a response.	 * Rather than doing them slowly, one at a time, do them all	 * at once.	 */	if (my_state_is_wont(TELOPT_SGA))		send_will(TELOPT_SGA, 1);	/*	 * Is the client side a 4.2 (NOT 4.3) system?  We need to know this	 * because 4.2 clients are unable to deal with TCP urgent data.	 *	 * To find out, we send out a "DO ECHO".  If the remote system	 * answers "WILL ECHO" it is probably a 4.2 client, and we note	 * that fact ("WILL ECHO" ==> that the client will echo what	 * WE, the server, sends it; it does NOT mean that the client will	 * echo the terminal input).	 */	send_do(TELOPT_ECHO, 1);#ifdef	LINEMODE	if (his_state_is_wont(TELOPT_LINEMODE)) {		/* Query the peer for linemode support by trying to negotiate		 * the linemode option.		 */		linemode = 0;		editmode = 0;		send_do(TELOPT_LINEMODE, 1);  /* send do linemode */	}#endif	/* LINEMODE */	/*	 * Send along a couple of other options that we wish to negotiate.	 */	send_do(TELOPT_NAWS, 1);	send_will(TELOPT_STATUS, 1);	flowmode = 1;		/* default flow control state */	restartany = -1;	/* uninitialized... */	send_do(TELOPT_LFLOW, 1);	/*	 * Spin, waiting for a response from the DO ECHO.  However,	 * some REALLY DUMB telnets out there might not respond	 * to the DO ECHO.  So, we spin looking for NAWS, (most dumb	 * telnets so far seem to respond with WONT for a DO that	 * they don't understand...) because by the time we get the	 * response, it will already have processed the DO ECHO.	 * Kludge upon kludge.	 */	while (his_will_wont_is_changing(TELOPT_NAWS))		ttloop();	/*	 * But...	 * The client might have sent a WILL NAWS as part of its	 * startup code; if so, we'll be here before we get the	 * response to the DO ECHO.  We'll make the assumption	 * that any implementation that understands about NAWS	 * is a modern enough implementation that it will respond	 * to our DO ECHO request; hence we'll do another spin	 * waiting for the ECHO option to settle down, which is	 * what we wanted to do in the first place...	 */	if (his_want_state_is_will(TELOPT_ECHO) &&	    his_state_is_will(TELOPT_NAWS)) {		while (his_will_wont_is_changing(TELOPT_ECHO))			ttloop();	}	/*	 * On the off chance that the telnet client is broken and does not	 * respond to the DO ECHO we sent, (after all, we did send the	 * DO NAWS negotiation after the DO ECHO, and we won't get here	 * until a response to the DO NAWS comes back) simulate the	 * receipt of a will echo.  This will also send a WONT ECHO	 * to the client, since we assume that the client failed to	 * respond because it believes that it is already in DO ECHO	 * mode, which we do not want.	 */	if (his_want_state_is_will(TELOPT_ECHO)) {		DIAG(TD_OPTIONS,			{sprintf(nfrontp, "td: simulating recv\r\n");			 nfrontp += strlen(nfrontp);});		willoption(TELOPT_ECHO);	}	/*	 * Finally, to clean things up, we turn on our echo.  This	 * will break stupid 4.2 telnets out of local terminal echo.	 */	if (my_state_is_wont(TELOPT_ECHO))		send_will(TELOPT_ECHO, 1);#ifndef	STREAMSPTY	/*	 * Turn on packet mode	 */	(void) ioctl(p, TIOCPKT, (char *)&on);#endif#if	defined(LINEMODE) && defined(KLUDGELINEMODE)	/*	 * Continuing line mode support.  If client does not support	 * real linemode, attempt to negotiate kludge linemode by sending	 * the do timing mark sequence.	 */	if (lmodetype < REAL_LINEMODE)		send_do(TELOPT_TM, 1);#endif	/* defined(LINEMODE) && defined(KLUDGELINEMODE) */	/*	 * Call telrcv() once to pick up anything received during	 * terminal type negotiation, 4.2/4.3 determination, and	 * linemode negotiation.	 */	telrcv();	(void) ioctl(f, FIONBIO, (char *)&on);	(void) ioctl(p, FIONBIO, (char *)&on);#if	defined(CRAY2) && defined(UNICOS5)	init_termdriver(f, p, interrupt, sendbrk);#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区调教| 国产精品电影一区二区| 日韩成人免费看| 欧美日本一区二区在线观看| 天天操天天综合网| 欧美一卡在线观看| 国产一区不卡精品| 国产精品区一区二区三| 91原创在线视频| 一区二区三区久久| 欧美一区二区在线视频| 韩国v欧美v日本v亚洲v| 国产精品美女www爽爽爽| 91黄色激情网站| 亚洲r级在线视频| 精品福利二区三区| 不卡视频一二三| 亚洲成人免费在线| 久久夜色精品国产欧美乱极品| 国产成人午夜精品5599| 亚洲人妖av一区二区| 欧美日韩国产成人在线91| 精品一区二区三区在线观看| 日本一区二区成人在线| 91国在线观看| 激情欧美一区二区三区在线观看| 欧美国产欧美综合| 欧美色男人天堂| 国产精品一区专区| 亚洲一区影音先锋| 久久综合av免费| 在线免费不卡视频| 国产在线精品一区在线观看麻豆| 亚洲男人的天堂在线aⅴ视频| 7777精品久久久大香线蕉| 国产激情91久久精品导航| 亚洲福利视频一区| 国产欧美日韩在线| 67194成人在线观看| 成人免费视频视频| 美腿丝袜在线亚洲一区| 亚洲女同ⅹxx女同tv| 精品国产91洋老外米糕| 在线免费观看视频一区| 国产精品亚洲一区二区三区妖精| 亚洲一区二区三区四区不卡| 久久精品人人做人人爽人人| 欧美美女一区二区三区| www.亚洲精品| 91精品久久久久久久久99蜜臂| 国产精品自拍三区| 日本中文在线一区| 一级日本不卡的影视| 国产日韩影视精品| 日韩精品一区在线| 欧美日本不卡视频| 欧美最新大片在线看| 99久久国产综合精品色伊| 激情五月婷婷综合| 日本女人一区二区三区| 亚洲国产日韩一级| 亚洲欧美日韩人成在线播放| 久久免费偷拍视频| 国内精品自线一区二区三区视频| 一区二区国产视频| 国产精品久久久久影院色老大| 日韩情涩欧美日韩视频| 欧美精品自拍偷拍动漫精品| 欧美性受极品xxxx喷水| 91日韩在线专区| 成人性生交大片免费看视频在线| 国产美女精品人人做人人爽| 免费黄网站欧美| 免费看日韩精品| 免费成人美女在线观看.| 香蕉久久夜色精品国产使用方法| 亚洲中国最大av网站| 亚洲精选视频在线| 樱桃视频在线观看一区| 亚洲精品日韩一| 亚洲综合色在线| 亚洲综合精品自拍| 色婷婷久久久亚洲一区二区三区| 成人精品小蝌蚪| www.亚洲人| 色婷婷精品大视频在线蜜桃视频| 91免费看片在线观看| 91在线高清观看| 在线观看视频一区二区| 欧美四级电影网| 欧美日韩精品系列| 91精品国产综合久久久久久久久久 | 日韩伦理电影网| 国产精品麻豆一区二区| 亚洲国产精品av| 成人欧美一区二区三区1314| 亚洲精品国产品国语在线app| 一区二区三区在线观看网站| 午夜a成v人精品| 激情欧美一区二区| 成人99免费视频| 91久久精品一区二区三区| 欧美一区二区性放荡片| 精品国产99国产精品| 中文字幕亚洲综合久久菠萝蜜| 夜夜精品视频一区二区| 免费看欧美女人艹b| 成人自拍视频在线| 欧美亚洲高清一区二区三区不卡| 69成人精品免费视频| 国产欧美一区二区三区鸳鸯浴| 自拍偷拍亚洲综合| 琪琪一区二区三区| 欧美mv日韩mv亚洲| 中文字幕乱码一区二区免费| 一区二区三区在线视频免费| 久久er99热精品一区二区| 成人精品国产福利| 欧美一级一级性生活免费录像| 国产偷v国产偷v亚洲高清| 一区二区激情视频| 国产九色sp调教91| 欧美日本在线一区| 中文字幕av在线一区二区三区| 香蕉成人啪国产精品视频综合网 | 精品久久久久久综合日本欧美| 国产精品久久久久国产精品日日| 亚洲大片一区二区三区| 国产精品自产自拍| 777a∨成人精品桃花网| 国产精品久久影院| 久久精品国产**网站演员| 91在线免费看| 久久精品人人做人人综合| 婷婷久久综合九色国产成人| 不卡高清视频专区| 精品久久久久99| 亚洲第一在线综合网站| 99精品国产热久久91蜜凸| 精品盗摄一区二区三区| 性久久久久久久久久久久| 成人精品鲁一区一区二区| 欧美xfplay| 婷婷开心久久网| 91黄色激情网站| 国产精品天干天干在观线| 美国av一区二区| 欧美精品v国产精品v日韩精品 | 亚洲一卡二卡三卡四卡五卡| 丁香激情综合五月| 精品国产在天天线2019| 日日摸夜夜添夜夜添精品视频| 91视频.com| 中文字幕一区二区在线播放| 国产一区在线观看视频| 精品少妇一区二区三区视频免付费| 性久久久久久久久| 欧美日韩不卡在线| 一区二区三区日韩在线观看| www.亚洲精品| 国产精品乱码妇女bbbb| 丁香婷婷综合网| 日本一区二区三区免费乱视频| 国产在线麻豆精品观看| 精品欧美乱码久久久久久 | 国产精品一级二级三级| 欧美videofree性高清杂交| 美女诱惑一区二区| 欧美大片在线观看一区二区| 麻豆专区一区二区三区四区五区| 91麻豆精品国产91久久久资源速度| 亚洲午夜久久久久中文字幕久| 在线看国产一区| 亚洲丰满少妇videoshd| 制服丝袜一区二区三区| 免费成人在线播放| 26uuuu精品一区二区| 国产一区二区在线看| 久久久精品影视| 成人一道本在线| 亚洲精品成人在线| 精品视频123区在线观看| 日韩在线a电影| 精品处破学生在线二十三| 国产99久久久国产精品 | 亚洲自拍都市欧美小说| 欧美日韩一二区| 麻豆国产91在线播放| 国产日韩精品久久久| 成人av电影在线网| 亚洲国产一区二区在线播放| 6080日韩午夜伦伦午夜伦| 国产一区二区在线免费观看| 中文av一区特黄| 欧美在线观看禁18| 久久成人综合网| 国产清纯美女被跳蛋高潮一区二区久久w | 樱桃国产成人精品视频| 欧美狂野另类xxxxoooo| 精品一区二区三区在线视频|