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

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

?? print-ip.c

?? TCPDUMP的C語言源代碼,是在數據鏈路層的應用
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 *	The Regents of the University of California.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may 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 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */#ifndef lintstatic const char rcsid[] _U_ =    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.159 2007-09-14 01:29:28 guy Exp $ (LBL)";#endif#ifdef HAVE_CONFIG_H#include "config.h"#endif#include <tcpdump-stdinc.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "addrtoname.h"#include "interface.h"#include "extract.h"			/* must come after interface.h */#include "ip.h"#include "ipproto.h"struct tok ip_option_values[] = {    { IPOPT_EOL, "EOL" },    { IPOPT_NOP, "NOP" },    { IPOPT_TS, "timestamp" },    { IPOPT_SECURITY, "security" },    { IPOPT_RR, "RR" },    { IPOPT_SSRR, "SSRR" },    { IPOPT_LSRR, "LSRR" },    { IPOPT_RA, "RA" },    { IPOPT_RFC1393, "traceroute" },    { 0, NULL }};/* * print the recorded route in an IP RR, LSRR or SSRR option. */static voidip_printroute(register const u_char *cp, u_int length){	register u_int ptr;	register u_int len;	if (length < 3) {		printf(" [bad length %u]", length);		return;	}	if ((length + 1) & 3)		printf(" [bad length %u]", length);	ptr = cp[2] - 1;	if (ptr < 3 || ((ptr + 1) & 3) || ptr > length + 1)		printf(" [bad ptr %u]", cp[2]);	for (len = 3; len < length; len += 4) {		printf(" %s", ipaddr_string(&cp[len]));                if (ptr > len)                        printf(",");	}}/* * If source-routing is present and valid, return the final destination. * Otherwise, return IP destination. * * This is used for UDP and TCP pseudo-header in the checksum * calculation. */u_int32_tip_finddst(const struct ip *ip){	int length;	int len;	const u_char *cp;	u_int32_t retval;	cp = (const u_char *)(ip + 1);	length = (IP_HL(ip) << 2) - sizeof(struct ip);	for (; length > 0; cp += len, length -= len) {		int tt;		TCHECK(*cp);		tt = *cp;		if (tt == IPOPT_EOL)			break;		else if (tt == IPOPT_NOP)			len = 1;		else {			TCHECK(cp[1]);			len = cp[1];			if (len < 2)				break;		}		TCHECK2(*cp, len);		switch (tt) {		case IPOPT_SSRR:		case IPOPT_LSRR:			if (len < 7)				break;			memcpy(&retval, cp + len - 4, 4);			return retval;		}	}trunc:	memcpy(&retval, &ip->ip_dst.s_addr, sizeof(u_int32_t));	return retval;}static voidip_printts(register const u_char *cp, u_int length){	register u_int ptr;	register u_int len;	int hoplen;	const char *type;	if (length < 4) {		printf("[bad length %u]", length);		return;	}	printf(" TS{");	hoplen = ((cp[3]&0xF) != IPOPT_TS_TSONLY) ? 8 : 4;	if ((length - 4) & (hoplen-1))		printf("[bad length %u]", length);	ptr = cp[2] - 1;	len = 0;	if (ptr < 4 || ((ptr - 4) & (hoplen-1)) || ptr > length + 1)		printf("[bad ptr %u]", cp[2]);	switch (cp[3]&0xF) {	case IPOPT_TS_TSONLY:		printf("TSONLY");		break;	case IPOPT_TS_TSANDADDR:		printf("TS+ADDR");		break;	/*	 * prespecified should really be 3, but some ones might send 2	 * instead, and the IPOPT_TS_PRESPEC constant can apparently	 * have both values, so we have to hard-code it here.	 */	case 2:		printf("PRESPEC2.0");		break;	case 3:			/* IPOPT_TS_PRESPEC */		printf("PRESPEC");		break;	default:		printf("[bad ts type %d]", cp[3]&0xF);		goto done;	}	type = " ";	for (len = 4; len < length; len += hoplen) {		if (ptr == len)			type = " ^ ";		printf("%s%d@%s", type, EXTRACT_32BITS(&cp[len+hoplen-4]),		       hoplen!=8 ? "" : ipaddr_string(&cp[len]));		type = " ";	}done:	printf("%s", ptr == len ? " ^ " : "");	if (cp[3]>>4)		printf(" [%d hops not recorded]} ", cp[3]>>4);	else		printf("}");}/* * print IP options. */static voidip_optprint(register const u_char *cp, u_int length){	register u_int option_len;	const char *sep = "";	for (; length > 0; cp += option_len, length -= option_len) {		u_int option_code;		printf("%s", sep);		sep = ",";		TCHECK(*cp);		option_code = *cp;                printf("%s",                        tok2str(ip_option_values,"unknown %u",option_code));		if (option_code == IPOPT_NOP ||                    option_code == IPOPT_EOL)			option_len = 1;		else {			TCHECK(cp[1]);			option_len = cp[1];			if (option_len < 2) {		                printf(" [bad length %u]", option_len);				return;			}		}		if (option_len > length) {	                printf(" [bad length %u]", option_len);			return;		}                TCHECK2(*cp, option_len);		switch (option_code) {		case IPOPT_EOL:			return;		case IPOPT_TS:			ip_printts(cp, option_len);			break;		case IPOPT_RR:       /* fall through */		case IPOPT_SSRR:		case IPOPT_LSRR:			ip_printroute(cp, option_len);			break;		case IPOPT_RA:			if (option_len < 4) {				printf(" [bad length %u]", option_len);				break;			}                        TCHECK(cp[3]);                        if (EXTRACT_16BITS(&cp[2]) != 0)                            printf(" value %u", EXTRACT_16BITS(&cp[2]));			break;		case IPOPT_NOP:       /* nothing to print - fall through */		case IPOPT_SECURITY:		default:			break;		}	}	return;trunc:	printf("[|ip]");}/* * compute an IP header checksum. * don't modifiy the packet. */u_shortin_cksum(const u_short *addr, register u_int len, int csum){	int nleft = len;	const u_short *w = addr;	u_short answer;	int sum = csum;	/*	 *  Our algorithm is simple, using a 32 bit accumulator (sum),	 *  we add sequential 16 bit words to it, and at the end, fold	 *  back all the carry bits from the top 16 bits into the lower	 *  16 bits.	 */	while (nleft > 1)  {		sum += *w++;		nleft -= 2;	}	if (nleft == 1)		sum += htons(*(u_char *)w<<8);	/*	 * add back carry outs from top 16 bits to low 16 bits	 */	sum = (sum >> 16) + (sum & 0xffff);	/* add hi 16 to low 16 */	sum += (sum >> 16);			/* add carry */	answer = ~sum;				/* truncate to 16 bits */	return (answer);}/* * Given the host-byte-order value of the checksum field in a packet * header, and the network-byte-order computed checksum of the data * that the checksum covers (including the checksum itself), compute * what the checksum field *should* have been. */u_int16_tin_cksum_shouldbe(u_int16_t sum, u_int16_t computed_sum){	u_int32_t shouldbe;	/*	 * The value that should have gone into the checksum field	 * is the negative of the value gotten by summing up everything	 * *but* the checksum field.	 *	 * We can compute that by subtracting the value of the checksum	 * field from the sum of all the data in the packet, and then	 * computing the negative of that value.	 *	 * "sum" is the value of the checksum field, and "computed_sum"	 * is the negative of the sum of all the data in the packets,	 * so that's -(-computed_sum - sum), or (sum + computed_sum).	 *	 * All the arithmetic in question is one's complement, so the	 * addition must include an end-around carry; we do this by	 * doing the arithmetic in 32 bits (with no sign-extension),	 * and then adding the upper 16 bits of the sum, which contain	 * the carry, to the lower 16 bits of the sum, and then do it	 * again in case *that* sum produced a carry.	 *	 * As RFC 1071 notes, the checksum can be computed without	 * byte-swapping the 16-bit words; summing 16-bit words	 * on a big-endian machine gives a big-endian checksum, which	 * can be directly stuffed into the big-endian checksum fields	 * in protocol headers, and summing words on a little-endian	 * machine gives a little-endian checksum, which must be	 * byte-swapped before being stuffed into a big-endian checksum	 * field.	 *	 * "computed_sum" is a network-byte-order value, so we must put	 * it in host byte order before subtracting it from the	 * host-byte-order value from the header; the adjusted checksum	 * will be in host byte order, which is what we'll return.	 */	shouldbe = sum;	shouldbe += ntohs(computed_sum);	shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);	shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);	return shouldbe;}#define IP_RES 0x8000static struct tok ip_frag_values[] = {        { IP_MF,        "+" },        { IP_DF,        "DF" },	{ IP_RES,       "rsvd" }, /* The RFC3514 evil ;-) bit */        { 0,            NULL }};struct ip_print_demux_state {	const struct ip *ip;	const u_char *cp;	u_int   len, off;	u_char  nh;	int     advance;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕精品在线不卡| 国产精品综合二区| 国产一区二区电影| 欧美三级三级三级| 国产欧美一区视频| 久久精品国产99国产| 欧美日韩精品欧美日韩精品一| 日本一区二区三区国色天香 | 国产欧美日韩亚州综合| 午夜精品久久久久久久久| 99re这里只有精品6| 久久综合成人精品亚洲另类欧美| 亚洲国产va精品久久久不卡综合 | 另类综合日韩欧美亚洲| 欧美丝袜丝交足nylons| 国产精品色噜噜| 国产美女精品在线| 精品国产一区久久| 极品少妇一区二区三区精品视频| 9191成人精品久久| 日韩中文字幕区一区有砖一区 | 亚洲高清视频的网址| 91亚洲男人天堂| 日韩一区中文字幕| 懂色av中文字幕一区二区三区| 久久婷婷成人综合色| 极品少妇一区二区三区精品视频| 日韩欧美在线不卡| 精品在线免费视频| 久久久综合视频| 国产成人高清视频| 国产日韩综合av| 国产91精品久久久久久久网曝门| 久久久五月婷婷| 国产成人无遮挡在线视频| 国产亚洲美州欧州综合国| 黄色精品一二区| 欧美国产日产图区| 99久久伊人网影院| 亚洲精选视频免费看| 在线视频你懂得一区| 午夜成人免费视频| 精品久久久久久久人人人人传媒| 99国产精品99久久久久久| 亚洲欧美日韩一区| 欧美日韩一区二区三区四区五区| 日韩精品视频网| 久久亚洲私人国产精品va媚药| 国产盗摄一区二区| 亚洲欧美成人一区二区三区| 欧美图区在线视频| 热久久一区二区| 国产精品热久久久久夜色精品三区 | 国产原创一区二区| 亚洲欧美综合另类在线卡通| 色综合久久久网| 蜜桃一区二区三区在线观看| 国产婷婷一区二区| 在线观看av一区| 美脚の诱脚舐め脚责91| 国产精品盗摄一区二区三区| 在线中文字幕不卡| 美女看a上一区| 国产精品国产自产拍高清av| 欧美精品tushy高清| 国产呦萝稀缺另类资源| 亚洲精品视频免费看| 欧美一级爆毛片| 成人一道本在线| 亚洲成人免费在线| 欧美激情综合网| 欧美综合天天夜夜久久| 国产麻豆午夜三级精品| 中文字幕五月欧美| 欧美一级片免费看| 99久久精品免费看| 秋霞av亚洲一区二区三| 国产精品日韩精品欧美在线| 欧美精品 国产精品| 国产.精品.日韩.另类.中文.在线.播放| 亚洲素人一区二区| 久久这里都是精品| 欧美性受极品xxxx喷水| 懂色av一区二区三区蜜臀| 午夜电影网一区| 亚洲免费观看高清完整版在线| 日韩女优制服丝袜电影| 欧美三级电影网站| 国产91精品在线观看| 久久国产精品99精品国产| 亚洲午夜激情av| 国产精品情趣视频| 久久久久久久综合色一本| 9191精品国产综合久久久久久| 色婷婷综合久久久久中文一区二区| 激情欧美一区二区| 奇米777欧美一区二区| 亚洲午夜国产一区99re久久| 日精品一区二区| 日韩激情一二三区| 亚洲地区一二三色| 亚洲综合激情网| 亚洲男同性恋视频| 亚洲视频你懂的| 中文字幕视频一区二区三区久| 中文字幕精品一区二区三区精品| 久久欧美中文字幕| 久久日韩粉嫩一区二区三区| 欧美成人一区二区| 26uuu久久综合| 精品国产1区2区3区| 精品久久久久久久久久久久久久久久久 | 国产精品久久久久一区二区三区共| 欧美精品一区二区三区视频| 日韩一区二区三区av| 欧美男女性生活在线直播观看| 欧美日本在线一区| 欧美三级在线看| 欧美日韩国产一级片| 欧洲视频一区二区| 在线免费不卡视频| 欧美四级电影网| 91精品国产综合久久精品麻豆| 91精品国产综合久久久蜜臀图片| 欧美日韩在线三区| 中文字幕在线播放不卡一区| 亚洲视频免费看| 一区二区三区四区在线播放| 一区二区三区欧美在线观看| 亚洲午夜精品一区二区三区他趣| 天天影视网天天综合色在线播放| 首页欧美精品中文字幕| 精品中文字幕一区二区小辣椒| 国产乱子伦一区二区三区国色天香| 国产精品123区| 91免费版在线| 91精品国产91热久久久做人人| 精品国产网站在线观看| 国产欧美一区二区精品久导航 | 欧美日产在线观看| 精品乱人伦小说| 亚洲欧洲精品一区二区精品久久久| 亚洲精品高清视频在线观看| 香蕉加勒比综合久久| 狠狠网亚洲精品| 91麻豆福利精品推荐| 欧美一区二区免费观在线| 久久精品日产第一区二区三区高清版| 亚洲视频一区二区免费在线观看| 舔着乳尖日韩一区| 成人免费视频视频| 欧美精品vⅰdeose4hd| 日本一区二区动态图| 亚洲第一福利视频在线| 国产成人精品免费网站| 在线观看av一区| 国产欧美一区二区精品性色超碰| 亚洲精品自拍动漫在线| 麻豆91精品视频| 91久久精品国产91性色tv| 欧美成人精精品一区二区频| 亚洲手机成人高清视频| 精品无人区卡一卡二卡三乱码免费卡| 99精品视频在线观看免费| 日韩一区二区三区视频| 综合中文字幕亚洲| 国产一区二区三区香蕉| 欧美精品电影在线播放| 中文字幕一区二区三区四区 | 天堂精品中文字幕在线| 成人免费看视频| 精品久久久久久久人人人人传媒 | 综合色天天鬼久久鬼色| 紧缚捆绑精品一区二区| 欧美日本韩国一区二区三区视频| 亚洲一区二区三区激情| 成人h动漫精品| 精品国产乱码久久| 日韩1区2区3区| 欧美日韩久久久| 亚洲你懂的在线视频| eeuss鲁片一区二区三区| 久久久久久久久久久久久女国产乱| 日本网站在线观看一区二区三区 | 国产女主播在线一区二区| 日本不卡的三区四区五区| 欧美制服丝袜第一页| 亚洲少妇30p| 波波电影院一区二区三区| 中文字幕免费不卡在线| 国产精品资源站在线| 精品动漫一区二区三区在线观看| 日韩av在线发布| 日韩一级免费观看| 日本午夜一区二区| 日韩精品一区二区三区中文精品 | 日韩欧美二区三区| 免费高清在线视频一区·| 91精品国产91综合久久蜜臀| 日韩中文欧美在线|