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

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

?? print-ppp.c

?? TCPDUMP的C語言源代碼,是在數據鏈路層的應用
?? C
?? 第 1 頁 / 共 3 頁
字號:
		return 0;	if (len < 2) {	        printf("\n\t  %s Option (0x%02x), length %u (bogus, should be >= 2)",        	       tok2str(ccpconfopts_values, "Unknown", opt),	               opt,        	       len);        	return 0;        }        printf("\n\t  %s Option (0x%02x), length %u:",               tok2str(ccpconfopts_values, "Unknown", opt),               opt,               len);	switch (opt) {                /* fall through --> default: nothing supported yet */	case CCPOPT_OUI:	case CCPOPT_PRED1:	case CCPOPT_PRED2:	case CCPOPT_PJUMP:	case CCPOPT_HPPPC:	case CCPOPT_STACLZS:	case CCPOPT_MPPC:	case CCPOPT_GFZA:	case CCPOPT_V42BIS:	case CCPOPT_BSDCOMP:	case CCPOPT_LZSDCP:	case CCPOPT_MVRCA:	case CCPOPT_DEC:	case CCPOPT_DEFLATE:	case CCPOPT_RESV:	default:                if(vflag<2)                        print_unknown_data(&p[2],"\n\t    ",len-2);		break;	}        if (vflag>1)                print_unknown_data(&p[2],"\n\t    ",len-2); /* exclude TLV header */	return len;trunc:	printf("[|ccp]");	return 0;}/* BACP config options */static intprint_bacp_config_options(const u_char *p, int length){	int len, opt;	if (length < 2)		return 0;	TCHECK2(*p, 2);	len = p[1];	opt = p[0];	if (length < len)		return 0;	if (len < 2) {	        printf("\n\t  %s Option (0x%02x), length %u (bogus, should be >= 2)",        	       tok2str(bacconfopts_values, "Unknown", opt),	               opt,        	       len);        	return 0;        }        printf("\n\t  %s Option (0x%02x), length %u:",               tok2str(bacconfopts_values, "Unknown", opt),               opt,               len);	switch (opt) {	case BACPOPT_FPEER:		TCHECK2(*(p + 2), 4);		printf(", Magic-Num 0x%08x", EXTRACT_32BITS(p + 2));                break;	default:                if(vflag<2)                        print_unknown_data(&p[2],"\n\t    ",len-2);		break;	}        if (vflag>1)                print_unknown_data(&p[2],"\n\t    ",len-2); /* exclude TLV header */	return len;trunc:	printf("[|bacp]");	return 0;}static voidppp_hdlc(const u_char *p, int length){	u_char *b, *s, *t, c;	int i, proto;	const void *se;	b = (u_int8_t *)malloc(length);	if (b == NULL)		return;	/*	 * Unescape all the data into a temporary, private, buffer.	 * Do this so that we dont overwrite the original packet	 * contents.	 */	for (s = (u_char *)p, t = b, i = length; i > 0; i--) {		c = *s++;		if (c == 0x7d) {			if (i > 1) {				i--;				c = *s++ ^ 0x20;			} else				continue;		}		*t++ = c;	}	se = snapend;	snapend = t;        /* now lets guess about the payload codepoint format */        proto = *b; /* start with a one-octet codepoint guess */                switch (proto) {        case PPP_IP:		ip_print(gndo, b+1, t - b - 1);		goto cleanup;#ifdef INET6        case PPP_IPV6:            ip6_print(b+1, t - b - 1);            goto cleanup;#endif        default: /* no luck - try next guess */            break;        }        proto = EXTRACT_16BITS(b); /* next guess - load two octets */        switch (proto) {        case (PPP_ADDRESS << 8 | PPP_CONTROL): /* looks like a PPP frame */            proto = EXTRACT_16BITS(b+2); /* load the PPP proto-id */            handle_ppp(proto, b+4, t - b - 4);            break;        default: /* last guess - proto must be a PPP proto-id */            handle_ppp(proto, b+2, t - b - 2);            break;        }cleanup:        snapend = se;	free(b);        return;}/* PPP */static voidhandle_ppp(u_int proto, const u_char *p, int length){        if ((proto & 0xff00) == 0x7e00) {/* is this an escape code ? */            ppp_hdlc(p-1, length);            return;        }	switch (proto) {	case PPP_LCP: /* fall through */	case PPP_IPCP:	case PPP_OSICP:	case PPP_MPLSCP:	case PPP_IPV6CP:	case PPP_CCP:	case PPP_BACP:		handle_ctrl_proto(proto, p, length);		break;        case PPP_ML:                handle_mlppp(p, length);                break;	case PPP_CHAP:		handle_chap(p, length);		break;	case PPP_PAP:		handle_pap(p, length);		break;	case PPP_BAP:		/* XXX: not yet completed */		handle_bap(p, length);		break;	case ETHERTYPE_IP:	/*XXX*/        case PPP_VJNC:	case PPP_IP:		ip_print(gndo, p, length);		break;#ifdef INET6	case ETHERTYPE_IPV6:	/*XXX*/	case PPP_IPV6:		ip6_print(p, length);		break;#endif	case ETHERTYPE_IPX:	/*XXX*/	case PPP_IPX:		ipx_print(p, length);		break;	case PPP_OSI:	        isoclns_print(p, length, length);	        break;	case PPP_MPLS_UCAST:	case PPP_MPLS_MCAST:		mpls_print(p, length);		break;	case PPP_COMP:		printf("compressed PPP data");		break;	default:		printf("%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", proto));		print_unknown_data(p,"\n\t",length);		break;	}}/* Standard PPP printer */u_intppp_print(register const u_char *p, u_int length){	u_int proto,ppp_header;        u_int olen = length; /* _o_riginal length */	u_int hdr_len = 0;	/*	 * Here, we assume that p points to the Address and Control	 * field (if they present).	 */	if (length < 2)		goto trunc;	TCHECK2(*p, 2);        ppp_header = EXTRACT_16BITS(p);        switch(ppp_header) {        case (PPP_WITHDIRECTION_IN  << 8 | PPP_CONTROL):            if (eflag) printf("In  ");            p += 2;            length -= 2;            hdr_len += 2;            break;        case (PPP_WITHDIRECTION_OUT << 8 | PPP_CONTROL):            if (eflag) printf("Out ");            p += 2;            length -= 2;            hdr_len += 2;            break;        case (PPP_ADDRESS << 8 | PPP_CONTROL):            p += 2;			/* ACFC not used */            length -= 2;            hdr_len += 2;            break;        default:            break;        }	if (length < 2)		goto trunc;	TCHECK(*p);	if (*p % 2) {		proto = *p;		/* PFC is used */		p++;		length--;		hdr_len++;	} else {		TCHECK2(*p, 2);		proto = EXTRACT_16BITS(p);		p += 2;		length -= 2;		hdr_len += 2;	}        if (eflag)            printf("%s (0x%04x), length %u: ",                   tok2str(ppptype2str, "unknown", proto),                   proto,                   olen);	handle_ppp(proto, p, length);	return (hdr_len);trunc:	printf("[|ppp]");	return (0);}/* PPP I/F printer */u_intppp_if_print(const struct pcap_pkthdr *h, register const u_char *p){	register u_int length = h->len;	register u_int caplen = h->caplen;	if (caplen < PPP_HDRLEN) {		printf("[|ppp]");		return (caplen);	}#if 0	/*	 * XXX: seems to assume that there are 2 octets prepended to an	 * actual PPP frame. The 1st octet looks like Input/Output flag	 * while 2nd octet is unknown, at least to me	 * (mshindo@mshindo.net).	 *	 * That was what the original tcpdump code did.	 *	 * FreeBSD's "if_ppp.c" *does* set the first octet to 1 for outbound	 * packets and 0 for inbound packets - but only if the	 * protocol field has the 0x8000 bit set (i.e., it's a network	 * control protocol); it does so before running the packet through	 * "bpf_filter" to see if it should be discarded, and to see	 * if we should update the time we sent the most recent packet...	 *	 * ...but it puts the original address field back after doing	 * so.	 *	 * NetBSD's "if_ppp.c" doesn't set the first octet in that fashion.	 *	 * I don't know if any PPP implementation handed up to a BPF	 * device packets with the first octet being 1 for outbound and	 * 0 for inbound packets, so I (guy@alum.mit.edu) don't know	 * whether that ever needs to be checked or not.	 *	 * Note that NetBSD has a DLT_PPP_SERIAL, which it uses for PPP,	 * and its tcpdump appears to assume that the frame always	 * begins with an address field and a control field, and that	 * the address field might be 0x0f or 0x8f, for Cisco	 * point-to-point with HDLC framing as per section 4.3.1 of RFC	 * 1547, as well as 0xff, for PPP in HDLC-like framing as per	 * RFC 1662.	 *	 * (Is the Cisco framing in question what DLT_C_HDLC, in	 * BSD/OS, is?)	 */	if (eflag)		printf("%c %4d %02x ", p[0] ? 'O' : 'I', length, p[1]);#endif	ppp_print(p, length);	return (0);}/* * PPP I/F printer to use if we know that RFC 1662-style PPP in HDLC-like * framing, or Cisco PPP with HDLC framing as per section 4.3.1 of RFC 1547, * is being used (i.e., we don't check for PPP_ADDRESS and PPP_CONTROL, * discard them *if* those are the first two octets, and parse the remaining * packet as a PPP packet, as "ppp_print()" does). * * This handles, for example, DLT_PPP_SERIAL in NetBSD. */u_intppp_hdlc_if_print(const struct pcap_pkthdr *h, register const u_char *p){	register u_int length = h->len;	register u_int caplen = h->caplen;	u_int proto;	u_int hdrlen = 0;	if (caplen < 2) {		printf("[|ppp]");		return (caplen);	}	switch (p[0]) {	case PPP_ADDRESS:		if (caplen < 4) {			printf("[|ppp]");			return (caplen);		}		if (eflag)			printf("%02x %02x %d ", p[0], p[1], length);		p += 2;		length -= 2;		hdrlen += 2;		proto = EXTRACT_16BITS(p);		p += 2;		length -= 2;		hdrlen += 2;		printf("%s: ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", proto));		handle_ppp(proto, p, length);		break;	case CHDLC_UNICAST:	case CHDLC_BCAST:		return (chdlc_if_print(h, p));	default:		if (eflag)			printf("%02x %02x %d ", p[0], p[1], length);		p += 2;		length -= 2;		hdrlen += 2;		/*		 * XXX - NetBSD's "ppp_netbsd_serial_if_print()" treats		 * the next two octets as an Ethernet type; does that		 * ever happen?		 */		printf("unknown addr %02x; ctrl %02x", p[0], p[1]);		break;	}	return (hdrlen);}#define PPP_BSDI_HDRLEN 24/* BSD/OS specific PPP printer */u_intppp_bsdos_if_print(const struct pcap_pkthdr *h _U_, register const u_char *p _U_){	register int hdrlength;#ifdef __bsdi__	register u_int length = h->len;	register u_int caplen = h->caplen;	u_int16_t ptype;	const u_char *q;	int i;	if (caplen < PPP_BSDI_HDRLEN) {		printf("[|ppp]");		return (caplen)	}	hdrlength = 0;#if 0	if (p[0] == PPP_ADDRESS && p[1] == PPP_CONTROL) {		if (eflag)			printf("%02x %02x ", p[0], p[1]);		p += 2;		hdrlength = 2;	}	if (eflag)		printf("%d ", length);	/* Retrieve the protocol type */	if (*p & 01) {		/* Compressed protocol field */		ptype = *p;		if (eflag)			printf("%02x ", ptype);		p++;		hdrlength += 1;	} else {		/* Un-compressed protocol field */		ptype = ntohs(*(u_int16_t *)p);		if (eflag)			printf("%04x ", ptype);		p += 2;		hdrlength += 2;	}#else	ptype = 0;	/*XXX*/	if (eflag)		printf("%c ", p[SLC_DIR] ? 'O' : 'I');	if (p[SLC_LLHL]) {		/* link level header */		struct ppp_header *ph;		q = p + SLC_BPFHDRLEN;		ph = (struct ppp_header *)q;		if (ph->phdr_addr == PPP_ADDRESS		 && ph->phdr_ctl == PPP_CONTROL) {			if (eflag)				printf("%02x %02x ", q[0], q[1]);			ptype = ntohs(ph->phdr_type);			if (eflag && (ptype == PPP_VJC || ptype == PPP_VJNC)) {				printf("%s ", tok2str(ppptype2str,						"proto-#%d", ptype));			}		} else {			if (eflag) {				printf("LLH=[");				for (i = 0; i < p[SLC_LLHL]; i++)					printf("%02x", q[i]);				printf("] ");			}		}	}	if (eflag)		printf("%d ", length);	if (p[SLC_CHL]) {		q = p + SLC_BPFHDRLEN + p[SLC_LLHL];		switch (ptype) {		case PPP_VJC:			ptype = vjc_print(q, ptype);			hdrlength = PPP_BSDI_HDRLEN;			p += hdrlength;			switch (ptype) {			case PPP_IP:				ip_print(p, length);				break;#ifdef INET6			case PPP_IPV6:				ip6_print(p, length);				break;#endif			case PPP_MPLS_UCAST:			case PPP_MPLS_MCAST:				mpls_print(p, length);				break;			}			goto printx;		case PPP_VJNC:			ptype = vjc_print(q, ptype);			hdrlength = PPP_BSDI_HDRLEN;			p += hdrlength;			switch (ptype) {			case PPP_IP:				ip_print(p, length);				break;#ifdef INET6			case PPP_IPV6:				ip6_print(p, length);				break;#endif			case PPP_MPLS_UCAST:			case PPP_MPLS_MCAST:				mpls_print(p, length);				break;			}			goto printx;		default:			if (eflag) {				printf("CH=[");				for (i = 0; i < p[SLC_LLHL]; i++)					printf("%02x", q[i]);				printf("] ");			}			break;		}	}	hdrlength = PPP_BSDI_HDRLEN;#endif	length -= hdrlength;	p += hdrlength;	switch (ptype) {	case PPP_IP:		ip_print(p, length);		break;#ifdef INET6	case PPP_IPV6:		ip6_print(p, length);		break;#endif        case PPP_MPLS_UCAST:        case PPP_MPLS_MCAST:                mpls_print(p, length);                break;	default:		printf("%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", ptype));	}printx:#else /* __bsdi */	hdrlength = 0;#endif /* __bsdi__ */	return (hdrlength);}/* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99热在这里有精品免费| 久久久99精品免费观看不卡| 亚洲一区二区三区在线播放| 欧美日韩一区二区电影| 午夜国产精品影院在线观看| 91在线精品秘密一区二区| 亚洲天堂免费在线观看视频| 欧美日免费三级在线| 激情图区综合网| 亚洲香肠在线观看| 中文字幕欧美区| 欧美日本国产视频| 国产精品一二三在| 亚洲一区二区视频在线| wwwwxxxxx欧美| 欧美一区二区三区视频| 91亚洲大成网污www| 国产一区91精品张津瑜| 亚洲精品菠萝久久久久久久| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 五月天亚洲精品| 久久久五月婷婷| 日韩视频免费观看高清完整版在线观看 | 欧美一级免费观看| 色综合久久久久| 日本韩国欧美在线| 91论坛在线播放| 成人黄色免费短视频| 寂寞少妇一区二区三区| 国产精品77777竹菊影视小说| 秋霞av亚洲一区二区三| 美国一区二区三区在线播放| 日韩精品乱码av一区二区| 亚洲国产精品视频| 亚洲第一主播视频| 亚洲一区国产视频| 亚洲一级二级三级| 蜜臀av一区二区在线免费观看| 日韩精品一二三四| 国产一区二区不卡在线| 国产乱码字幕精品高清av | 国产精品视频一区二区三区不卡| 91精品一区二区三区久久久久久| 色哟哟一区二区| 国产亚洲成年网址在线观看| 一区二区三区在线观看国产| 极品少妇xxxx精品少妇| 欧美三区在线视频| 国产欧美日本一区视频| 亚洲国产综合色| 成人精品亚洲人成在线| 日韩欧美一二三四区| 尤物在线观看一区| 99国产精品一区| 国产欧美视频在线观看| 日韩精品成人一区二区三区| 一本久道久久综合中文字幕 | 国产成人亚洲精品狼色在线| 26uuuu精品一区二区| 日本欧美一区二区三区乱码| 色综合一个色综合| 中文字幕佐山爱一区二区免费| 国产最新精品免费| 欧美大黄免费观看| 久久se精品一区二区| 日韩欧美激情四射| 久久国产日韩欧美精品| 精品国产制服丝袜高跟| 国产米奇在线777精品观看| 欧美videofree性高清杂交| 亚洲成人av在线电影| 在线免费不卡视频| 亚洲成人一区二区| 国产精品网站在线观看| 91视频一区二区| 亚洲午夜日本在线观看| 欧美亚洲国产一区二区三区va | 在线不卡中文字幕| 捆绑紧缚一区二区三区视频| 中文字幕av一区二区三区高 | 蜜臀久久99精品久久久画质超高清 | 欧美激情综合五月色丁香| 激情欧美一区二区三区在线观看| 欧美一区二区在线播放| 免费成人在线网站| 亚洲卡通动漫在线| 国产精品久久久久久久久快鸭 | 精品国产免费人成电影在线观看四季| 国产成人精品www牛牛影视| 久久成人麻豆午夜电影| 午夜日韩在线电影| 欧美日本一区二区三区四区| 一区二区激情视频| 精品日产卡一卡二卡麻豆| 成人精品国产一区二区4080| 久久99久久久久| 亚洲mv在线观看| 亚洲另类色综合网站| 精品国产sm最大网站免费看| 99热99精品| 久久精品av麻豆的观看方式| 日韩国产在线一| 美女一区二区久久| 亚洲小说欧美激情另类| 亚洲欧美成aⅴ人在线观看| 日本一区二区三区在线不卡| 欧美精品一区二区三区一线天视频| 日本精品免费观看高清观看| 粉嫩嫩av羞羞动漫久久久| 国产精品麻豆欧美日韩ww| 欧美日本韩国一区二区三区视频| 欧美日韩精品一区二区三区四区| 北条麻妃国产九九精品视频| jiyouzz国产精品久久| 成人午夜电影小说| 在线免费一区三区| 欧美日韩aaaaaa| 日韩亚洲欧美一区二区三区| 日韩欧美高清在线| 久久久亚洲精品石原莉奈| 国产精品视频看| 视频一区中文字幕| 日本一不卡视频| 99视频一区二区| 欧美在线观看视频在线| 日韩美女一区二区三区四区| 精品久久久久久久久久久久包黑料| 久久综合九色综合97婷婷女人| 久久久国产一区二区三区四区小说| 18涩涩午夜精品.www| 日本亚洲视频在线| 91在线精品秘密一区二区| 日韩一区二区三区视频在线| 亚洲色图第一区| 国产在线不卡一区| 337p亚洲精品色噜噜噜| 国产精品理论片| 日韩国产高清在线| 色综合久久综合网97色综合| 欧美成人精品1314www| 奇米影视一区二区三区| 日韩欧美亚洲国产另类| 亚洲一区二区三区美女| 国产精品午夜久久| 亚洲国产视频一区| 91丨porny丨蝌蚪视频| 亚洲一区二区欧美| 日韩欧美国产精品一区| 亚洲国产成人va在线观看天堂| 99久久99久久精品免费看蜜桃| 国产日韩三级在线| 国产成人精品亚洲777人妖| 久久女同性恋中文字幕| 久久99热99| 亚洲女与黑人做爰| 日本不卡视频在线观看| 在线影视一区二区三区| 蓝色福利精品导航| 日韩精品亚洲一区| 洋洋成人永久网站入口| 国产精品毛片久久久久久| 91精品在线免费观看| 欧美性色综合网| 国产激情偷乱视频一区二区三区| 国产精品福利一区二区三区| 欧美日韩三级视频| 94色蜜桃网一区二区三区| 免费成人性网站| 午夜精品影院在线观看| 国产精品久久毛片| 日韩视频在线你懂得| 欧美亚洲丝袜传媒另类| 97精品久久久久中文字幕| 国产久卡久卡久卡久卡视频精品| 亚洲乱码国产乱码精品精小说| 欧美刺激脚交jootjob| 欧美午夜精品免费| 91麻豆免费看片| 色狠狠一区二区三区香蕉| 成人精品在线视频观看| 国产美女在线观看一区| 石原莉奈在线亚洲二区| 三级一区在线视频先锋 | 欧美日韩一区二区欧美激情| 成人黄色在线看| 色偷偷88欧美精品久久久| 日本精品一区二区三区四区的功能| 成熟亚洲日本毛茸茸凸凹| 国产一区二区三区av电影| 日av在线不卡| 国产盗摄女厕一区二区三区| 国产伦理精品不卡| 在线亚洲一区二区| 在线播放中文一区| 久久精品亚洲国产奇米99| 日韩理论片网站| 日精品一区二区| 国产精品888| 日本福利一区二区| 久久免费精品国产久精品久久久久 |