?? mld6igmp_node.hh
字號:
// -*- 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/mld6igmp_node.hh,v 1.2 2008/07/23 05:09:49 pavlin Exp $#ifndef __MLD6IGMP_MLD6IGMP_NODE_HH__#define __MLD6IGMP_MLD6IGMP_NODE_HH__//// IGMP and MLD node definition.//#include <vector>#include "libxorp/vif.hh"#include "libproto/proto_node.hh"#include "libfeaclient/ifmgr_xrl_mirror.hh"#include "mrt/buffer.h"#include "mrt/multicast_defs.h"//// Constants definitions////// Structures/classes, typedefs and macros//class EventLoop;class IPvX;class IPvXNet;class Mld6igmpVif;/** * @short The MLD/IGMP node class. * * There should be one node per MLD or IGMP instance. There should be * one instance per address family. */class Mld6igmpNode : public ProtoNode<Mld6igmpVif>, public IfMgrHintObserver, public ServiceChangeObserverBase {public: /** * Constructor for a given address family, module ID, and event loop. * * @param family the address family (AF_INET or AF_INET6 for * IPv4 and IPv6 respectively). * @param module_id the module ID (@ref xorp_module_id). Should be * equal to XORP_MODULE_MLD6IGMP. * @param eventloop the event loop to use. */ Mld6igmpNode(int family, xorp_module_id module_id, EventLoop& eventloop); /** * Destructor */ virtual ~Mld6igmpNode(); /** * Start the node operation. * * Start the MLD or IGMP protocol. * After the startup operations are completed, * @ref Mld6igmpNode::final_start() is called internally * to complete the job. * * @return XORP_OK on success, otherwise XORP_ERROR. */ int start(); /** * Stop the node operation. * * Gracefully stop the MLD or IGMP protocol. * After the shutdown operations are completed, * @ref Mld6igmpNode::final_stop() is called internally * to complete the job. * * @return XORP_OK on success, otherwise XORP_ERROR. */ int stop(); /** * Completely start the node operation. * * This method should be called internally after @ref Mld6igmpNode::start() * to complete the job. * * @return XORP_OK on success, otherwise XORP_ERROR. */ int final_start(); /** * Completely stop the node operation. * * This method should be called internally after @ref Mld6igmpNode::stop() * to complete the job. * * @return XORP_OK on success, otherwise XORP_ERROR. */ int final_stop(); /** * Enable node operation. * * If an unit is not enabled, it cannot be start, or pending-start. */ void enable(); /** * Disable node operation. * * If an unit is disabled, it cannot be start or pending-start. * If the unit was runnning, it will be stop first. */ void disable(); /** * Get the IP protocol number. * * @return the IP protocol number. */ uint8_t ip_protocol_number() const; /** * Install a new MLD/IGMP vif. * * @param vif vif information about the new Mld6igmpVif to install. * @param error_msg the error message (if error). * @return XORP_OK on success, otherwise XORP_ERROR. */ int add_vif(const Vif& vif, string& error_msg); /** * Install a new MLD/IGMP vif. * * @param vif_name the name of the new vif. * @param vif_index the vif index of the new vif. * @param error_msg the error message (if error). * @return XORP_OK on success, otherwise XORP_ERROR. */ int add_vif(const string& vif_name, uint32_t vif_index, string& error_msg); /** * Delete an existing MLD/IGMP vif. * * @param vif_name the name of the vif to delete. * @param error_msg the error message (if error). * @return XORP_OK on success, otherwise XORP_ERROR. */ int delete_vif(const string& vif_name, string& error_msg); /** * Set flags to a vif. * * @param vif_name the name of the vif. * @param is_pim_register true if this is a PIM Register vif. * @param is_p2p true if this is a point-to-point vif. * @param is_loopback true if this is a loopback interface. * @param is_multicast true if the vif is multicast-capable. * @param is_broadcast true if the vif is broadcast-capable. * @param is_up true if the vif is UP and running. * @param mtu the MTU of the vif. * @param error_msg the error message (if error). * @return XORP_OK on success, otherwise XORP_ERROR. */ int set_vif_flags(const string& vif_name, bool is_pim_register, bool is_p2p, bool is_loopback, bool is_multicast, bool is_broadcast, bool is_up, uint32_t mtu, string& error_msg); /** * Add an address to a vif. * * @param vif_name the name of the vif. * @param addr the unicast address to add. * @param subnet_addr the subnet address to add. * @param broadcast_addr the broadcast address (when applicable). * @param peer_addr the peer address (when applicable). * @param error_msg the error message (if error). * @return XORP_OK on success, otherwise XORP_ERROR. */ int add_vif_addr(const string& vif_name, const IPvX& addr, const IPvXNet& subnet_addr, const IPvX& broadcast_addr, const IPvX& peer_addr, string& error_msg); /** * Delete an address from a vif. * * @param vif_name the name of the vif. * @param addr the unicast address to delete. * @param error_msg the error message (if error). * @return XORP_OK on success, otherwise XORP_ERROR. */ int delete_vif_addr(const string& vif_name, const IPvX& addr, string& error_msg); /** * Enable an existing MLD6IGMP vif. * * @param vif_name the name of the vif to enable. * @param error_msg the error message (if error). * @return XORP_OK on success, otherwise XORP_ERROR. */ int enable_vif(const string& vif_name, string& error_msg); /** * Disable an existing MLD6IGMP vif. * * @param vif_name the name of the vif to disable. * @param error_msg the error message (if error). * @return XORP_OK on success, otherwise XORP_ERROR. */ int disable_vif(const string& vif_name, string& error_msg); /** * Start an existing MLD6IGMP vif. * * @param vif_name the name of the vif to start. * @param error_msg the error message (if error). * @return XORP_OK on success, otherwise XORP_ERROR. */ int start_vif(const string& vif_name, string& error_msg); /** * Stop an existing MLD6IGMP vif. * * @param vif_name the name of the vif to start. * @param error_msg the error message (if error). * @return XORP_OK on success, otherwise XORP_ERROR. */ int stop_vif(const string& vif_name, string& error_msg); /** * Start MLD/IGMP on all enabled interfaces. * * @return XORP_OK on success, otherwise XORP_ERROR. */ int start_all_vifs(); /** * Stop MLD/IGMP on all interfaces it was running on. * * @return XORP_OK on success, otherwise XORP_ERROR. */ int stop_all_vifs(); /** * Enable MLD/IGMP on all interfaces. * * @return XORP_OK on success, otherwise XORP_ERROR. */ int enable_all_vifs(); /** * Disable MLD/IGMP on all interfaces. * * @return XORP_OK on success, otherwise XORP_ERROR. */ int disable_all_vifs(); /** * Delete all MLD/IGMP vifs. */ void delete_all_vifs(); /** * A method called when a vif has completed its shutdown. * * @param vif_name the name of the vif that has completed its shutdown. */ void vif_shutdown_completed(const string& vif_name); /** * Receive a protocol packet. * * @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.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -