亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品一区二区不卡| 欧美激情综合五月色丁香小说| 亚洲精品视频一区| 色av成人天堂桃色av| 亚洲sss视频在线视频| 91麻豆精品国产91久久久久久 | 奇米影视在线99精品| 欧美一级久久久| 国产激情偷乱视频一区二区三区| 久久久噜噜噜久久人人看 | 久久久久国产精品麻豆| 国产91综合一区在线观看| 亚洲欧美综合另类在线卡通| 欧美视频一区在线| 国产一区久久久| 亚洲精品一二三区| 精品少妇一区二区三区日产乱码| 国产精品羞羞答答xxdd| 亚洲男同性恋视频| 欧美岛国在线观看| 97国产精品videossex| 日韩不卡一区二区| 国产精品嫩草影院com| 欧美日精品一区视频| 国产乱人伦偷精品视频免下载| 亚洲人成网站在线| 亚洲精品一区二区三区蜜桃下载| 岛国av在线一区| 日本美女一区二区| 亚洲图片你懂的| 亚洲精品一区二区三区精华液| 色婷婷综合久色| 国产综合一区二区| 午夜欧美在线一二页| 国产情人综合久久777777| 欧美色图免费看| 岛国精品在线播放| 另类小说一区二区三区| 一区二区三区在线播放| 日本一区二区三区电影| 5566中文字幕一区二区电影| 99精品久久99久久久久| 美女一区二区视频| 亚洲亚洲精品在线观看| 国产拍欧美日韩视频二区| 日韩一级免费一区| 日韩一级高清毛片| 一本久道久久综合中文字幕| 国产剧情一区在线| 日本午夜精品一区二区三区电影| 中文幕一区二区三区久久蜜桃| 日韩午夜电影在线观看| 色婷婷狠狠综合| 成人99免费视频| 国产乱码精品一品二品| 久热成人在线视频| 婷婷综合五月天| 亚洲成人在线观看视频| 一区二区三区精品在线| 中文字幕成人av| 欧美激情在线一区二区| 精品国产乱码久久久久久浪潮| 欧美无人高清视频在线观看| 91福利视频在线| 91丨porny丨中文| 91在线视频免费91| av亚洲精华国产精华精华| 懂色av中文字幕一区二区三区| 另类小说一区二区三区| 蜜乳av一区二区| 精品在线观看免费| 国产在线日韩欧美| 国产精品1024久久| 国产成人av一区二区三区在线| 国产一区二区三区免费看| 久久aⅴ国产欧美74aaa| 久久精品噜噜噜成人av农村| 美腿丝袜亚洲一区| 国产精品一区二区在线观看不卡 | 精品一区二区成人精品| 免费在线成人网| 久久精品国产亚洲aⅴ| 久久99国产精品久久99| 国产一区二区三区国产| 国产精品1区2区3区在线观看| 国产二区国产一区在线观看| 成人av免费网站| 色婷婷综合中文久久一本| 欧美午夜精品久久久久久孕妇| 欧美日韩精品一区视频| 欧美精品在线观看播放| 精品国精品国产尤物美女| 久久久www免费人成精品| 中文字幕不卡三区| 一区二区三区四区不卡在线| 午夜免费久久看| 精品写真视频在线观看| 成人精品高清在线| 欧美午夜一区二区三区免费大片| 91精品一区二区三区久久久久久| 精品国产91洋老外米糕| 国产精品亲子伦对白| 一区二区三区中文字幕电影| 三级影片在线观看欧美日韩一区二区| 久久精品国产久精国产| 99免费精品在线| 3d成人h动漫网站入口| 久久综合久久综合亚洲| 亚洲精品视频在线看| 久久成人久久鬼色| 欧美日韩精品免费| 日韩一二三四区| 国产精品看片你懂得 | 蜜臂av日日欢夜夜爽一区| 国产成人亚洲精品狼色在线| 日本乱人伦aⅴ精品| 精品国产乱码久久久久久老虎| 综合久久久久久| 日产国产高清一区二区三区| www.在线成人| 日韩欧美黄色影院| 一区二区三区 在线观看视频| 蜜桃视频一区二区三区 | 亚洲bt欧美bt精品777| 国产成人精品综合在线观看| 欧美日韩视频一区二区| 国产精品日韩成人| 麻豆国产精品777777在线| 91在线观看免费视频| 2020国产精品自拍| 五月激情综合网| 91麻豆精品秘密| 久久色在线观看| 日本女优在线视频一区二区| 91亚洲国产成人精品一区二区三| 欧美大片一区二区三区| 亚洲18色成人| 在线视频你懂得一区| 国产精品人成在线观看免费| 六月婷婷色综合| 欧美日韩第一区日日骚| 综合久久久久久| 成年人网站91| 欧美经典一区二区三区| 国产一区二区三区蝌蚪| 欧美一区二区三区免费在线看| 亚洲综合在线免费观看| 成人av网站大全| 中文字幕精品一区| 国产精品亚洲第一| 精品成人一区二区| 日本亚洲三级在线| 日韩一区二区免费高清| 天天影视涩香欲综合网| 在线观看三级视频欧美| 亚洲男人的天堂网| 色综合久久66| 一区二区三区蜜桃| 色哟哟亚洲精品| 亚洲乱码精品一二三四区日韩在线| 成人高清视频在线| 中文字幕一区二区三区av| 国产成人精品三级麻豆| 国产午夜三级一区二区三| 国产在线不卡一卡二卡三卡四卡| 日韩欧美中文字幕一区| 麻豆精品在线看| 26uuu亚洲综合色| 国产一区三区三区| 国产欧美精品一区二区三区四区| 国产69精品久久久久毛片| 国产欧美日韩另类一区| 白白色 亚洲乱淫| 亚洲精品国产成人久久av盗摄| 欧美自拍偷拍午夜视频| 亚洲高清免费观看高清完整版在线观看 | 国产资源精品在线观看| 欧美精品一区二区三区蜜桃视频| 激情图区综合网| 中文字幕欧美国产| 一本久道久久综合中文字幕| 天堂成人国产精品一区| 日韩欧美在线观看一区二区三区| 九九九精品视频| 亚洲国产成人一区二区三区| 色综合久久中文字幕| 亚洲sss视频在线视频| 精品日韩99亚洲| 成人av高清在线| 午夜视频在线观看一区| 精品区一区二区| 99国产精品久久| 日韩av一二三| 欧美激情中文不卡| 欧美色网一区二区| 国产激情偷乱视频一区二区三区| 亚洲日本在线a| 日韩视频免费观看高清在线视频| 国产成人丝袜美腿| 亚洲福中文字幕伊人影院|