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

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

?? tftpsubs.c

?? linux tftp源代碼
?? C
字號:
/* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the University of California, Berkeley.  The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */#ifndef lintstatic char sccsid[] = "@(#)tftpsubs.c	5.4 (Berkeley) 6/29/88";#endif /* not lint *//* Simple minded read-ahead/write-behind subroutines for tftp user and   server.  Written originally with multiple buffers in mind, but current   implementation has two buffer logic wired in.   Todo:  add some sort of final error check so when the write-buffer   is finally flushed, the caller can detect if the disk filled up   (or had an i/o error) and return a nak to the other side.			Jim Guyton 10/85 */#include <sys/types.h>#include <sys/socket.h>#include <sys/ioctl.h>#include <netinet/in.h>#include "tftp.h"#include <stdio.h>#define PKTSIZE SEGSIZE+4       /* should be moved to tftp.h */struct bf {	int counter;            /* size of data in buffer, or flag */	char buf[PKTSIZE];      /* room for data packet */} bfs[2];				/* Values for bf.counter  */#define BF_ALLOC -3             /* alloc'd but not yet filled */#define BF_FREE  -2             /* free *//* [-1 .. SEGSIZE] = size of data in the data buffer */static int nextone;     /* index of next buffer to use */static int current;     /* index of buffer in use */			/* control flags for crlf conversions */int newline = 0;        /* fillbuf: in middle of newline expansion */int prevchar = -1;      /* putbuf: previous char (cr check) */unsigned char *rw_init();unsigned char *w_init() { return rw_init(0); }         /* write-behind */unsigned char *r_init() { return rw_init(1); }         /* read-ahead */unsigned char *rw_init(x)              /* init for either read-ahead or write-behind */int x;                  /* zero for write-behind, one for read-head */{	newline = 0;            /* init crlf flag */	prevchar = -1;	bfs[0].counter =  BF_ALLOC;     /* pass out the first buffer */	current = 0;	bfs[1].counter = BF_FREE;	nextone = x;                    /* ahead or behind? */	return (unsigned char *)bfs[0].buf;}/* Have emptied current buffer by sending to net and getting ack.   Free it and return next buffer filled with data. */readit(file, dpp, convert)	FILE *file;                     /* file opened for read */	unsigned char **dpp;	int convert;                    /* if true, convert to ascii */{	struct bf *b;//printf(" ===== readit 1\n");	bfs[current].counter = BF_FREE; /* free old one */	current = !current;             /* "incr" current */	b = &bfs[current];              /* look at new buffer */	if (b->counter == BF_FREE){      /* if it's empty *///printf(" ===== readit 2 file =%p\n",file);		read_ahead(file, convert);      /* fill it */	}/*      assert(b->counter != BF_FREE);  /* check */	*dpp = (unsigned char *)b->buf;        /* set caller's ptr */	return b->counter;}/* * fill the input buffer, doing ascii conversions if requested * conversions are  lf -> cr,lf  and cr -> cr, nul */read_ahead(file, convert)	FILE *file;                     /* file opened for read */	int convert;                    /* if true, convert to ascii */{	register int i;	register char *p;	register int c;	struct bf *b;	unsigned char *dp;	char *th_data;	b = &bfs[nextone];              /* look at "next" buffer */	if (b->counter != BF_FREE)      /* nop if not free */		return;	nextone = !nextone;             /* "incr" next buffer ptr */	dp = (unsigned char *)b->buf;	th_data = &dp[4];//printf("th_data = %s ####### \n",th_data);//printf(" ===== convert = %d filename : %p th_data = %p\n",convert,file,th_data);	if (convert == 0) {//printf(" ===== read_ahead 1\n");		b->counter = read(fileno(file), th_data, SEGSIZE);//printf(" ===== read_ahead 2\n");		return;	}	p = th_data;//printf(" ===== read_ahead 3\n");	for (i = 0 ; i < SEGSIZE; i++) {//printf(" newline = %d \n",newline);		if (newline) {			if (prevchar == '\n')				c = '\n';       /* lf to cr,lf */			else    c = '\0';       /* cr to cr,nul */			newline = 0;		}		else {//printf(" file = %p \n",file);			c = getc(file);//printf("[%x]",c);			if (c == EOF) break;			if (c == '\n' || c == '\r') {				prevchar = c;				c = '\r';				newline = 1;			}		}	       *p++ = c;	}	b->counter = (int)(p - th_data);}/* Update count associated with the buffer, get new buffer   from the queue.  Calls write_behind only if next buffer not   available. */writeit(file, dpp, ct, convert)	FILE *file;	unsigned char **dpp;	int convert;{	bfs[current].counter = ct;      /* set size of data to write */	current = !current;             /* switch to other buffer */	if (bfs[current].counter != BF_FREE)     /* if not free */		write_behind(file, convert);     /* flush it */	bfs[current].counter = BF_ALLOC;        /* mark as alloc'd */	*dpp =  (unsigned char *)bfs[current].buf;	return ct;                      /* this is a lie of course */}/* * Output a buffer to a file, converting from netascii if requested. * CR,NUL -> CR  and CR,LF => LF. * Note spec is undefined if we get CR as last byte of file or a * CR followed by anything else.  In this case we leave it alone. */write_behind(file, convert)	FILE *file;	int convert;{	char *buf;	int count;	register int ct;	register char *p;	register int c;                 /* current character */	struct bf *b;	unsigned char *dp;//printf(" ===== write_behind 1\n");	b = &bfs[nextone];	if (b->counter < -1)            /* anything to flush? */		return 0;               /* just nop if nothing to do *///printf(" ===== write_behind 1\n");	count = b->counter;             /* remember byte count */	b->counter = BF_FREE;           /* reset flag */	dp = (unsigned char *)b->buf;//printf(" ===== write_behind 1\n");	nextone = !nextone;             /* incr for next time */	buf = &dp[4];	if (count <= 0) return -1;      /* nak logic? */	if (convert == 0)		return write(fileno(file), buf, count);	p = buf;	ct = count;	while (ct--) {                  /* loop over the buffer */	    c = *p++;                   /* pick up a character *///printf("(%02x)",c);	    if (prevchar == '\r') {     /* if prev char was cr */		if (c == '\n')          /* if have cr,lf then just */		   fseek(file, -1, 1);  /* smash lf on top of the cr */		else		   if (c == '\0')       /* if have cr,nul then */			goto skipit;    /* just skip over the putc */		/* else just fall through and allow it */	    }	    putc(c, file);skipit:	    prevchar = c;	}//printf("\n");	return count;}/* When an error has occurred, it is possible that the two sides * are out of synch.  Ie: that what I think is the other side's * response to packet N is really their response to packet N-1. * * So, to try to prevent that, we flush all the input queued up * for us on the network connection on our host. * * We return the number of packets we flushed (mostly for reporting * when trace is active). */intsynchnet(f)int	f;		/* socket to flush */{	int i, j = 0;	char rbuf[PKTSIZE];	struct sockaddr_in from;	socklen_t fromlen;	while (1) {		(void) ioctl(f, FIONREAD, &i);		if (i) {			j++;			fromlen = sizeof from;			(void) recvfrom(f, rbuf, sizeof (rbuf), 0,				(struct sockaddr *)&from, &fromlen);		} else {			return(j);		}	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
jlzzjlzz国产精品久久| 日韩精品五月天| 2020日本不卡一区二区视频| 4438成人网| 91精品国产全国免费观看 | 337p粉嫩大胆色噜噜噜噜亚洲| 欧美色涩在线第一页| 精品视频在线免费观看| 精品视频色一区| 日韩欧美黄色影院| 久久蜜桃av一区精品变态类天堂| 欧美精彩视频一区二区三区| 中文字幕中文在线不卡住| 亚洲综合无码一区二区| 亚洲国产美国国产综合一区二区| 天堂成人国产精品一区| 久久国产精品99久久人人澡| 国产一区在线观看麻豆| 成人免费不卡视频| 91久久线看在观草草青青| 欧美在线观看视频在线| 精品欧美黑人一区二区三区| 欧美激情在线一区二区三区| 亚洲精品福利视频网站| 日本中文一区二区三区| 高清在线不卡av| 欧美色精品天天在线观看视频| 3d动漫精品啪啪一区二区竹菊| 久久女同互慰一区二区三区| 亚洲卡通动漫在线| 秋霞午夜鲁丝一区二区老狼| 国产福利精品导航| 欧美体内she精视频| 欧美mv日韩mv国产| 一区二区视频在线看| 久久国产福利国产秒拍| 福利电影一区二区| 欧美一区二区在线看| 国产欧美一区在线| 日韩福利视频网| 97精品久久久午夜一区二区三区| 日韩欧美一区二区不卡| 一区二区三区日韩精品视频| 国内精品国产三级国产a久久| 欧美性猛片xxxx免费看久爱| 欧美国产精品一区| 黑人巨大精品欧美黑白配亚洲| 色婷婷一区二区三区四区| 久久亚洲精华国产精华液| 亚洲成人7777| 99久久国产免费看| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲成a人片在线观看中文| 国产福利精品一区二区| 日韩免费在线观看| 亚洲国产精品久久不卡毛片 | 亚洲女女做受ⅹxx高潮| 激情五月播播久久久精品| 欧美色图12p| 亚洲免费观看高清在线观看| 成人av在线看| 久久精品亚洲麻豆av一区二区| 日本亚洲天堂网| 欧美日韩1区2区| 一区二区三区久久久| 91片黄在线观看| 中文字幕高清不卡| 成人自拍视频在线观看| 久久久精品免费网站| 久久成人免费网| 欧美xingq一区二区| 日本不卡一区二区三区高清视频| 欧美在线一二三| 一区二区三区四区五区视频在线观看| 成人福利视频网站| 中文字幕在线不卡一区| 91色|porny| 亚洲另类中文字| 欧美亚洲国产一卡| 亚洲一区二区三区中文字幕在线| 色诱亚洲精品久久久久久| 综合久久国产九一剧情麻豆| 色噜噜狠狠成人网p站| 一区二区三区加勒比av| 欧美久久久久免费| 免费观看久久久4p| 亚洲精品在线免费观看视频| 久久国产视频网| 中文字幕欧美激情| 欧洲精品中文字幕| 五月婷婷综合在线| 日韩免费看的电影| 国产精品综合av一区二区国产馆| 欧美国产成人在线| 91精品1区2区| 蓝色福利精品导航| 国产精品美女久久久久aⅴ国产馆| 91同城在线观看| 日本va欧美va瓶| 国产精品欧美久久久久无广告| 色婷婷av一区二区三区大白胸| 日韩激情一二三区| 中文字幕免费不卡| 欧美精品久久一区二区三区| 国产综合久久久久久久久久久久| 国产精品乱码一区二三区小蝌蚪| 在线观看免费亚洲| 极品瑜伽女神91| 一区二区三区欧美激情| 亚洲精品在线三区| 欧美中文字幕亚洲一区二区va在线| 精品在线亚洲视频| 亚洲乱码中文字幕综合| 日韩欧美一区二区不卡| 日本伦理一区二区| 国产不卡在线视频| 男女视频一区二区| 亚洲欧美日韩系列| 久久久美女毛片| 91精品一区二区三区久久久久久| 成人美女视频在线看| 久久精品久久久精品美女| 亚洲欧洲99久久| 精品国产免费视频| 91麻豆精品国产自产在线| 97久久人人超碰| 国产成人亚洲精品狼色在线 | 国产成人av网站| 日韩激情一二三区| 一区二区三区在线观看视频| 亚洲国产精品精华液ab| 精品日韩av一区二区| 欧美日韩色一区| 91极品美女在线| 成人av在线看| 成人深夜在线观看| 国产精品99久久久久久有的能看 | 午夜久久久久久久久| 亚洲麻豆国产自偷在线| 中文字幕亚洲欧美在线不卡| 久久久久久久久久美女| 欧美精品一区二区蜜臀亚洲| 制服.丝袜.亚洲.另类.中文| 欧美色手机在线观看| 欧美性受极品xxxx喷水| 在线欧美日韩精品| 色婷婷av久久久久久久| 色狠狠色噜噜噜综合网| 日本精品一区二区三区高清| 99久久久精品| 白白色 亚洲乱淫| 成人app下载| 91麻豆swag| 欧美午夜免费电影| 91精品午夜视频| 欧美一区二区在线视频| 日韩一卡二卡三卡四卡| 精品久久久久久综合日本欧美| 欧美成人在线直播| 欧美精品一区二| 国产精品免费看片| 亚洲柠檬福利资源导航| 亚洲妇熟xx妇色黄| 免费一级片91| 韩日欧美一区二区三区| 成人毛片在线观看| 色噜噜狠狠成人中文综合| 欧美三区免费完整视频在线观看| 91精品国产综合久久婷婷香蕉 | 国产精品一二一区| 风间由美一区二区三区在线观看| 波多野结衣91| 在线观看成人小视频| 欧美一级二级在线观看| 久久久亚洲国产美女国产盗摄| 国产精品久久一卡二卡| 亚洲一区二区三区精品在线| 麻豆精品在线看| 99久久久久久| 欧美一区二区三区四区高清| 国产欧美日韩综合精品一区二区| 1024成人网| 免费不卡在线观看| eeuss影院一区二区三区| 欧美日韩国产一二三| 久久久久久久国产精品影院| 一区二区三区精密机械公司| 加勒比av一区二区| 欧美性三三影院| 欧美极品另类videosde| 午夜精品久久久久久久久久久| 高清视频一区二区| 欧美一区二区三区免费| 中文字幕一区二区三区不卡| 美女视频黄久久| 欧美日韩免费观看一区三区| 欧美国产精品一区| 久久精品99国产精品日本| 欧美自拍偷拍午夜视频| 国产亚洲视频系列|