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

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

?? mld6igmp_proto.cc

?? MLDv2 support igmpv3 lite
?? CC
?? 第 1 頁 / 共 2 頁
字號:
// -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-// Copyright (c) 2001-2008 XORP, Inc.//// Permission is hereby granted, free of charge, to any person obtaining a// copy of this software and associated documentation files (the "Software")// to deal in the Software without restriction, subject to the conditions// listed in the XORP LICENSE file. These conditions include: you must// preserve this copyright notice, and you cannot mention the copyright// holders in advertising related to the Software without their permission.// The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This// notice is a summary of the XORP LICENSE file; the license in that file is// legally binding.#ident "$XORP: xorp/contrib/mld6igmp_lite/mld6igmp_proto.cc,v 1.3 2008/07/23 05:09:49 pavlin Exp $"//// Internet Group Management Protocol implementation.// IGMPv1, IGMPv2 (RFC 2236), and IGMPv3 (RFC 3376).//// AND//// Multicast Listener Discovery protocol implementation.// MLDv1 (RFC 2710) and MLDv2 (RFC 3810).//#include "mld6igmp_module.h"#include "libxorp/xorp.h"#include "libxorp/xlog.h"#include "libxorp/debug.h"#include "libxorp/ipvx.hh"#include <set>#include "mld6igmp_vif.hh"//// Exported variables////// Local constants definitions////// Local structures/classes, typedefs and macros////// Local variables////// Local functions prototypes///** * Mld6igmpVif::mld6igmp_membership_query_recv: * @src: The message source address. * @dst: The message destination address. * @message_type: The message type. * @max_resp_code: The Maximum Response Code from the MLD/IGMP header. * @group_address: The Group Address from the MLD/IGMP message. * @buffer: The buffer with the rest of the message. *  * Receive and process IGMP_MEMBERSHIP_QUERY/MLD_LISTENER_QUERY message * from another router. *  * Return value: %XORP_OK on success, otherwise %XORP_ERROR. **/intMld6igmpVif::mld6igmp_membership_query_recv(const IPvX& src,					    const IPvX& dst,					    uint8_t message_type,					    uint16_t max_resp_code,					    const IPvX& group_address,					    buffer_t *buffer){    int message_version = 0;    // Ignore my own queries    if (mld6igmp_node().is_my_addr(src))	return (XORP_ERROR);    //    // Determine the protocol version of the Query message    //    if (proto_is_igmp()) {	//	// The IGMP version of a Membership Query message is:	// - IGMPv1 Query: length = 8 AND Max Resp Code field is zero	// - IGMPv2 Query: length = 8 AND Max Resp Code field is non-zero	// - IGMPv3 Query: length >= 12	//	do {	    //	    // Note that the Query processing so far has decoded the message	    // up to the group address included (i.e., 8 octets), hence	    // we add-back the size of the decoded portion.	    //	    size_t data_size = BUFFER_DATA_SIZE(buffer) + IGMP_MINLEN;	    if ((data_size == IGMP_MINLEN) && (max_resp_code == 0)) {		message_version = IGMP_V1;		break;	    }	    if ((data_size == IGMP_MINLEN) && (max_resp_code != 0)) {		message_version = IGMP_V2;		break;	    }	    if (data_size >= IGMP_V3_QUERY_MINLEN) {		message_version = IGMP_V3;		break;	    }	    //	    // Silently ignore all other Query messages that don't match	    // any of the above conditions.	    //	    return (XORP_ERROR);	} while (false);	XLOG_ASSERT(message_version > 0);	//	// Query version consistency check.	// If there is mismatch, then drop the message.	// See RFC 3376 Section 7.3.1, and RFC 3810 Section 8.3.1.	//	if (mld6igmp_query_version_consistency_check(src, dst, message_type,						     message_version)	    != XORP_OK) {	    return (XORP_ERROR);	}    }    if (proto_is_mld6()) {	//	// The MLD version of a Membership Query message is:	// - MLDv1 Query: length = 24	// - MLDv2 Query: length >= 28	//	do {	    //	    // Note that the Query processing so far has decoded the message	    // up to the group address included (i.e., 24 octets), hence	    // we add-back the size of the decoded portion.	    //	    size_t data_size = BUFFER_DATA_SIZE(buffer) + MLD_MINLEN;	    if (data_size == MLD_MINLEN) {		message_version = MLD_V1;		break;	    }	    if (data_size >= MLD_V2_QUERY_MINLEN) {		message_version = MLD_V2;		break;	    }	    //	    // Silently ignore all other Query messages that don't match	    // any of the above conditions.	    //	    return (XORP_ERROR);	} while (false);	XLOG_ASSERT(message_version > 0);	//	// Query version consistency check.	// If there is mismatch, then drop the message.	// See RFC 3376 Section 7.3.1, and RFC 3810 Section 8.3.1.	//	if (mld6igmp_query_version_consistency_check(src, dst, message_type,						     message_version)	    != XORP_OK) {	    return (XORP_ERROR);	}    }    XLOG_ASSERT(message_version > 0);        //    // Compare this querier address with my address.    // XXX: Here we should compare the old and new querier    // addresses, but we don't really care.    //    XLOG_ASSERT(primary_addr() != IPvX::ZERO(family()));    if (src < primary_addr()) {	// Eventually a new querier	_query_timer.unschedule();	set_querier_addr(src);	set_i_am_querier(false);	TimeVal other_querier_present_interval =	    effective_query_interval() * effective_robustness_variable()	    + query_response_interval().get() / 2;	_other_querier_timer =	    mld6igmp_node().eventloop().new_oneoff_after(		other_querier_present_interval,		callback(this, &Mld6igmpVif::other_querier_timer_timeout));    }    //    // XXX: if this is IGMPv3 or MLDv2 Query, then process separately    // the rest the message.    //    if ((proto_is_igmp() && (message_version >= IGMP_V3))	|| (proto_is_mld6() && (message_version >= MLD_V2))) {	mld6igmp_ssm_membership_query_recv(src, dst, message_type,					   max_resp_code, group_address,					   buffer);	return (XORP_OK);    }    //    // From RFC 2236:    // "When a non-Querier receives a Group-Specific Query message, if its    // existing group membership timer is greater than [Last Member Query    // Count] times the Max Response Time specified in the message, it sets    // its group membership timer to that value."    //    //    // From RFC 2710:    // "When a router in Non-Querier state receives a Multicast-Address-    // Specific Query, if its timer value for the identified multicast    // address is greater than [Last Listener Query Count] times the Maximum    // Response Delay specified in the message, it sets the address's timer    // to that latter value."    //    if ( (! group_address.is_zero())	 && (max_resp_code != 0)	 && (! i_am_querier())) {	    uint32_t timer_scale = mld6igmp_constant_timer_scale();	    TimeVal received_resp_tv;	    // "Last Member Query Count" / "Last Listener Query Count"	    received_resp_tv = TimeVal(effective_robustness_variable() * max_resp_code, 0);	    received_resp_tv = received_resp_tv / timer_scale;	    _group_records.lower_group_timer(group_address, received_resp_tv);    }    return (XORP_OK);}/** * Mld6igmpVif::mld6igmp_ssm_membership_query_recv: * @src: The message source address. * @dst: The message destination address. * @message_type: The message type. * @max_resp_code: The Maximum Response Code from the MLD/IGMP header. * @group_address: The Group Address from the MLD/IGMP message. * @buffer: The buffer with the rest of the message. *  * Receive and process IGMPv3/MLDv2 IGMP_MEMBERSHIP_QUERY/MLD_LISTENER_QUERY * message from another router. *  * Return value: %XORP_OK on success, otherwise %XORP_ERROR. **/intMld6igmpVif::mld6igmp_ssm_membership_query_recv(const IPvX& src,						const IPvX& dst,						uint8_t message_type,						uint16_t max_resp_code,						const IPvX& group_address,						buffer_t *buffer){    bool s_flag = false;    uint8_t qrv = 0;    uint8_t qqic = 0;    uint16_t sources_n = 0;    TimeVal max_resp_time, qqi;    set<IPvX> sources;    string error_msg;    //    // Decode the Max Resp Code    //    if (proto_is_igmp()) {	decode_exp_time_code8(max_resp_code, max_resp_time,			      mld6igmp_constant_timer_scale());    }    if (proto_is_mld6()) {	decode_exp_time_code16(max_resp_code, max_resp_time,			       mld6igmp_constant_timer_scale());    }    //    // Decode the rest of the message header    //    BUFFER_GET_OCTET(qrv, buffer);    BUFFER_GET_OCTET(qqic, buffer);    BUFFER_GET_HOST_16(sources_n, buffer);    if (proto_is_igmp()) {	s_flag = IGMP_SFLAG(qrv);	qrv = IGMP_QRV(qrv);    }    if (proto_is_mld6()) {	s_flag = MLD_SFLAG(qrv);	qrv = MLD_QRV(qrv);    }    decode_exp_time_code8(qqic, qqi, 1);    //    // Check the remaining size of the message    //    if (BUFFER_DATA_SIZE(buffer) < sources_n * IPvX::addr_bytelen(family())) {	error_msg = c_format("RX %s from %s to %s on vif %s: "			     "source addresses array size too short"			     "(received %u expected at least %u)",			     proto_message_type2ascii(message_type),			     cstring(src), cstring(dst),			     name().c_str(),			     XORP_UINT_CAST(BUFFER_DATA_SIZE(buffer)),			     XORP_UINT_CAST(sources_n * IPvX::addr_bytelen(family())));	XLOG_WARNING("%s", error_msg.c_str());	return (XORP_ERROR);    }    //    // Decode the array of source addresses    //    while (sources_n != 0) {	IPvX ipvx(family());	BUFFER_GET_IPVX(family(), ipvx, buffer);	sources.insert(ipvx);	sources_n--;    }    //    // Adopt the Querier's Robustness Variable and Query Interval    //    if (! i_am_querier()) {	if (qrv != 0) {	    set_effective_robustness_variable(qrv);	} else {	    set_effective_robustness_variable(configured_robust_count().get());	}	if (qqi != TimeVal::ZERO()) {	    set_effective_query_interval(qqi);	} else {	    set_effective_query_interval(configured_query_interval().get());	}    }    //    // Lower the group and source timers    //    if (! s_flag) {	if (sources.empty()) {	    // XXX: Q(G) Query	    _group_records.lower_group_timer(group_address,					     last_member_query_time());	} else {	    // XXX: Q(G, A) Query	    _group_records.lower_source_timer(group_address, sources,					      last_member_query_time());	}    }    return (XORP_OK); rcvlen_error:    XLOG_UNREACHABLE();    error_msg = c_format("RX %s from %s to %s on vif %s: "			 "some fields are too short",			 proto_message_type2ascii(message_type),			 cstring(src), cstring(dst),			 name().c_str());    XLOG_WARNING("%s", error_msg.c_str());    return (XORP_ERROR);}/** * Mld6igmpVif::mld6igmp_membership_report_recv: * @src: The message source address. * @dst: The message destination address. * @message_type: The message type. * @max_resp_code: The Maximum Response Code from the MLD/IGMP header. * @group_address: The Group Address from the MLD/IGMP message. * @buffer: The buffer with the rest of the message. *  * Receive and process * (IGMP_V1_MEMBERSHIP_REPORT or IGMP_V2_MEMBERSHIP_REPORT)/MLD_LISTENER_REPORT * message from a host. *  * Return value: %XORP_OK on success, otherwise %XORP_ERROR. **/intMld6igmpVif::mld6igmp_membership_report_recv(const IPvX& src,					     const IPvX& dst,					     uint8_t message_type,					     uint16_t max_resp_code,					     const IPvX& group_address,					     buffer_t *buffer){    Mld6igmpGroupRecord *group_record = NULL;        // The group address must be a valid multicast address    if (! group_address.is_multicast()) {	XLOG_WARNING("RX %s from %s to %s on vif %s: "		     "the group address %s is not "		     "valid multicast address",		     proto_message_type2ascii(message_type),		     cstring(src), cstring(dst),		     name().c_str(),		     cstring(group_address));	return (XORP_ERROR);    }    set<IPvX> no_sources;		// XXX: empty set    group_records().process_mode_is_exclude(group_address, no_sources, src);    //    // Check whether an older Membership report has been received    //    int message_version = 0;    if (proto_is_igmp()) {	switch (message_type) {	case IGMP_V1_MEMBERSHIP_REPORT:	    message_version = IGMP_V1;	    break;	case IGMP_V2_MEMBERSHIP_REPORT:	    message_version = IGMP_V2;	    break;	case IGMP_V3_MEMBERSHIP_REPORT:	    message_version = IGMP_V3;	    break;	default:	    message_version = IGMP_V2;	    break;	}    }    if (proto_is_mld6()) {	switch (message_type) {	case MLD_LISTENER_REPORT:	    message_version = MLD_V1;	    break;	case MLDV2_LISTENER_REPORT:	    message_version = MLD_V2;	    break;	default:	    message_version = MLD_V1;	    break;	}    }    XLOG_ASSERT(message_version > 0);    group_record = _group_records.find_group_record(group_address);    XLOG_ASSERT(group_record != NULL);    group_record->received_older_membership_report(message_version);    UNUSED(max_resp_code);    UNUSED(buffer);    return (XORP_OK);}/** * Mld6igmpVif::mld6igmp_leave_group_recv: * @src: The message source address. * @dst: The message destination address. * @message_type: The message type. * @max_resp_code: The Maximum Response Code from the MLD/IGMP header. * @group_address: The Group Address from the MLD/IGMP message. * @buffer: The buffer with the rest of the message. *  * Receive and process IGMP_V2_LEAVE_GROUP/MLD_LISTENER_DONE message * from a host. *  * Return value: %XORP_OK on success, otherwise %XORP_ERROR. **/intMld6igmpVif::mld6igmp_leave_group_recv(const IPvX& src,				       const IPvX& dst,				       uint8_t message_type,				       uint16_t max_resp_code,				       const IPvX& group_address,				       buffer_t *buffer){    Mld6igmpGroupRecord *group_record = NULL;    string dummy_error_msg;    // The group address must be a valid multicast address    if (! group_address.is_multicast()) {	XLOG_WARNING("RX %s from %s to %s on vif %s: "		     "the group address %s is not "		     "valid multicast address",		     proto_message_type2ascii(message_type),		     cstring(src), cstring(dst),		     name().c_str(),		     cstring(group_address));	return (XORP_ERROR);    }    //    // Find if we already have an entry for this group    //    group_record = _group_records.find_group_record(group_address);    if (group_record == NULL) {	// Nothing found. Ignore.	return (XORP_OK);    }    //    // Group found    //    if (is_igmpv1_mode(group_record)) {	//	// Ignore this 'Leave Group' message because this	// group has IGMPv1 hosts members.	//	return (XORP_OK);    }    set<IPvX> no_sources;		// XXX: empty set    group_records().process_change_to_include_mode(group_address, no_sources,						   src);    return (XORP_OK);    UNUSED(max_resp_code);    UNUSED(buffer);        return (XORP_OK);}/** * Mld6igmpVif::mld6igmp_ssm_membership_report_recv: * @src: The message source address. * @dst: The message destination address. * @message_type: The message type. * @buffer: The buffer with the rest of the message. *  * Receive and process IGMP_V3_MEMBERSHIP_REPORT/MLDV2_LISTENER_REPORT * message from a host. *  * Return value: %XORP_OK on success, otherwise %XORP_ERROR. **/int

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美aaaaaa午夜精品| 成人综合婷婷国产精品久久蜜臀| 亚洲成人综合在线| 美女久久久精品| 99re这里只有精品6| 成人小视频在线| 欧美图区在线视频| 2023国产精品自拍| 亚洲视频图片小说| 美女爽到高潮91| 99久久99久久久精品齐齐| 欧美日韩国产大片| 中文字幕欧美日韩一区| 三级亚洲高清视频| 成人一区二区视频| 色哟哟国产精品免费观看| 欧美一区二区视频在线观看2020| 欧美国产日韩亚洲一区| 热久久一区二区| 91老司机福利 在线| 欧美日韩一区在线| 国产精品精品国产色婷婷| 五月天婷婷综合| 成人精品gif动图一区| 日韩无一区二区| 一区二区三区四区不卡视频| 国产精品综合一区二区| www久久久久| 精品一区二区三区久久| 日韩欧美123| 精品综合久久久久久8888| 91麻豆精品国产91久久久久久| 亚洲一区二区三区自拍| 欧美日韩黄视频| 午夜久久电影网| 欧美高清一级片在线| 亚洲综合色视频| 欧美久久久久久久久久| 美国毛片一区二区| 精品国产免费久久| 成人激情综合网站| 亚洲精品五月天| 26uuu久久天堂性欧美| 国产一区二区在线看| 国产欧美一区二区精品久导航| 丁香六月综合激情| 国产精品国产馆在线真实露脸 | 欧美一区二区三区公司| 蜜臀国产一区二区三区在线播放| 日韩欧美在线综合网| 国产精品 日产精品 欧美精品| 国产清纯在线一区二区www| 91免费国产视频网站| 亚洲国产乱码最新视频| 欧美一区二区久久| 成人免费视频app| 一区二区三区在线播| 欧美一卡2卡3卡4卡| 大陆成人av片| 亚洲午夜久久久久久久久久久| 日韩视频永久免费| 成人中文字幕电影| 天堂影院一区二区| 亚洲国产精品传媒在线观看| 91免费看视频| 国产一区二区三区高清播放| 亚洲区小说区图片区qvod| 日韩无一区二区| 色婷婷av一区二区三区gif | 亚洲精品一线二线三线| 99久久精品久久久久久清纯| 午夜在线电影亚洲一区| 国产欧美一区二区精品性色超碰| 欧美私人免费视频| 国产河南妇女毛片精品久久久| 一区二区三区高清在线| 久久综合99re88久久爱| 欧美亚洲综合久久| 成人看片黄a免费看在线| 日本特黄久久久高潮| 亚洲免费毛片网站| 久久品道一品道久久精品| 欧美日韩国产一级片| 99re8在线精品视频免费播放| 久久精品免费观看| 午夜视频在线观看一区| 亚洲伦理在线免费看| 久久久美女艺术照精彩视频福利播放| 欧美日韩一区二区三区免费看 | 国产精品视频一二三区| 日韩西西人体444www| 欧洲在线/亚洲| 成人三级伦理片| 国产精品自拍三区| 久久99最新地址| 捆绑调教美女网站视频一区| 一区二区欧美视频| 亚洲精品欧美激情| 丝袜美腿亚洲综合| 亚洲日本丝袜连裤袜办公室| 国产午夜一区二区三区| 欧美va日韩va| 日韩精品一区二区三区中文精品| 欧美色涩在线第一页| 91传媒视频在线播放| 91影院在线观看| 99久久综合狠狠综合久久| 国产精华液一区二区三区| 狠狠网亚洲精品| 国产一区二区三区在线观看免费视频 | 99精品在线免费| av午夜精品一区二区三区| 国产成人综合在线播放| 国产精品自拍在线| 成人精品国产福利| 色综合久久中文综合久久97| 一本在线高清不卡dvd| 在线欧美日韩精品| 欧美影院一区二区三区| 91精品国产一区二区三区香蕉| 制服丝袜激情欧洲亚洲| 欧美xfplay| 欧美国产97人人爽人人喊| 亚洲欧美怡红院| 一区二区三区四区高清精品免费观看 | 欧美视频在线播放| 欧美一区日本一区韩国一区| 欧美猛男超大videosgay| 制服丝袜国产精品| 久久新电视剧免费观看| 国产精品丝袜91| 亚洲午夜激情网页| 久久97超碰国产精品超碰| 国产福利一区在线| 成人性视频免费网站| 日本高清不卡一区| 日韩一区二区三区电影在线观看| 久久久三级国产网站| 亚洲欧美欧美一区二区三区| 午夜私人影院久久久久| 国内成人精品2018免费看| 91亚洲国产成人精品一区二三 | 激情图区综合网| 99re在线视频这里只有精品| 欧美美女一区二区在线观看| 国产亚洲福利社区一区| 一区二区三区四区在线播放| 久久国产精品免费| 99国产精品国产精品久久| 欧美高清hd18日本| 国产精品网站导航| 水野朝阳av一区二区三区| 国产a区久久久| 91精品午夜视频| 国产精品久久毛片| 日本伊人午夜精品| 色偷偷久久人人79超碰人人澡| 日韩视频免费观看高清完整版| 国产精品乱码妇女bbbb| 免费观看91视频大全| av在线不卡观看免费观看| 欧美一级高清大全免费观看| 国产精品天美传媒沈樵| 日韩和欧美的一区| 色婷婷综合久久久| 久久蜜桃香蕉精品一区二区三区| 亚洲一区二区三区视频在线| 国产高清不卡一区| 精品少妇一区二区三区| 亚洲综合一区二区三区| 成人一区二区三区在线观看| 欧美一区二区三区在线看| 一区二区三区四区不卡在线| 岛国精品在线播放| wwwwww.欧美系列| 秋霞电影一区二区| 欧美色国产精品| 一区二区三区久久久| 成人av综合一区| 国产拍揄自揄精品视频麻豆| 久久精品国产亚洲一区二区三区| 91电影在线观看| 亚洲精品菠萝久久久久久久| 成人精品国产免费网站| 日本一区二区三区dvd视频在线 | 亚洲高清视频在线| 色婷婷国产精品综合在线观看| 国产精品色在线观看| 国产成人鲁色资源国产91色综| 51久久夜色精品国产麻豆| 亚洲bdsm女犯bdsm网站| 91久久国产综合久久| 亚洲精品国产第一综合99久久| 99re在线精品| 亚洲九九爱视频| 在线观看www91| 亚洲网友自拍偷拍| 欧美视频日韩视频在线观看| 亚洲精品国产一区二区精华液| 99久久久精品|