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

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

?? print-icmp6.c

?? TCPDUMP的C語言源代碼,是在數據鏈路層的應用
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994 *	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-icmp6.c,v 1.85.2.1 2008-02-05 19:36:58 guy Exp $";#endif#ifdef HAVE_CONFIG_H#include "config.h"#endif#ifdef INET6#include <tcpdump-stdinc.h>#include <stdio.h>#include <string.h>#include "interface.h"#include "addrtoname.h"#include "extract.h"#include "ip6.h"#include "icmp6.h"#include "ipproto.h"#include "udp.h"#include "ah.h"static const char *get_rtpref(u_int);static const char *get_lifetime(u_int32_t);static void print_lladdr(const u_char *, size_t);static void icmp6_opt_print(const u_char *, int);static void mld6_print(const u_char *);static void mldv2_report_print(const u_char *, u_int);static void mldv2_query_print(const u_char *, u_int);static struct udphdr *get_upperlayer(u_char *, u_int *);static void dnsname_print(const u_char *, const u_char *);static void icmp6_nodeinfo_print(u_int, const u_char *, const u_char *);static void icmp6_rrenum_print(const u_char *, const u_char *);#ifndef abs#define abs(a)	((0 < (a)) ? (a) : -(a))#endifstatic struct tok icmp6_type_values[] = {    { ICMP6_DST_UNREACH, "destination unreachable"},    { ICMP6_PACKET_TOO_BIG, "packet too big"},    { ICMP6_TIME_EXCEEDED, "time exceeded in-transit"},    { ICMP6_PARAM_PROB, "parameter problem"},    { ICMP6_ECHO_REQUEST, "echo request"},    { ICMP6_ECHO_REPLY, "echo reply"},    { MLD6_LISTENER_QUERY, "multicast listener query"},    { MLD6_LISTENER_REPORT, "multicast listener report"},    { MLD6_LISTENER_DONE, "multicast listener done"},    { ND_ROUTER_SOLICIT, "router solicitation"},    { ND_ROUTER_ADVERT, "router advertisement"},    { ND_NEIGHBOR_SOLICIT, "neighbor solicitation"},    { ND_NEIGHBOR_ADVERT, "neighbor advertisement"},    { ND_REDIRECT, "redirect"},    { ICMP6_ROUTER_RENUMBERING, "router renumbering"},    { IND_SOLICIT, "inverse neighbor solicitation"},    { IND_ADVERT, "inverse neighbor advertisement"},    { MLDV2_LISTENER_REPORT, "multicast listener report v2"},    { ICMP6_HADISCOV_REQUEST, "ha discovery request"},    { ICMP6_HADISCOV_REPLY, "ha discovery reply"},    { ICMP6_MOBILEPREFIX_SOLICIT, "mobile router solicitation"},    { ICMP6_MOBILEPREFIX_ADVERT, "mobile router advertisement"},    { ICMP6_WRUREQUEST, "who-are-you request"},    { ICMP6_WRUREPLY, "who-are-you reply"},    { ICMP6_NI_QUERY, "node information query"},    { ICMP6_NI_REPLY, "node information reply"},    { MLD6_MTRACE, "mtrace message"},    { MLD6_MTRACE_RESP, "mtrace response"},    { 0,	NULL }};static struct tok icmp6_dst_unreach_code_values[] = {    { ICMP6_DST_UNREACH_NOROUTE, "unreachable route" },    { ICMP6_DST_UNREACH_ADMIN, " unreachable prohibited"},    { ICMP6_DST_UNREACH_BEYONDSCOPE, "beyond scope"},    { ICMP6_DST_UNREACH_ADDR, "unreachable address"},    { ICMP6_DST_UNREACH_NOPORT, "unreachable port"},    { 0,	NULL }};static struct tok icmp6_opt_pi_flag_values[] = {    { ND_OPT_PI_FLAG_ONLINK, "onlink" },    { ND_OPT_PI_FLAG_AUTO, "auto" },    { ND_OPT_PI_FLAG_ROUTER, "router" },    { 0,	NULL }};static struct tok icmp6_opt_ra_flag_values[] = {    { ND_RA_FLAG_MANAGED, "managed" },    { ND_RA_FLAG_OTHER, "other stateful"},    { ND_RA_FLAG_HOME_AGENT, "home agent"},    { 0,	NULL }};static struct tok icmp6_nd_na_flag_values[] = {    { ND_NA_FLAG_ROUTER, "router" },    { ND_NA_FLAG_SOLICITED, "solicited" },    { ND_NA_FLAG_OVERRIDE, "override" },    { 0,	NULL }};static struct tok icmp6_opt_values[] = {   { ND_OPT_SOURCE_LINKADDR, "source link-address"},   { ND_OPT_TARGET_LINKADDR, "destination link-address"},   { ND_OPT_PREFIX_INFORMATION, "prefix info"},   { ND_OPT_REDIRECTED_HEADER, "redirected header"},   { ND_OPT_MTU, "mtu"},   { ND_OPT_ADVINTERVAL, "advertisement interval"},   { ND_OPT_HOMEAGENT_INFO, "homeagent information"},   { ND_OPT_ROUTE_INFO, "route info"},   { 0,	NULL }};/* mldv2 report types */static struct tok mldv2report2str[] = {	{ 1,	"is_in" },	{ 2,	"is_ex" },	{ 3,	"to_in" },	{ 4,	"to_ex" },	{ 5,	"allow" },	{ 6,	"block" },	{ 0,	NULL }};static const char *get_rtpref(u_int v){	static const char *rtpref_str[] = {		"medium",		/* 00 */		"high",			/* 01 */		"rsv",			/* 10 */		"low"			/* 11 */	};	return rtpref_str[((v & ND_RA_FLAG_RTPREF_MASK) >> 3) & 0xff];}static const char *get_lifetime(u_int32_t v){	static char buf[20];	if (v == (u_int32_t)~0UL)		return "infinity";	else {		snprintf(buf, sizeof(buf), "%u", v);		return buf;	}}static voidprint_lladdr(const u_int8_t *p, size_t l){	const u_int8_t *ep, *q;	q = p;	ep = p + l;	while (l > 0 && q < ep) {		if (q > p)			printf(":");		printf("%02x", *q++);		l--;	}}static int icmp6_cksum(const struct ip6_hdr *ip6, const struct icmp6_hdr *icp,	u_int len){	size_t i;	register const u_int16_t *sp;	u_int32_t sum;	union {		struct {			struct in6_addr ph_src;			struct in6_addr ph_dst;			u_int32_t	ph_len;			u_int8_t	ph_zero[3];			u_int8_t	ph_nxt;		} ph;		u_int16_t pa[20];	} phu;	/* pseudo-header */	memset(&phu, 0, sizeof(phu));	phu.ph.ph_src = ip6->ip6_src;	phu.ph.ph_dst = ip6->ip6_dst;	phu.ph.ph_len = htonl(len);	phu.ph.ph_nxt = IPPROTO_ICMPV6;	sum = 0;	for (i = 0; i < sizeof(phu.pa) / sizeof(phu.pa[0]); i++)		sum += phu.pa[i];	sp = (const u_int16_t *)icp;	for (i = 0; i < (len & ~1); i += 2)		sum += *sp++;	if (len & 1)		sum += htons((*(const u_int8_t *)sp) << 8);	while (sum > 0xffff)		sum = (sum & 0xffff) + (sum >> 16);	sum = ~sum & 0xffff;	return (sum);}voidicmp6_print(const u_char *bp, u_int length, const u_char *bp2, int fragmented){	const struct icmp6_hdr *dp;	const struct ip6_hdr *ip;	const struct ip6_hdr *oip;	const struct udphdr *ouh;	int dport;	const u_char *ep;	u_int prot;	dp = (struct icmp6_hdr *)bp;	ip = (struct ip6_hdr *)bp2;	oip = (struct ip6_hdr *)(dp + 1);	/* 'ep' points to the end of available data. */	ep = snapend;	TCHECK(dp->icmp6_cksum);	if (vflag && !fragmented) {		int sum = dp->icmp6_cksum;		if (TTEST2(bp[0], length)) {			sum = icmp6_cksum(ip, dp, length);			if (sum != 0)				(void)printf("[bad icmp6 cksum %x!] ", sum);			else				(void)printf("[icmp6 sum ok] ");		}	}        printf("ICMP6, %s", tok2str(icmp6_type_values,"unknown icmp6 type (%u)",dp->icmp6_type));        /* display cosmetics: print the packet length for printer that use the vflag now */        if (vflag && (dp->icmp6_type ==                      ND_ROUTER_SOLICIT ||                      ND_ROUTER_ADVERT ||                      ND_NEIGHBOR_ADVERT ||                      ND_NEIGHBOR_SOLICIT ||                      ND_REDIRECT ||                      ICMP6_HADISCOV_REPLY ||                      ICMP6_MOBILEPREFIX_ADVERT ))            printf(", length %u", length);                      	switch (dp->icmp6_type) {	case ICMP6_DST_UNREACH:		TCHECK(oip->ip6_dst);                printf(", %s", tok2str(icmp6_dst_unreach_code_values,"unknown unreach code (%u)",dp->icmp6_code));		switch (dp->icmp6_code) {		case ICMP6_DST_UNREACH_NOROUTE: /* fall through */		case ICMP6_DST_UNREACH_ADMIN:		case ICMP6_DST_UNREACH_ADDR:                        printf(" %s",ip6addr_string(&oip->ip6_dst));                        break;		case ICMP6_DST_UNREACH_BEYONDSCOPE:			printf(" %s, source address %s",			       ip6addr_string(&oip->ip6_dst),			       ip6addr_string(&oip->ip6_src));			break;		case ICMP6_DST_UNREACH_NOPORT:			if ((ouh = get_upperlayer((u_char *)oip, &prot))			    == NULL)				goto trunc;			dport = EXTRACT_16BITS(&ouh->uh_dport);			switch (prot) {			case IPPROTO_TCP:				printf(", %s tcp port %s",					ip6addr_string(&oip->ip6_dst),					tcpport_string(dport));				break;			case IPPROTO_UDP:				printf(", %s udp port %s",					ip6addr_string(&oip->ip6_dst),					udpport_string(dport));				break;			default:				printf(", %s protocol %d port %d unreachable",					ip6addr_string(&oip->ip6_dst),					oip->ip6_nxt, dport);				break;			}			break;		default:                    if (vflag <= 1) {                            print_unknown_data(bp,"\n\t",length);                            return;                    }                    break;		}		break;	case ICMP6_PACKET_TOO_BIG:		TCHECK(dp->icmp6_mtu);		printf(", mtu %u", EXTRACT_32BITS(&dp->icmp6_mtu));		break;	case ICMP6_TIME_EXCEEDED:		TCHECK(oip->ip6_dst);		switch (dp->icmp6_code) {		case ICMP6_TIME_EXCEED_TRANSIT:			printf(" for %s",				ip6addr_string(&oip->ip6_dst));			break;		case ICMP6_TIME_EXCEED_REASSEMBLY:			printf(" (reassembly)");			break;		default:			printf(", unknown code (%u)", dp->icmp6_code);			break;		}		break;	case ICMP6_PARAM_PROB:		TCHECK(oip->ip6_dst);		switch (dp->icmp6_code) {		case ICMP6_PARAMPROB_HEADER:			printf(", errorneous - octet %u", EXTRACT_32BITS(&dp->icmp6_pptr));			break;		case ICMP6_PARAMPROB_NEXTHEADER:			printf(", next header - octet %u", EXTRACT_32BITS(&dp->icmp6_pptr));			break;		case ICMP6_PARAMPROB_OPTION:			printf(", option - octet %u", EXTRACT_32BITS(&dp->icmp6_pptr));			break;		default:			printf(", code-#%d",			       dp->icmp6_code);			break;		}		break;	case ICMP6_ECHO_REQUEST:	case ICMP6_ECHO_REPLY:		TCHECK(dp->icmp6_seq);		printf(", seq %u", EXTRACT_16BITS(&dp->icmp6_seq));		break;	case ICMP6_MEMBERSHIP_QUERY:		if (length == MLD_MINLEN) {			mld6_print((const u_char *)dp);		} else if (length >= MLDV2_MINLEN) {			printf("v2 ");			mldv2_query_print((const u_char *)dp, length);		} else {			printf(" unknown-version (len %u) ", length);		}		break;	case ICMP6_MEMBERSHIP_REPORT:		mld6_print((const u_char *)dp);		break;	case ICMP6_MEMBERSHIP_REDUCTION:		mld6_print((const u_char *)dp);		break;	case ND_ROUTER_SOLICIT:#define RTSOLLEN 8		if (vflag) {			icmp6_opt_print((const u_char *)dp + RTSOLLEN,					length - RTSOLLEN);		}		break;	case ND_ROUTER_ADVERT:#define RTADVLEN 16		if (vflag) {			struct nd_router_advert *p;			p = (struct nd_router_advert *)dp;			TCHECK(p->nd_ra_retransmit);			printf("\n\thop limit %u, Flags [%s]" \                               ", pref %s, router lifetime %us, reachable time %us, retrans time %us",                               (u_int)p->nd_ra_curhoplimit,                               bittok2str(icmp6_opt_ra_flag_values,"none",(p->nd_ra_flags_reserved)),                               get_rtpref(p->nd_ra_flags_reserved),                               EXTRACT_16BITS(&p->nd_ra_router_lifetime),                               EXTRACT_32BITS(&p->nd_ra_reachable),                               EXTRACT_32BITS(&p->nd_ra_retransmit));			icmp6_opt_print((const u_char *)dp + RTADVLEN,					length - RTADVLEN);		}		break;	case ND_NEIGHBOR_SOLICIT:	    {		struct nd_neighbor_solicit *p;		p = (struct nd_neighbor_solicit *)dp;		TCHECK(p->nd_ns_target);		printf(", who has %s", ip6addr_string(&p->nd_ns_target));		if (vflag) {#define NDSOLLEN 24			icmp6_opt_print((const u_char *)dp + NDSOLLEN,					length - NDSOLLEN);		}	    }		break;	case ND_NEIGHBOR_ADVERT:	    {		struct nd_neighbor_advert *p;		p = (struct nd_neighbor_advert *)dp;		TCHECK(p->nd_na_target);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品自拍一区| 国产日韩高清在线| 日本午夜一本久久久综合| 黑人巨大精品欧美黑白配亚洲| 99视频一区二区| www一区二区| 奇米在线7777在线精品| 99久久精品国产精品久久| 精品国产乱码久久久久久老虎| 洋洋av久久久久久久一区| 国产成人精品www牛牛影视| 91精品国产品国语在线不卡| 一区二区三区四区激情| 成人精品国产免费网站| 欧美精品一区二区三区在线| 污片在线观看一区二区| 欧美性猛交xxxx黑人交| 亚洲天堂成人在线观看| 成人做爰69片免费看网站| 久久先锋影音av鲁色资源网| 免费成人你懂的| 欧美狂野另类xxxxoooo| 亚洲一区二区三区四区在线观看 | 亚洲你懂的在线视频| 从欧美一区二区三区| 国产丝袜欧美中文另类| 国产精品一区二区无线| 精品嫩草影院久久| 久久成人免费网| 亚洲一区二区高清| 一本一本大道香蕉久在线精品| 国产精品不卡在线| 免费观看日韩av| 欧美视频在线一区| 日韩一级大片在线观看| 日韩av一级片| 日韩欧美高清一区| 天堂影院一区二区| 亚洲高清不卡在线| 精品视频999| 肉肉av福利一精品导航| 日韩午夜激情免费电影| 精品伊人久久久久7777人| 2023国产精品| 色老综合老女人久久久| 亚洲综合成人网| 精品视频一区二区不卡| 免费成人性网站| 国产午夜精品在线观看| 97se亚洲国产综合在线| 五月激情综合色| 精品999久久久| 国产a级毛片一区| 亚洲欧洲99久久| 欧美日韩国产123区| 日韩精品福利网| 久久久久久久久蜜桃| 99久久国产免费看| 五月天婷婷综合| 久久伊人中文字幕| 色婷婷综合久久久中文一区二区| 亚洲高清免费在线| 久久色视频免费观看| 91片在线免费观看| 日韩福利视频网| 欧美国产精品一区二区| 欧亚洲嫩模精品一区三区| 六月丁香婷婷久久| 亚洲三级理论片| 欧美大片在线观看一区| av电影在线观看不卡| 三级欧美在线一区| 欧美国产日本视频| 欧美一区二区三区在线| www.激情成人| 蜜臂av日日欢夜夜爽一区| 国产精品国产三级国产专播品爱网| 欧洲中文字幕精品| 成人免费毛片片v| 日韩精品福利网| 亚洲欧美另类在线| 久久众筹精品私拍模特| 欧美日韩三级一区二区| 成人福利在线看| 蜜桃视频一区二区| 亚洲超碰精品一区二区| 国产精品久久久久久久久快鸭| 欧美一区二区高清| 91国偷自产一区二区三区成为亚洲经典 | 91精品国产乱| 日本高清成人免费播放| 国产精品一区久久久久| 免费在线视频一区| 亚洲成人一区二区| 亚洲欧美经典视频| 国产精品国模大尺度视频| 精品久久久久久无| 制服丝袜日韩国产| 日本精品免费观看高清观看| 成人av片在线观看| 国产成人精品免费在线| 国内国产精品久久| 久久国产精品区| 奇米综合一区二区三区精品视频 | 精品一区二区三区蜜桃| 三级久久三级久久久| 亚欧色一区w666天堂| 亚洲福利视频一区| 亚洲一区二区欧美日韩 | 久久精品一级爱片| 精品国产伦理网| 精品乱码亚洲一区二区不卡| 7777精品伊人久久久大香线蕉超级流畅 | 亚洲一二三区在线观看| 亚洲免费观看高清| 亚洲精品国产一区二区精华液 | 国产一区二区不卡| 国产自产高清不卡| 国产一区二区免费看| 国产精品99久久久| 丰满少妇久久久久久久| 成人教育av在线| 91免费观看视频| 91在线视频在线| 91精品1区2区| 在线不卡一区二区| 日韩精品一区二区三区老鸭窝| 欧美r级在线观看| 国产欧美日韩综合精品一区二区| 欧美国产日韩亚洲一区| 综合激情成人伊人| 亚洲五月六月丁香激情| 丝袜美腿亚洲综合| 精品一区二区三区久久| 成人av在线观| 欧美日韩黄色一区二区| 日韩精品一区国产麻豆| 久久精品免费在线观看| 亚洲人午夜精品天堂一二香蕉| 亚洲一区二区三区中文字幕| 日产国产欧美视频一区精品 | 国产亚洲污的网站| 亚洲欧美一区二区三区极速播放| 亚洲综合色噜噜狠狠| 久久精工是国产品牌吗| 成人动漫视频在线| 欧美区一区二区三区| 精品国产第一区二区三区观看体验| 中文字幕免费观看一区| 亚洲一区二区三区四区中文字幕| 麻豆国产精品777777在线| av成人老司机| 日韩一二三四区| 亚洲视频中文字幕| 久久国产免费看| 色综合久久天天| 日韩久久久久久| 亚洲欧美电影一区二区| 久久99国产乱子伦精品免费| 91在线视频官网| 久久综合色播五月| 亚洲午夜一区二区三区| 国产传媒日韩欧美成人| 欧美高清你懂得| 中文字幕一区二| 美女网站在线免费欧美精品| 91在线你懂得| 欧美精品一区二区久久婷婷 | 国产成人欧美日韩在线电影| 欧美日韩免费在线视频| 日本一区二区电影| 麻豆精品一区二区三区| 99久久精品免费| 久久久精品国产免大香伊| 水蜜桃久久夜色精品一区的特点| 成人精品免费看| 亚洲精品在线免费播放| 午夜久久久久久久久久一区二区| 白白色 亚洲乱淫| 国产亚洲综合色| 久久99精品一区二区三区 | 精品成人一区二区| 日韩不卡手机在线v区| 91福利资源站| 18欧美乱大交hd1984| 国产成人在线免费观看| 日韩欧美国产精品| 日韩不卡免费视频| 91精品国产综合久久福利软件| 夜夜嗨av一区二区三区网页 | 成人视屏免费看| 中文字幕乱码久久午夜不卡 | 在线不卡a资源高清| 五月婷婷综合在线| 欧美日韩国产一区| 亚洲五月六月丁香激情| 欧美视频精品在线| 午夜精品福利一区二区蜜股av | 日本一区二区三区dvd视频在线| 精品一区二区在线视频|