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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? telnetd.c

?? 早期freebsd實現(xiàn)
?? C
?? 第 1 頁 / 共 3 頁
字號:
#if	defined(SO_OOBINLINE)	(void) setsockopt(net, SOL_SOCKET, SO_OOBINLINE,				(char *)&on, sizeof on);#endif	/* defined(SO_OOBINLINE) */#ifdef	SIGTSTP	(void) signal(SIGTSTP, SIG_IGN);#endif#ifdef	SIGTTOU	/*	 * Ignoring SIGTTOU keeps the kernel from blocking us	 * in ttioct() in /sys/tty.c.	 */	(void) signal(SIGTTOU, SIG_IGN);#endif	(void) signal(SIGCHLD, cleanup);#if	defined(CRAY2) && defined(UNICOS5)	/*	 * Cray-2 will send a signal when pty modes are changed by slave	 * side.  Set up signal handler now.	 */	if ((int)signal(SIGUSR1, termstat) < 0)		perror("signal");	else if (ioctl(p, TCSIGME, (char *)SIGUSR1) < 0)		perror("ioctl:TCSIGME");	/*	 * Make processing loop check terminal characteristics early on.	 */	termstat();#endif#ifdef  TIOCNOTTY	{		register int t;		t = open(_PATH_TTY, O_RDWR);		if (t >= 0) {			(void) ioctl(t, TIOCNOTTY, (char *)0);			(void) close(t);		}	}#endif#if	defined(CRAY) && defined(NEWINIT) && defined(TIOCSCTTY)	(void) setsid();	ioctl(p, TIOCSCTTY, 0);#endif	/*	 * Show banner that getty never gave.	 *	 * We put the banner in the pty input buffer.  This way, it	 * gets carriage return null processing, etc., just like all	 * other pty --> client data.	 */#if	!defined(CRAY) || !defined(NEWINIT)	if (getenv("USER"))		hostinfo = 0;#endif	if (getent(defent, "default") == 1) {		char *getstr();		char *cp=defstrs;		HE = getstr("he", &cp);		HN = getstr("hn", &cp);		IM = getstr("im", &cp);		if (HN && *HN)			(void) strcpy(host_name, HN);		if (IM == 0)			IM = "";	} else {		IM = DEFAULT_IM;		HE = 0;	}	edithost(HE, host_name);	if (hostinfo && *IM)		putf(IM, ptyibuf2);	if (pcc)		(void) strncat(ptyibuf2, ptyip, pcc+1);	ptyip = ptyibuf2;	pcc = strlen(ptyip);#ifdef	LINEMODE	/*	 * Last check to make sure all our states are correct.	 */	init_termbuf();	localstat();#endif	/* LINEMODE */	DIAG(TD_REPORT,		{sprintf(nfrontp, "td: Entering processing loop\r\n");		 nfrontp += strlen(nfrontp);});#ifdef	convex	startslave(host);#endif	for (;;) {		fd_set ibits, obits, xbits;		register int c;		if (ncc < 0 && pcc < 0)			break;#if	defined(CRAY2) && defined(UNICOS5)		if (needtermstat)			_termstat();#endif	/* defined(CRAY2) && defined(UNICOS5) */		FD_ZERO(&ibits);		FD_ZERO(&obits);		FD_ZERO(&xbits);		/*		 * Never look for input if there's still		 * stuff in the corresponding output buffer		 */		if (nfrontp - nbackp || pcc > 0) {			FD_SET(f, &obits);		} else {			FD_SET(p, &ibits);		}		if (pfrontp - pbackp || ncc > 0) {			FD_SET(p, &obits);		} else {			FD_SET(f, &ibits);		}		if (!SYNCHing) {			FD_SET(f, &xbits);		}		if ((c = select(16, &ibits, &obits, &xbits,						(struct timeval *)0)) < 1) {			if (c == -1) {				if (errno == EINTR) {					continue;				}			}			sleep(5);			continue;		}		/*		 * Any urgent data?		 */		if (FD_ISSET(net, &xbits)) {		    SYNCHing = 1;		}		/*		 * Something to read from the network...		 */		if (FD_ISSET(net, &ibits)) {#if	!defined(SO_OOBINLINE)			/*			 * In 4.2 (and 4.3 beta) systems, the			 * OOB indication and data handling in the kernel			 * is such that if two separate TCP Urgent requests			 * come in, one byte of TCP data will be overlaid.			 * This is fatal for Telnet, but we try to live			 * with it.			 *			 * In addition, in 4.2 (and...), a special protocol			 * is needed to pick up the TCP Urgent data in			 * the correct sequence.			 *			 * What we do is:  if we think we are in urgent			 * mode, we look to see if we are "at the mark".			 * If we are, we do an OOB receive.  If we run			 * this twice, we will do the OOB receive twice,			 * but the second will fail, since the second			 * time we were "at the mark", but there wasn't			 * any data there (the kernel doesn't reset			 * "at the mark" until we do a normal read).			 * Once we've read the OOB data, we go ahead			 * and do normal reads.			 *			 * There is also another problem, which is that			 * since the OOB byte we read doesn't put us			 * out of OOB state, and since that byte is most			 * likely the TELNET DM (data mark), we would			 * stay in the TELNET SYNCH (SYNCHing) state.			 * So, clocks to the rescue.  If we've "just"			 * received a DM, then we test for the			 * presence of OOB data when the receive OOB			 * fails (and AFTER we did the normal mode read			 * to clear "at the mark").			 */		    if (SYNCHing) {			int atmark;			(void) ioctl(net, SIOCATMARK, (char *)&atmark);			if (atmark) {			    ncc = recv(net, netibuf, sizeof (netibuf), MSG_OOB);			    if ((ncc == -1) && (errno == EINVAL)) {				ncc = read(net, netibuf, sizeof (netibuf));				if (sequenceIs(didnetreceive, gotDM)) {				    SYNCHing = stilloob(net);				}			    }			} else {			    ncc = read(net, netibuf, sizeof (netibuf));			}		    } else {			ncc = read(net, netibuf, sizeof (netibuf));		    }		    settimer(didnetreceive);#else	/* !defined(SO_OOBINLINE)) */		    ncc = read(net, netibuf, sizeof (netibuf));#endif	/* !defined(SO_OOBINLINE)) */		    if (ncc < 0 && errno == EWOULDBLOCK)			ncc = 0;		    else {			if (ncc <= 0) {			    break;			}			netip = netibuf;		    }		    DIAG((TD_REPORT | TD_NETDATA),			    {sprintf(nfrontp, "td: netread %d chars\r\n", ncc);			     nfrontp += strlen(nfrontp);});		    DIAG(TD_NETDATA, printdata("nd", netip, ncc));		}		/*		 * Something to read from the pty...		 */		if (FD_ISSET(p, &ibits)) {#ifndef	STREAMSPTY			pcc = read(p, ptyibuf, BUFSIZ);#else			pcc = readstream(p, ptyibuf, BUFSIZ);#endif			/*			 * On some systems, if we try to read something			 * off the master side before the slave side is			 * opened, we get EIO.			 */			if (pcc < 0 && (errno == EWOULDBLOCK ||#ifdef	EAGAIN					errno == EAGAIN ||#endif					errno == EIO)) {				pcc = 0;			} else {				if (pcc <= 0)					break;#if	!defined(CRAY2) || !defined(UNICOS5)#ifdef	LINEMODE				/*				 * If ioctl from pty, pass it through net				 */				if (ptyibuf[0] & TIOCPKT_IOCTL) {					copy_termbuf(ptyibuf+1, pcc-1);					localstat();					pcc = 1;				}#endif	/* LINEMODE */				if (ptyibuf[0] & TIOCPKT_FLUSHWRITE) {					netclear();	/* clear buffer back */#ifndef	NO_URGENT					/*					 * There are client telnets on some					 * operating systems get screwed up					 * royally if we send them urgent					 * mode data.					 */					*nfrontp++ = IAC;					*nfrontp++ = DM;					neturg = nfrontp-1; /* off by one XXX */#endif				}				if (his_state_is_will(TELOPT_LFLOW) &&				    (ptyibuf[0] &				     (TIOCPKT_NOSTOP|TIOCPKT_DOSTOP))) {					int newflow =					    ptyibuf[0] & TIOCPKT_DOSTOP ? 1 : 0;					if (newflow != flowmode) {						flowmode = newflow;						(void) sprintf(nfrontp,							"%c%c%c%c%c%c",							IAC, SB, TELOPT_LFLOW,							flowmode ? LFLOW_ON								 : LFLOW_OFF,							IAC, SE);						nfrontp += 6;					}				}				pcc--;				ptyip = ptyibuf+1;#else	/* defined(CRAY2) && defined(UNICOS5) */				if (!uselinemode) {					unpcc = pcc;					unptyip = ptyibuf;					pcc = term_output(&unptyip, ptyibuf2,								&unpcc, BUFSIZ);					ptyip = ptyibuf2;				} else					ptyip = ptyibuf;#endif	/* defined(CRAY2) && defined(UNICOS5) */			}		}		while (pcc > 0) {			if ((&netobuf[BUFSIZ] - nfrontp) < 2)				break;			c = *ptyip++ & 0377, pcc--;			if (c == IAC)				*nfrontp++ = c;#if	defined(CRAY2) && defined(UNICOS5)			else if (c == '\n' &&				     my_state_is_wont(TELOPT_BINARY) && newmap)				*nfrontp++ = '\r';#endif	/* defined(CRAY2) && defined(UNICOS5) */			*nfrontp++ = c;			if ((c == '\r') && (my_state_is_wont(TELOPT_BINARY))) {				if (pcc > 0 && ((*ptyip & 0377) == '\n')) {					*nfrontp++ = *ptyip++ & 0377;					pcc--;				} else					*nfrontp++ = '\0';			}		}#if	defined(CRAY2) && defined(UNICOS5)		/*		 * If chars were left over from the terminal driver,		 * note their existence.		 */		if (!uselinemode && unpcc) {			pcc = unpcc;			unpcc = 0;			ptyip = unptyip;		}#endif	/* defined(CRAY2) && defined(UNICOS5) */		if (FD_ISSET(f, &obits) && (nfrontp - nbackp) > 0)			netflush();		if (ncc > 0)			telrcv();		if (FD_ISSET(p, &obits) && (pfrontp - pbackp) > 0)			ptyflush();	}	cleanup(0);}  /* end of telnet */	#ifndef	TCSIG# ifdef	TIOCSIG#  define TCSIG TIOCSIG# endif#endif#ifdef	STREAMSPTYint flowison = -1;  /* current state of flow: -1 is unknown */int readstream(p, ibuf, bufsize)	int p;	char *ibuf;	int bufsize;{	int flags = 0;	int ret = 0;	struct termios *tsp;	struct termio *tp;	struct iocblk *ip;	char vstop, vstart;	int ixon;	int newflow;	strbufc.maxlen = BUFSIZ;	strbufc.buf = (char *)ctlbuf;	strbufd.maxlen = bufsize-1;	strbufd.len = 0;	strbufd.buf = ibuf+1;	ibuf[0] = 0;	ret = getmsg(p, &strbufc, &strbufd, &flags);	if (ret < 0)  /* error of some sort -- probably EAGAIN */		return(-1);	if (strbufc.len <= 0 || ctlbuf[0] == M_DATA) {		/* data message */		if (strbufd.len > 0) {			/* real data */			return(strbufd.len + 1);	/* count header char */		} else {			/* nothing there */			errno = EAGAIN;			return(-1);		}	}	/*	 * It's a control message.  Return 1, to look at the flag we set	 */	switch (ctlbuf[0]) {	case M_FLUSH:		if (ibuf[1] & FLUSHW)			ibuf[0] = TIOCPKT_FLUSHWRITE;		return(1);	case M_IOCTL:		ip = (struct iocblk *) (ibuf+1);		switch (ip->ioc_cmd) {		case TCSETS:		case TCSETSW:		case TCSETSF:			tsp = (struct termios *)					(ibuf+1 + sizeof(struct iocblk));			vstop = tsp->c_cc[VSTOP];			vstart = tsp->c_cc[VSTART];			ixon = tsp->c_iflag & IXON;			break;		case TCSETA:		case TCSETAW:		case TCSETAF:			tp = (struct termio *) (ibuf+1 + sizeof(struct iocblk));			vstop = tp->c_cc[VSTOP];			vstart = tp->c_cc[VSTART];			ixon = tp->c_iflag & IXON;      			break;		default:			errno = EAGAIN;			return(-1);		}		newflow =  (ixon && (vstart == 021) && (vstop == 023)) ? 1 : 0;		if (newflow != flowison) {  /* it's a change */			flowison = newflow;			ibuf[0] = newflow ? TIOCPKT_DOSTOP : TIOCPKT_NOSTOP;			return(1);		}	}	/* nothing worth doing anything about */	errno = EAGAIN;	return(-1);}#endif /* STREAMSPTY *//* * Send interrupt to process on other side of pty. * If it is in raw mode, just write NULL; * otherwise, write intr char. */	voidinterrupt(){	ptyflush();	/* half-hearted */#ifdef	TCSIG	(void) ioctl(pty, TCSIG, (char *)SIGINT);#else	/* TCSIG */	init_termbuf();	*pfrontp++ = slctab[SLC_IP].sptr ?			(unsigned char)*slctab[SLC_IP].sptr : '\177';#endif	/* TCSIG */}/* * Send quit to process on other side of pty. * If it is in raw mode, just write NULL; * otherwise, write quit char. */	voidsendbrk(){	ptyflush();	/* half-hearted */#ifdef	TCSIG	(void) ioctl(pty, TCSIG, (char *)SIGQUIT);#else	/* TCSIG */	init_termbuf();	*pfrontp++ = slctab[SLC_ABORT].sptr ?			(unsigned char)*slctab[SLC_ABORT].sptr : '\034';#endif	/* TCSIG */}	voidsendsusp(){#ifdef	SIGTSTP	ptyflush();	/* half-hearted */# ifdef	TCSIG	(void) ioctl(pty, TCSIG, (char *)SIGTSTP);# else	/* TCSIG */	*pfrontp++ = slctab[SLC_SUSP].sptr ?			(unsigned char)*slctab[SLC_SUSP].sptr : '\032';# endif	/* TCSIG */#endif	/* SIGTSTP */}/* * When we get an AYT, if ^T is enabled, use that.  Otherwise, * just send back "[Yes]". */	voidrecv_ayt(){#if	defined(SIGINFO) && defined(TCSIG)	if (slctab[SLC_AYT].sptr && *slctab[SLC_AYT].sptr != _POSIX_VDISABLE) {		(void) ioctl(pty, TCSIG, (char *)SIGINFO);		return;	}#endif	(void) strcpy(nfrontp, "\r\n[Yes]\r\n");	nfrontp += 9;}	voiddoeof(){	init_termbuf();#if	defined(LINEMODE) && defined(USE_TERMIO) && (VEOF == VMIN)	if (!tty_isediting()) {		extern char oldeofc;		*pfrontp++ = oldeofc;		return;	}#endif	*pfrontp++ = slctab[SLC_EOF].sptr ?			(unsigned char)*slctab[SLC_EOF].sptr : '\004';}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色图清纯唯美| 欧美成人伊人久久综合网| 国产欧美精品国产国产专区| 欧美性猛交xxxxxxxx| 亚洲欧美日韩国产另类专区| a亚洲天堂av| 亚洲伦在线观看| 欧美性大战久久久久久久蜜臀| 亚洲 欧美综合在线网络| 在线播放亚洲一区| 日本欧美一区二区三区乱码| 精品国产免费一区二区三区香蕉 | 国产精品私房写真福利视频| 国产成人鲁色资源国产91色综| 一色屋精品亚洲香蕉网站| 91免费看片在线观看| 亚洲线精品一区二区三区八戒| 欧美乱熟臀69xxxxxx| 狠狠色狠狠色综合系列| 国产精品无码永久免费888| 成人avav在线| 日韩电影免费在线| 久久久久9999亚洲精品| 91亚洲精华国产精华精华液| 亚洲成人资源网| 久久综合狠狠综合久久综合88| 99在线热播精品免费| 午夜亚洲福利老司机| 久久久亚洲国产美女国产盗摄 | 欧美欧美欧美欧美首页| 老色鬼精品视频在线观看播放| 久久精品一区二区三区不卡| 不卡的电视剧免费网站有什么| 亚洲va欧美va国产va天堂影院| 欧美成人一区二区三区片免费| av在线这里只有精品| 日韩国产一二三区| 国产精品日韩成人| 91精品一区二区三区在线观看| 国产精品影视在线观看| 亚洲一区二区在线免费观看视频| 欧美一区二区三区白人| 99国产精品99久久久久久| 石原莉奈在线亚洲二区| 国产精品系列在线| 日韩欧美高清一区| 99re亚洲国产精品| 精品亚洲国产成人av制服丝袜 | 久久精品国产澳门| 亚洲精品成人精品456| 欧美成人激情免费网| 日本伦理一区二区| 国产激情视频一区二区在线观看 | 欧美日韩美女一区二区| 国产成人精品免费在线| 日韩高清欧美激情| 一区二区三区中文字幕电影| 久久免费美女视频| 日韩三区在线观看| 欧美性大战久久久久久久蜜臀| 99视频超级精品| 国产乱理伦片在线观看夜一区| 蜜臀久久99精品久久久画质超高清 | 精品伦理精品一区| 欧美视频一区在线| 色综合网色综合| 国产mv日韩mv欧美| 国产成人综合自拍| 韩国成人福利片在线播放| 三级在线观看一区二区| 亚洲影视在线观看| 亚洲综合激情网| 亚洲人精品一区| 亚洲日本欧美天堂| 自拍偷自拍亚洲精品播放| 国产色综合久久| 欧美经典三级视频一区二区三区| 久久在线免费观看| 欧美va亚洲va香蕉在线| 欧美一区二区三区人| 91精品免费观看| 欧美精品18+| 欧美电影在线免费观看| 欧美精品少妇一区二区三区| 欧美日韩高清一区二区三区| 欧美日韩一区二区三区高清| 欧美吞精做爰啪啪高潮| 欧美性猛交xxxxxx富婆| 3d动漫精品啪啪| 欧美一级xxx| 2021国产精品久久精品| 久久久久久久久蜜桃| 日本一区二区高清| 亚洲欧洲国产日本综合| 亚洲精品美腿丝袜| 婷婷久久综合九色综合伊人色| 亚洲自拍偷拍综合| 日韩激情中文字幕| 精品亚洲国产成人av制服丝袜| 国产成人综合视频| 成人av电影在线网| 欧美撒尿777hd撒尿| 7777精品伊人久久久大香线蕉完整版| 91精品国产一区二区| 欧美精品一区二区在线播放| 亚洲国产精品成人综合色在线婷婷| 国产精品网站在线观看| 一区二区三区中文在线观看| 日韩精品五月天| 国产精品一区二区不卡| 一本大道综合伊人精品热热| 制服丝袜中文字幕一区| 久久影院午夜片一区| 亚洲欧美福利一区二区| 日韩精品一二区| 成人av资源网站| 欧美日韩在线直播| 综合久久久久综合| 日韩女优av电影在线观看| 日韩午夜激情电影| 国产精品乱码妇女bbbb| 亚洲综合精品自拍| 国产在线精品视频| 91黄视频在线| 久久美女艺术照精彩视频福利播放 | 99热国产精品| 欧美一级片在线| 亚洲人成7777| 久草精品在线观看| 欧美综合视频在线观看| 欧美成人精品二区三区99精品| 亚洲欧洲三级电影| 久久爱www久久做| 日本道在线观看一区二区| 亚洲精品一区二区三区蜜桃下载| 中文一区一区三区高中清不卡| 日本特黄久久久高潮| 91亚洲精品一区二区乱码| 欧美videos大乳护士334| 亚洲综合激情网| zzijzzij亚洲日本少妇熟睡| 欧美不卡在线视频| 亚洲国产精品久久艾草纯爱| 成人黄色网址在线观看| 日韩欧美一级二级三级久久久| 亚洲老司机在线| 成人免费看片app下载| 欧美精品一区二区蜜臀亚洲| 亚洲国产精品久久久久秋霞影院| caoporen国产精品视频| 久久久久久麻豆| 久久精品国产亚洲5555| 欧美日韩高清一区| 亚洲精品免费一二三区| 99国产精品久久| 中文字幕不卡在线播放| 国产综合色产在线精品| 日韩欧美亚洲一区二区| 性感美女久久精品| 欧日韩精品视频| 夜色激情一区二区| 99久久er热在这里只有精品15 | 国产成人精品www牛牛影视| 欧美高清dvd| 亚洲一区二区三区自拍| 91国在线观看| 亚洲欧美日韩在线播放| 成人黄动漫网站免费app| 中文字幕av不卡| 成人晚上爱看视频| 中文字幕精品在线不卡| 丁香五精品蜜臀久久久久99网站| 久久美女艺术照精彩视频福利播放| 麻豆精品在线播放| 精品国产免费人成在线观看| 美女视频一区在线观看| 337p日本欧洲亚洲大胆精品| 黑人巨大精品欧美一区| 久久嫩草精品久久久精品| 国产精品99久久久久久久vr| 国产午夜精品久久久久久免费视| 国产精品88888| 国产精品美女久久久久aⅴ国产馆| 国产精品91一区二区| 国产精品成人在线观看 | 色网站国产精品| 亚洲高清免费一级二级三级| 欧美日韩精品二区第二页| 日韩激情一二三区| 日韩精品在线一区| 国产精品亚洲一区二区三区妖精| 欧美激情在线看| 色天使久久综合网天天| 婷婷中文字幕综合| 欧美v亚洲v综合ⅴ国产v| 粉嫩蜜臀av国产精品网站| 亚洲女与黑人做爰| 欧美一区二区三区视频免费| 国产精品996| 一区二区三区 在线观看视频|