⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xrl_mld6igmp_node.hh

📁 MLDv2 support igmpv3 lite
💻 HH
📖 第 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.// $XORP: xorp/contrib/mld6igmp_lite/xrl_mld6igmp_node.hh,v 1.2 2008/07/23 05:09:50 pavlin Exp $#ifndef __MLD6IGMP_XRL_MLD6IGMP_NODE_HH__#define __MLD6IGMP_XRL_MLD6IGMP_NODE_HH__//// MLD6IGMP XRL-aware node definition.//#include "libxipc/xrl_std_router.hh"#include "libfeaclient/ifmgr_xrl_mirror.hh"#include "xrl/interfaces/finder_event_notifier_xif.hh"#include "xrl/interfaces/fea_rawpkt4_xif.hh"#include "xrl/interfaces/fea_rawpkt6_xif.hh"#include "xrl/interfaces/cli_manager_xif.hh"#include "xrl/interfaces/mld6igmp_client_xif.hh"#include "xrl/targets/mld6igmp_base.hh"#include "mld6igmp_node.hh"#include "mld6igmp_node_cli.hh"//// The top-level class that wraps-up everything together under one roof//class XrlMld6igmpNode : public Mld6igmpNode,			public XrlStdRouter,			public XrlMld6igmpTargetBase,			public Mld6igmpNodeCli {public:    XrlMld6igmpNode(int			family,		    xorp_module_id	module_id, 		    EventLoop&		eventloop,		    const string&	class_name,		    const string&	finder_hostname,		    uint16_t		finder_port,		    const string&	finder_target,		    const string&	fea_target,		    const string&	mfea_target);    virtual ~XrlMld6igmpNode();    /**     * Startup the node operation.     *     * @return XORP_OK on success, otherwise XORP_ERROR.     */    int startup();    /**     * Shutdown the node operation.     *     * @return XORP_OK on success, otherwise XORP_ERROR.     */    int shutdown();    /**     * Get a reference to the XrlRouter instance.     *     * @return a reference to the XrlRouter (@ref XrlRouter) instance.     */    XrlRouter&	xrl_router() { return *this; }    /**     * Get a const reference to the XrlRouter instance.     *     * @return a const reference to the XrlRouter (@ref XrlRouter) instance.     */    const XrlRouter& xrl_router() const { return *this; }    //    // XrlMld6igmpNode front-end interface    //    int enable_cli();    int disable_cli();    int start_cli();    int stop_cli();    int enable_mld6igmp();    int disable_mld6igmp();    int start_mld6igmp();    int stop_mld6igmp();    // XrlTask relatedMethods that need to be public    void send_register_unregister_interest();    void send_register_unregister_receiver();    void send_join_leave_multicast_group();    void send_protocol_message();protected:    //    // XRL target methods    //    /**     *  Get name of Xrl Target     */    XrlCmdError common_0_1_get_target_name(	// Output values, 	string&	name);    /**     *  Get version string from Xrl Target     */    XrlCmdError common_0_1_get_version(	// Output values, 	string&	version);    /**     *  Get status from Xrl Target     */    XrlCmdError common_0_1_get_status(// Output values,				      uint32_t& status,				      string&	reason);    /**     * Shutdown cleanly     */    XrlCmdError common_0_1_shutdown();    /**     *  Announce target birth to observer.     *     *  @param target_class the target class name.     *     *  @param target_instance the target instance name.     */    XrlCmdError finder_event_observer_0_1_xrl_target_birth(	// Input values,	const string&	target_class,	const string&	target_instance);    /**     *  Announce target death to observer.     *     *  @param target_class the target class name.     *     *  @param target_instance the target instance name.     */    XrlCmdError finder_event_observer_0_1_xrl_target_death(	// Input values,	const string&	target_class,	const string&	target_instance);    /**     *  Process a CLI command.     *       *  @param processor_name the processor name for this command.     *       *  @param cli_term_name the terminal name the command was entered from.     *       *  @param cli_session_id the CLI session ID the command was entered from.     *       *  @param command_name the command name to process.     *       *  @param command_args the command arguments to process.     *       *  @param ret_processor_name the processor name to return back to the CLI.     *       *  @param ret_cli_term_name the terminal name to return back.     *       *  @param ret_cli_session_id the CLI session ID to return back.     *       *  @param ret_command_output the command output to return back.     */    XrlCmdError cli_processor_0_1_process_command(	// Input values, 	const string&	processor_name, 	const string&	cli_term_name, 	const uint32_t&	cli_session_id,	const string&	command_name, 	const string&	command_args, 	// Output values, 	string&	ret_processor_name, 	string&	ret_cli_term_name, 	uint32_t& ret_cli_session_id,	string&	ret_command_output);    /**     *  Receive an IPv4 packet from a raw socket.     *     *  @param if_name the interface name the packet arrived on.     *     *  @param vif_name the vif name the packet arrived on.     *     *  @param src_address the IP source address.     *     *  @param dst_address the IP destination address.     *     *  @param ip_protocol the IP protocol number.     *     *  @param ip_ttl the IP TTL (hop-limit). If it has a negative value, then     *  the received value is unknown.     *     *  @param ip_tos the Type of Service (Diffserv/ECN bits for IPv4). If it     *  has a negative value, then the received value is unknown.     *     *  @param ip_router_alert if true, the IP Router Alert option was included     *  in the IP packet.     *     *  @param ip_internet_control if true, then this is IP control traffic.     */    XrlCmdError raw_packet4_client_0_1_recv(	// Input values,	const string&	if_name,	const string&	vif_name,	const IPv4&	src_address,	const IPv4&	dst_address,	const uint32_t&	ip_protocol,	const int32_t&	ip_ttl,	const int32_t&	ip_tos,	const bool&	ip_router_alert,	const bool&	ip_internet_control,	const vector<uint8_t>&	payload);    /**     *  Receive an IPv6 packet from a raw socket.     *     *  @param if_name the interface name the packet arrived on.     *     *  @param vif_name the vif name the packet arrived on.     *     *  @param src_address the IP source address.     *     *  @param dst_address the IP destination address.     *     *  @param ip_protocol the IP protocol number.     *     *  @param ip_ttl the IP TTL (hop-limit). If it has a negative value, then     *  the received value is unknown.     *     *  @param ip_tos the Type Of Service (IP traffic class for IPv4). If it     *  has a negative value, then the received value is unknown.     *     *  @param ip_router_alert if true, the IP Router Alert option was included     *  in the IP packet.     *     *  @param ip_internet_control if true, then this is IP control traffic.     *     *  @param ext_headers_type a list of u32 integers with the types of the     *  optional extention headers.     *     *  @param ext_headers_payload a list of payload data, one for each     *  optional extention header. The number of entries must match     *  ext_headers_type.     */    XrlCmdError raw_packet6_client_0_1_recv(	// Input values,	const string&	if_name,	const string&	vif_name,	const IPv6&	src_address,	const IPv6&	dst_address,	const uint32_t&	ip_protocol,	const int32_t&	ip_ttl,	const int32_t&	ip_tos,	const bool&	ip_router_alert,	const bool&	ip_internet_control,	const XrlAtomList&	ext_headers_type,	const XrlAtomList&	ext_headers_payload,	const vector<uint8_t>&	payload);        /**     *  Enable/disable/start/stop a MLD6IGMP vif interface.     *     *  @param vif_name the name of the vif to enable/disable/start/stop.     *     *  @param enable if true, then enable the vif, otherwise disable it.     */    XrlCmdError mld6igmp_0_1_enable_vif(	// Input values,	const string&	vif_name,	const bool&	enable);    XrlCmdError mld6igmp_0_1_start_vif(	// Input values, 	const string&	vif_name);    XrlCmdError mld6igmp_0_1_stop_vif(	// Input values, 	const string&	vif_name);    /**     *  Enable/disable/start/stop all MLD6IGMP vif interfaces.     *     *  @param enable if true, then enable the vifs, otherwise disable them.     */    XrlCmdError mld6igmp_0_1_enable_all_vifs(	// Input values,	const bool&	enable);    XrlCmdError mld6igmp_0_1_start_all_vifs();    XrlCmdError mld6igmp_0_1_stop_all_vifs();    /**     *  Enable/disable/start/stop the MLD6IGMP protocol.     *     *  @param enable if true, then enable the MLD6IGMP protocol, otherwise     *  disable it.     */    XrlCmdError mld6igmp_0_1_enable_mld6igmp(	// Input values,	const bool&	enable);    XrlCmdError mld6igmp_0_1_start_mld6igmp();    XrlCmdError mld6igmp_0_1_stop_mld6igmp();    /**     *  Enable/disable/start/stop the MLD6IGMP CLI access.     *     *  @param enable if true, then enable the MLD6IGMP CLI access, otherwise     *  disable it.     */    XrlCmdError mld6igmp_0_1_enable_cli(	// Input values,	const bool&	enable);    XrlCmdError mld6igmp_0_1_start_cli();    XrlCmdError mld6igmp_0_1_stop_cli();    /**     *  Get the configured protocol version per interface.     *     *  @param vif_name the name of the vif to apply to.     *     *  @param proto_version the protocol version.     */    XrlCmdError mld6igmp_0_1_get_vif_proto_version(	// Input values, 	const string&	vif_name, 	// Output values, 	uint32_t&	proto_version);    /**     *  Set the protocol version per interface.     *     *  @param vif_name the name of the vif to apply to.     *     *  @param proto_version the protocol version.     */    XrlCmdError mld6igmp_0_1_set_vif_proto_version(	// Input values, 	const string&	vif_name, 	const uint32_t&	proto_version);    /**     *  Reset the protocol version per interface to its default value.     *     *  @param vif_name the name of the vif to apply to.     */    XrlCmdError mld6igmp_0_1_reset_vif_proto_version(	// Input values, 	const string&	vif_name);    /**     *  Get the IP Router Alert option check per interface for received     *  packets.     *     *  @param vif_name the name of the vif to apply to.     *     *  @param enabled if true, then the IP Router Alert option check was     *  enabled, otherwise it was disabled.     */    XrlCmdError mld6igmp_0_1_get_vif_ip_router_alert_option_check(	// Input values,	const string&	vif_name,	// Output values,	bool&	enabled);    /**     *  Set the IP Router Alert option check per interface for received     *  packets.     *     *  @param vif_name the name of the vif to apply to.     *     *  @param enable if true, then enable the IP Router Alert option check,     *  otherwise disable it.     */    XrlCmdError mld6igmp_0_1_set_vif_ip_router_alert_option_check(	// Input values,	const string&	vif_name,	const bool&	enable);    /**     *  Reset the IP Router Alert option check per interface for received     *  packets to its default value.     *     *  @param vif_name the name of the vif to apply to.     */    XrlCmdError mld6igmp_0_1_reset_vif_ip_router_alert_option_check(	// Input values,	const string&	vif_name);    /**     *  Get the Query Interval per interface.     *     *  @param vif_name the name of the vif to apply to.     *     *  @param interval_sec the number of seconds in the interval.     *     *  @param interval_usec the number of microseconds (in addition to     *  interval_sec) in the interval.     */    XrlCmdError mld6igmp_0_1_get_vif_query_interval(	// Input values,	const string&	vif_name,	// Output values,	uint32_t&	interval_sec,	uint32_t&	interval_usec);    /**     *  Set the Query Interval per interface.     *     *  @param vif_name the name of the vif to apply to.     *     *  @param interval_sec the number of seconds in the interval.     *     *  @param interval_usec the number of microseconds (in addition to     *  interval_sec) in the interval.     */    XrlCmdError mld6igmp_0_1_set_vif_query_interval(	// Input values,	const string&	vif_name,	const uint32_t&	interval_sec,	const uint32_t&	interval_usec);    /**     *  Reset the Query Interval per interface to its default value.     *     *  @param vif_name the name of the vif to apply to.     */    XrlCmdError mld6igmp_0_1_reset_vif_query_interval(	// Input values,	const string&	vif_name);    /**     *  Get the Last Member Query Interval per interface.     *     *  @param vif_name the name of the vif to apply to.     *     *  @param interval_sec the number of seconds in the interval.     *     *  @param interval_usec the number of microseconds (in addition to     *  interval_sec) in the interval.     */    XrlCmdError mld6igmp_0_1_get_vif_query_last_member_interval(	// Input values,	const string&	vif_name,	// Output values,	uint32_t&	interval_sec,	uint32_t&	interval_usec);    /**     *  Set the Last Member Query Interval per interface.     *     *  @param vif_name the name of the vif to apply to.     *     *  @param interval_sec the number of seconds in the interval.     *     *  @param interval_usec the number of microseconds (in addition to     *  interval_sec) in the interval.     */    XrlCmdError mld6igmp_0_1_set_vif_query_last_member_interval(	// Input values,	const string&	vif_name,	const uint32_t&	interval_sec,	const uint32_t&	interval_usec);    /**     *  Reset the Last Member Query Interval per interface to its default     *  value.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -