xorp

pim_node.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 
00003 // Copyright (c) 2001-2011 XORP, Inc and Others
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License, Version 2, June
00007 // 1991 as published by the Free Software Foundation. Redistribution
00008 // and/or modification of this program under the terms of any other
00009 // version of the GNU General Public License is not permitted.
00010 // 
00011 // This program is distributed in the hope that it will be useful, but
00012 // WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00014 // see the GNU General Public License, Version 2, a copy of which can be
00015 // found in the XORP LICENSE.gpl file.
00016 // 
00017 // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00018 // http://xorp.net
00019 
00020 
00021 
00022 #ifndef __PIM_PIM_NODE_HH__
00023 #define __PIM_PIM_NODE_HH__
00024 
00025 
00026 //
00027 // PIM node definition.
00028 //
00029 
00030 
00031 #include "libxorp/xorp.h"
00032 #include "libxorp/vif.hh"
00033 #include "libproto/proto_node.hh"
00034 #include "libfeaclient/ifmgr_xrl_mirror.hh"
00035 #include "mrt/buffer.h"
00036 #include "mrt/mifset.hh"
00037 #include "pim_bsr.hh"
00038 #include "pim_mrib_table.hh"
00039 #include "pim_mrt.hh"
00040 #include "pim_rp.hh"
00041 #include "pim_scope_zone_table.hh"
00042 #include "pim_vif.hh"
00043 
00044 
00045 class EventLoop;
00046 class IPvX;
00047 class IPvXNet;
00048 class PimMrt;
00049 class PimNbr;
00050 class PimVif;
00051 
00058 class PimNode : public ProtoNode<PimVif>,
00059         public IfMgrHintObserver,
00060         public ServiceChangeObserverBase {
00061 public:
00072     PimNode(int family, xorp_module_id module_id, EventLoop& eventloop);
00073     
00077     virtual ~PimNode();
00078 
00080     virtual void destruct_me();
00081 
00092     int     start();
00093     
00108     int     stop();
00109     
00118     int     final_start();
00119 
00128     int     final_stop();
00129 
00135     void    enable();
00136     
00143     void    disable();
00144 
00150     uint8_t ip_protocol_number() const;
00151 
00159     int     add_vif(const Vif& vif, string& error_msg);
00160     
00169     int     add_vif(const string& vif_name, uint32_t vif_index,
00170             string& error_msg);
00171     
00179     int     delete_vif(const string& vif_name, string& error_msg);
00180     
00195     int     set_vif_flags(const string& vif_name,
00196                   bool is_pim_register, bool is_p2p,
00197                   bool is_loopback, bool is_multicast,
00198                   bool is_broadcast, bool is_up, uint32_t mtu,
00199                   string& error_msg);
00200     
00214     int     add_vif_addr(const string& vif_name,
00215                  const IPvX& addr,
00216                  const IPvXNet& subnet_addr,
00217                  const IPvX& broadcast_addr,
00218                  const IPvX& peer_addr,
00219                  bool& should_send_pim_hello,
00220                  string& error_msg);
00221     
00232     int     delete_vif_addr(const string& vif_name,
00233                 const IPvX& addr,
00234                 bool& should_send_pim_hello,
00235                 string& error_msg);
00236     
00244     int     enable_vif(const string& vif_name, string& error_msg);
00245 
00253     int     disable_vif(const string& vif_name, string& error_msg);
00254 
00262     int     start_vif(const string& vif_name, string& error_msg);
00263     
00271     int     stop_vif(const string& vif_name, string& error_msg);
00272     
00278     int     start_all_vifs();
00279     
00285     int     stop_all_vifs();
00286     
00292     int     enable_all_vifs();
00293     
00299     int     disable_all_vifs();
00300     
00304     void    delete_all_vifs();
00305 
00311     void    vif_shutdown_completed(const string& vif_name);
00312 
00332     int     proto_recv(const string& if_name,
00333                const string& vif_name,
00334                const IPvX& src_address,
00335                const IPvX& dst_address,
00336                uint8_t ip_protocol,
00337                int32_t ip_ttl,
00338                int32_t ip_tos,
00339                bool ip_router_alert,
00340                bool ip_internet_control,
00341                const vector<uint8_t>& payload,
00342                string& error_msg);
00343 
00367     int     pim_send(const string& if_name,
00368                   const string& vif_name,
00369                   const IPvX& src_address,
00370                   const IPvX& dst_address,
00371                   uint8_t ip_protocol,
00372                   int32_t ip_ttl,
00373                   int32_t ip_tos,
00374                   bool ip_router_alert,
00375                   bool ip_internet_control,
00376                   buffer_t *buffer,
00377                   string& error_msg);
00378     
00408     int     signal_message_recv(const string& src_module_instance_name,
00409                     int message_type,
00410                     uint32_t vif_index,
00411                     const IPvX& src,
00412                     const IPvX& dst,
00413                     const uint8_t *rcvbuf,
00414                     size_t rcvlen);
00418     int     signal_message_send(const string&, // dst_module_instance_name,
00419                     int     , // message_type,
00420                     uint32_t    , // vif_index,
00421                     const IPvX& , // src,
00422                     const IPvX& , // dst,
00423                     const uint8_t * , // sndbuf,
00424                     size_t    // sndlen
00425     ) { XLOG_UNREACHABLE(); return (XORP_ERROR); }
00426 
00443     virtual int register_receiver(const string& if_name,
00444                   const string& vif_name,
00445                   uint8_t ip_protocol,
00446                   bool enable_multicast_loopback) = 0;
00447 
00462     virtual int unregister_receiver(const string& if_name,
00463                     const string& vif_name,
00464                     uint8_t ip_protocol) = 0;
00465 
00477     virtual int register_protocol(const string& if_name,
00478                   const string& vif_name,
00479                   uint8_t ip_protocol) = 0;
00480 
00490     virtual int unregister_protocol(const string& if_name,
00491                     const string& vif_name) = 0;
00492 
00493 
00509     virtual int join_multicast_group(const string& if_name,
00510                      const string& vif_name,
00511                      uint8_t ip_protocol,
00512                      const IPvX& group_address) = 0;
00528     virtual int leave_multicast_group(const string& if_name,
00529                       const string& vif_name,
00530                       uint8_t ip_protocol,
00531                       const IPvX& group_address) = 0;
00532 
00542     virtual int add_mfc_to_kernel(const PimMfc& pim_mfc) = 0;
00543     
00553     virtual int delete_mfc_from_kernel(const PimMfc& pim_mfc) = 0;
00554     
00592     virtual int add_dataflow_monitor(const IPvX& source_addr,
00593                      const IPvX& group_addr,
00594                      uint32_t threshold_interval_sec,
00595                      uint32_t threshold_interval_usec,
00596                      uint32_t threshold_packets,
00597                      uint32_t threshold_bytes,
00598                      bool is_threshold_in_packets,
00599                      bool is_threshold_in_bytes,
00600                      bool is_geq_upcall,
00601                      bool is_leq_upcall) = 0;
00602     
00640     virtual int delete_dataflow_monitor(const IPvX& source_addr,
00641                     const IPvX& group_addr,
00642                     uint32_t threshold_interval_sec,
00643                     uint32_t threshold_interval_usec,
00644                     uint32_t threshold_packets,
00645                     uint32_t threshold_bytes,
00646                     bool is_threshold_in_packets,
00647                     bool is_threshold_in_bytes,
00648                     bool is_geq_upcall,
00649                     bool is_leq_upcall) = 0;
00650     
00662     virtual int delete_all_dataflow_monitor(const IPvX& source_addr,
00663                         const IPvX& group_addr) = 0;
00664     
00679     virtual int add_protocol_mld6igmp(uint32_t vif_index) = 0;
00680     
00692     virtual int delete_protocol_mld6igmp(uint32_t vif_index) = 0;
00693     
00703     int     add_membership(uint32_t vif_index, const IPvX& source,
00704                    const IPvX& group);
00705     
00715     int     delete_membership(uint32_t vif_index, const IPvX& source,
00716                   const IPvX& group);
00717     
00730     bool is_directly_connected(const PimVif& pim_vif,
00731                    const IPvX& ipaddr_test) const;
00732     
00738     PimVif  *vif_find_pim_register() const;
00739     
00746     uint32_t    pim_register_vif_index() const { return (_pim_register_vif_index); }
00747     
00753     PimMrt& pim_mrt()       { return _pim_mrt;      }
00754     
00761     PimMribTable& pim_mrib_table()  { return (_pim_mrib_table); }
00762     
00768     PimBsr& pim_bsr()       { return (_pim_bsr);        }
00769     
00775     RpTable&    rp_table()      { return (_rp_table);       }
00776     
00782     PimScopeZoneTable& pim_scope_zone_table() { return (_pim_scope_zone_table); }
00783     
00790     Mifset& pim_vifs_dr()       { return (_pim_vifs_dr);    }
00791     
00800     void    set_pim_vifs_dr(uint32_t vif_index, bool v);
00801 
00809     PimVif  *pim_vif_rpf_find(const IPvX& dst_addr);
00810 
00818     PimNbr  *pim_nbr_rpf_find(const IPvX& dst_addr);
00819     
00829     PimNbr  *pim_nbr_rpf_find(const IPvX& dst_addr, const Mrib *mrib);
00830     
00841     PimNbr  *pim_nbr_find_global(const IPvX& nbr_addr);
00842     
00846     void    enable_bsr() { pim_bsr().enable(); }
00847     
00852     void    disable_bsr() { pim_bsr().disable(); }
00853     
00859     int     start_bsr() { return (pim_bsr().start()); }
00860     
00866     int     stop_bsr() { return (pim_bsr().stop()); }
00867 
00874     int     apply_bsr_changes(string& error_msg) {
00875     return (pim_bsr().apply_bsr_changes(error_msg));
00876     }
00877 
00878     //
00879     // Configuration methods
00880     //
00881     
00888     int     set_config_all_vifs_done(string& error_msg);
00889 
00898     int     get_vif_proto_version(const string& vif_name,
00899                       int& proto_version,
00900                       string& error_msg);
00901     
00910     int     set_vif_proto_version(const string& vif_name,
00911                       int proto_version,
00912                       string& error_msg);
00913     
00922     int     reset_vif_proto_version(const string& vif_name,
00923                     string& error_msg);
00924 
00925     //
00926     int     get_vif_hello_triggered_delay(const string& vif_name,
00927                           uint16_t& hello_triggered_delay,
00928                           string& error_msg);
00929     int     set_vif_hello_triggered_delay(const string& vif_name,
00930                           uint16_t hello_triggered_delay,
00931                           string& error_msg);
00932     int     reset_vif_hello_triggered_delay(const string& vif_name,
00933                         string& error_msg);
00934     //
00935     int     get_vif_hello_period(const string& vif_name,
00936                      uint16_t& hello_period,
00937                      string& error_msg);
00938     int     set_vif_hello_period(const string& vif_name,
00939                      uint16_t hello_period,
00940                      string& error_msg);
00941     int     reset_vif_hello_period(const string& vif_name,
00942                        string& error_msg);
00943     //
00944     int     get_vif_hello_holdtime(const string& vif_name,
00945                        uint16_t& hello_holdtime,
00946                        string& error_msg);
00947     int     set_vif_hello_holdtime(const string& vif_name,
00948                        uint16_t hello_holdtime,
00949                        string& error_msg);
00950     int     reset_vif_hello_holdtime(const string& vif_name,
00951                      string& error_msg);
00952     //
00953     int     get_vif_dr_priority(const string& vif_name,
00954                     uint32_t& dr_priority,
00955                     string& error_msg);
00956     int     set_vif_dr_priority(const string& vif_name,
00957                     uint32_t dr_priority,
00958                     string& error_msg);
00959     int     reset_vif_dr_priority(const string& vif_name,
00960                       string& error_msg);
00961     //
00962     int     get_vif_propagation_delay(const string& vif_name,
00963                       uint16_t& propagation_delay,
00964                       string& error_msg);
00965     int     set_vif_propagation_delay(const string& vif_name,
00966                       uint16_t propagation_delay,
00967                       string& error_msg);
00968     int     reset_vif_propagation_delay(const string& vif_name,
00969                         string& error_msg);
00970     //
00971     int     get_vif_override_interval(const string& vif_name,
00972                       uint16_t& override_interval,
00973                       string& error_msg);
00974     int     set_vif_override_interval(const string& vif_name,
00975                       uint16_t override_interval,
00976                       string& error_msg);
00977     int     reset_vif_override_interval(const string& vif_name,
00978                         string& error_msg);
00979     //
00980     int     get_vif_is_tracking_support_disabled(const string& vif_name,
00981                              bool& is_tracking_support_disabled,
00982                              string& error_msg);
00983     int     set_vif_is_tracking_support_disabled(const string& vif_name,
00984                              bool is_tracking_support_disabled,
00985                              string& error_msg);
00986     int     reset_vif_is_tracking_support_disabled(const string& vif_name,
00987                                string& error_msg);
00988     //
00989     int     get_vif_accept_nohello_neighbors(const string& vif_name,
00990                          bool& accept_nohello_neighbors,
00991                          string& error_msg);
00992     int     set_vif_accept_nohello_neighbors(const string& vif_name,
00993                          bool accept_nohello_neighbors,
00994                          string& error_msg);
00995     int     reset_vif_accept_nohello_neighbors(const string& vif_name,
00996                            string& error_msg);
00997     //
00998     int     get_vif_join_prune_period(const string& vif_name,
00999                       uint16_t& join_prune_period,
01000                       string& error_msg);
01001     int     set_vif_join_prune_period(const string& vif_name,
01002                       uint16_t join_prune_period,
01003                       string& error_msg);
01004     int     reset_vif_join_prune_period(const string& vif_name,
01005                         string& error_msg);
01006     //
01007     int     get_switch_to_spt_threshold(bool& is_enabled,
01008                         uint32_t& interval_sec,
01009                         uint32_t& bytes,
01010                         string& error_msg);
01011     int     set_switch_to_spt_threshold(bool is_enabled,
01012                         uint32_t interval_sec,
01013                         uint32_t bytes,
01014                         string& error_msg);
01015     int     reset_switch_to_spt_threshold(string& error_msg);
01016     //
01017     int     add_config_scope_zone_by_vif_name(const IPvXNet& scope_zone_id,
01018                           const string& vif_name,
01019                           string& error_msg);
01020     int     add_config_scope_zone_by_vif_addr(const IPvXNet& scope_zone_id,
01021                           const IPvX& vif_addr,
01022                           string& error_msg);
01023     int     delete_config_scope_zone_by_vif_name(const IPvXNet& scope_zone_id,
01024                              const string& vif_name,
01025                              string& error_msg);
01026     int     delete_config_scope_zone_by_vif_addr(const IPvXNet& scope_zone_id,
01027                              const IPvX& vif_addr,
01028                              string& error_msg);
01029     //
01030     int     add_config_cand_bsr(const IPvXNet& scope_zone_id,
01031                     bool is_scope_zone,
01032                     const string& vif_name,
01033                     const IPvX& vif_addr,
01034                     uint8_t bsr_priority,
01035                     uint8_t hash_mask_len,
01036                     string& error_msg);
01037     int     delete_config_cand_bsr(const IPvXNet& scope_zone_id,
01038                        bool is_scope_zone,
01039                        string& error_msg);
01040     int     add_config_cand_rp(const IPvXNet& group_prefix,
01041                    bool is_scope_zone,
01042                    const string& vif_name,
01043                    const IPvX& vif_addr,
01044                    uint8_t rp_priority,
01045                    uint16_t rp_holdtime,
01046                    string& error_msg);
01047     int     delete_config_cand_rp(const IPvXNet& group_prefix,
01048                       bool is_scope_zone,
01049                       const string& vif_name,
01050                       const IPvX& vif_addr,
01051                       string& error_msg);
01052     int     add_config_static_rp(const IPvXNet& group_prefix,
01053                      const IPvX& rp_addr,
01054                      uint8_t rp_priority,
01055                      uint8_t hash_mask_len,
01056                      string& error_msg);
01057     int     delete_config_static_rp(const IPvXNet& group_prefix,
01058                     const IPvX& rp_addr,
01059                     string& error_msg);
01060     int     delete_config_all_static_group_prefixes_rp(const IPvX& rp_addr,
01061                                string& error_msg);
01062     int     delete_config_all_static_rps(string& error_msg);
01063     int     config_static_rp_done(string& error_msg);
01064 
01065     int     add_alternative_subnet(const string& vif_name,
01066                        const IPvXNet& subnet,
01067                        string& error_msg);
01068     int     delete_alternative_subnet(const string& vif_name,
01069                       const IPvXNet& subnet,
01070                       string& error_msg);
01071     int     remove_all_alternative_subnets(const string& vif_name,
01072                            string& error_msg);
01073     
01074     //
01075     // Debug-related methods
01076     //
01077     
01085     bool    is_log_trace() const { return (_is_log_trace); }
01086     
01094     void    set_log_trace(bool is_enabled) { _is_log_trace = is_enabled; }
01095     
01096     //
01097     // Test-related methods
01098     //
01099     // Join/Prune test-related methods
01100     int     add_test_jp_entry(const IPvX& source_addr,
01101                   const IPvX& group_addr,
01102                   uint8_t group_mask_len,
01103                   mrt_entry_type_t mrt_entry_type,
01104                   action_jp_t action_jp, uint16_t holdtime,
01105                   bool is_new_group);
01106     int     send_test_jp_entry(const string& vif_name,
01107                    const IPvX& nbr_addr,
01108                    string& error_msg);
01109     // Assert test-related methods
01110     int     send_test_assert(const string& vif_name,
01111                  const IPvX& source_addr,
01112                  const IPvX& group_addr,
01113                  bool rpt_bit,
01114                  uint32_t metric_preference,
01115                  uint32_t metric,
01116                  string& error_msg);
01117     // Bootstrap test-related methods
01118     int     add_test_bsr_zone(const PimScopeZoneId& zone_id,
01119                   const IPvX& bsr_addr,
01120                   uint8_t bsr_priority,
01121                   uint8_t hash_mask_len,
01122                   uint16_t fragment_tag);
01123     int     add_test_bsr_group_prefix(const PimScopeZoneId& zone_id,
01124                       const IPvXNet& group_prefix,
01125                       bool is_scope_zone,
01126                       uint8_t expected_rp_count);
01127     int     add_test_bsr_rp(const PimScopeZoneId& zone_id,
01128                 const IPvXNet& group_prefix,
01129                 const IPvX& rp_addr,
01130                 uint8_t rp_priority,
01131                 uint16_t rp_holdtime);
01132     int     send_test_bootstrap(const string& vif_name, string& error_msg);
01133     int     send_test_bootstrap_by_dest(const string& vif_name,
01134                         const IPvX& dest_addr,
01135                         string& error_msg);
01136     int     send_test_cand_rp_adv();
01137     
01138     
01139     //
01140     // PimNbr-related methods
01141     //
01142     void    add_pim_mre_no_pim_nbr(PimMre *pim_mre);
01143     void    delete_pim_mre_no_pim_nbr(PimMre *pim_mre);
01144     list<PimNbr *>& processing_pim_nbr_list() {
01145     return (_processing_pim_nbr_list);
01146     }
01147     void    init_processing_pim_mre_rp(uint32_t vif_index,
01148                        const IPvX& pim_nbr_addr);
01149     void    init_processing_pim_mre_wc(uint32_t vif_index,
01150                        const IPvX& pim_nbr_addr);
01151     void    init_processing_pim_mre_sg(uint32_t vif_index,
01152                        const IPvX& pim_nbr_addr);
01153     void    init_processing_pim_mre_sg_rpt(uint32_t vif_index,
01154                            const IPvX& pim_nbr_addr);
01155     PimNbr  *find_processing_pim_mre_rp(uint32_t vif_index,
01156                         const IPvX& pim_nbr_addr);
01157     PimNbr  *find_processing_pim_mre_wc(uint32_t vif_index,
01158                         const IPvX& pim_nbr_addr);
01159     PimNbr  *find_processing_pim_mre_sg(uint32_t vif_index,
01160                         const IPvX& pim_nbr_addr);
01161     PimNbr  *find_processing_pim_mre_sg_rpt(uint32_t vif_index,
01162                         const IPvX& pim_nbr_addr);
01163     
01164     //
01165     // Configuration parameters
01166     //
01167     ConfigParam<bool>& is_switch_to_spt_enabled() {
01168     return (_is_switch_to_spt_enabled);
01169     }
01170     ConfigParam<uint32_t>& switch_to_spt_threshold_interval_sec() {
01171     return (_switch_to_spt_threshold_interval_sec);
01172     }
01173     ConfigParam<uint32_t>& switch_to_spt_threshold_bytes() {
01174     return (_switch_to_spt_threshold_bytes);
01175     }
01176 
01177 
01178     //
01179     // Statistics-related counters and values
01180     //
01181     void    clear_pim_statistics();
01182     int     clear_pim_statistics_per_vif(const string& vif_name,
01183                          string& error_msg);
01184     //
01185     uint32_t    pimstat_hello_messages_received() const;
01186     uint32_t    pimstat_hello_messages_sent() const;
01187     uint32_t    pimstat_hello_messages_rx_errors() const;
01188     uint32_t    pimstat_register_messages_received() const;
01189     uint32_t    pimstat_register_messages_sent() const;
01190     uint32_t    pimstat_register_messages_rx_errors() const;
01191     uint32_t    pimstat_register_stop_messages_received() const;
01192     uint32_t    pimstat_register_stop_messages_sent() const;
01193     uint32_t    pimstat_register_stop_messages_rx_errors() const;
01194     uint32_t    pimstat_join_prune_messages_received() const;
01195     uint32_t    pimstat_join_prune_messages_sent() const;
01196     uint32_t    pimstat_join_prune_messages_rx_errors() const;
01197     uint32_t    pimstat_bootstrap_messages_received() const;
01198     uint32_t    pimstat_bootstrap_messages_sent() const;
01199     uint32_t    pimstat_bootstrap_messages_rx_errors() const;
01200     uint32_t    pimstat_assert_messages_received() const;
01201     uint32_t    pimstat_assert_messages_sent() const;
01202     uint32_t    pimstat_assert_messages_rx_errors() const;
01203     uint32_t    pimstat_graft_messages_received() const;
01204     uint32_t    pimstat_graft_messages_sent() const;
01205     uint32_t    pimstat_graft_messages_rx_errors() const;
01206     uint32_t    pimstat_graft_ack_messages_received() const;
01207     uint32_t    pimstat_graft_ack_messages_sent() const;
01208     uint32_t    pimstat_graft_ack_messages_rx_errors() const;
01209     uint32_t    pimstat_candidate_rp_messages_received() const;
01210     uint32_t    pimstat_candidate_rp_messages_sent() const;
01211     uint32_t    pimstat_candidate_rp_messages_rx_errors() const;
01212     //
01213     uint32_t    pimstat_unknown_type_messages() const;
01214     uint32_t    pimstat_unknown_version_messages() const;
01215     uint32_t    pimstat_neighbor_unknown_messages() const;
01216     uint32_t    pimstat_bad_length_messages() const;
01217     uint32_t    pimstat_bad_checksum_messages() const;
01218     uint32_t    pimstat_bad_receive_interface_messages() const;
01219     uint32_t    pimstat_rx_interface_disabled_messages() const;
01220     uint32_t    pimstat_rx_register_not_rp() const;
01221     uint32_t    pimstat_rp_filtered_source() const;
01222     uint32_t    pimstat_unknown_register_stop() const;
01223     uint32_t    pimstat_rx_join_prune_no_state() const;
01224     uint32_t    pimstat_rx_graft_graft_ack_no_state() const;
01225     uint32_t    pimstat_rx_graft_on_upstream_interface() const;
01226     uint32_t    pimstat_rx_candidate_rp_not_bsr() const;
01227     uint32_t    pimstat_rx_bsr_when_bsr() const;
01228     uint32_t    pimstat_rx_bsr_not_rpf_interface() const;
01229     uint32_t    pimstat_rx_unknown_hello_option() const;
01230     uint32_t    pimstat_rx_data_no_state() const;
01231     uint32_t    pimstat_rx_rp_no_state() const;
01232     uint32_t    pimstat_rx_aggregate() const;
01233     uint32_t    pimstat_rx_malformed_packet() const;
01234     uint32_t    pimstat_no_rp() const;
01235     uint32_t    pimstat_no_route_upstream() const;
01236     uint32_t    pimstat_rp_mismatch() const;
01237     uint32_t    pimstat_rpf_neighbor_unknown() const;
01238     //
01239     uint32_t    pimstat_rx_join_rp() const;
01240     uint32_t    pimstat_rx_prune_rp() const;
01241     uint32_t    pimstat_rx_join_wc() const;
01242     uint32_t    pimstat_rx_prune_wc() const;
01243     uint32_t    pimstat_rx_join_sg() const;
01244     uint32_t    pimstat_rx_prune_sg() const;
01245     uint32_t    pimstat_rx_join_sg_rpt() const;
01246     uint32_t    pimstat_rx_prune_sg_rpt() const;
01247     //
01248     //
01249     int pimstat_hello_messages_received_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01250     int pimstat_hello_messages_sent_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01251     int pimstat_hello_messages_rx_errors_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01252     int pimstat_register_messages_received_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01253     int pimstat_register_messages_sent_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01254     int pimstat_register_messages_rx_errors_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01255     int pimstat_register_stop_messages_received_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01256     int pimstat_register_stop_messages_sent_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01257     int pimstat_register_stop_messages_rx_errors_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01258     int pimstat_join_prune_messages_received_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01259     int pimstat_join_prune_messages_sent_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01260     int pimstat_join_prune_messages_rx_errors_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01261     int pimstat_bootstrap_messages_received_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01262     int pimstat_bootstrap_messages_sent_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01263     int pimstat_bootstrap_messages_rx_errors_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01264     int pimstat_assert_messages_received_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01265     int pimstat_assert_messages_sent_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01266     int pimstat_assert_messages_rx_errors_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01267     int pimstat_graft_messages_received_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01268     int pimstat_graft_messages_sent_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01269     int pimstat_graft_messages_rx_errors_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01270     int pimstat_graft_ack_messages_received_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01271     int pimstat_graft_ack_messages_sent_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01272     int pimstat_graft_ack_messages_rx_errors_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01273     int pimstat_candidate_rp_messages_received_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01274     int pimstat_candidate_rp_messages_sent_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01275     int pimstat_candidate_rp_messages_rx_errors_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01276     //
01277     int pimstat_unknown_type_messages_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01278     int pimstat_unknown_version_messages_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01279     int pimstat_neighbor_unknown_messages_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01280     int pimstat_bad_length_messages_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01281     int pimstat_bad_checksum_messages_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01282     int pimstat_bad_receive_interface_messages_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01283     int pimstat_rx_interface_disabled_messages_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01284     int pimstat_rx_register_not_rp_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01285     int pimstat_rp_filtered_source_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01286     int pimstat_unknown_register_stop_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01287     int pimstat_rx_join_prune_no_state_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01288     int pimstat_rx_graft_graft_ack_no_state_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01289     int pimstat_rx_graft_on_upstream_interface_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01290     int pimstat_rx_candidate_rp_not_bsr_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01291     int pimstat_rx_bsr_when_bsr_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01292     int pimstat_rx_bsr_not_rpf_interface_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01293     int pimstat_rx_unknown_hello_option_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01294     int pimstat_rx_data_no_state_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01295     int pimstat_rx_rp_no_state_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01296     int pimstat_rx_aggregate_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01297     int pimstat_rx_malformed_packet_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01298     int pimstat_no_rp_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01299     int pimstat_no_route_upstream_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01300     int pimstat_rp_mismatch_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01301     int pimstat_rpf_neighbor_unknown_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01302     //
01303     int pimstat_rx_join_rp_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01304     int pimstat_rx_prune_rp_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01305     int pimstat_rx_join_wc_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01306     int pimstat_rx_prune_wc_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01307     int pimstat_rx_join_sg_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01308     int pimstat_rx_prune_sg_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01309     int pimstat_rx_join_sg_rpt_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01310     int pimstat_rx_prune_sg_rpt_per_vif(const string& vif_name, uint32_t& result, string& error_msg) const;
01311 
01312 protected:
01313     //
01314     // IfMgrHintObserver methods
01315     //
01316     void tree_complete();
01317     void updates_made();
01318 
01319 private:
01327     void status_change(ServiceBase*  service,
01328                ServiceStatus old_status,
01329                ServiceStatus new_status);
01330 
01339     virtual const ServiceBase* ifmgr_mirror_service_base() const = 0;
01340 
01349     virtual const IfMgrIfTree&  ifmgr_iftree() const = 0;
01350 
01357     virtual void fea_register_startup() = 0;
01358 
01365     virtual void mfea_register_startup() = 0;
01366 
01373     virtual void rib_register_startup() = 0;
01374 
01381     virtual void fea_register_shutdown() = 0;
01382 
01389     virtual void mfea_register_shutdown() = 0;
01390 
01397     virtual void rib_register_shutdown() = 0;
01398     
01399     PimMrt  _pim_mrt;       // PIM Multicast Routing Table
01400     PimMribTable _pim_mrib_table;   // PIM Multicast Routing Information Base table
01401     RpTable _rp_table;      // The RP table
01402     PimScopeZoneTable _pim_scope_zone_table; // The scope zone table
01403     PimBsr  _pim_bsr;       // The BSR state
01404     
01405     uint32_t    _pim_register_vif_index;// The PIM Register vif index
01406     Mifset  _pim_vifs_dr;       // The vifs I am the DR
01407     
01408     buffer_t    *_buffer_recv;      // Buffer for receiving messages
01409     
01410     list<PimNbr *> _processing_pim_nbr_list; // The list of deleted PimNbr with
01411                     // PimMre entries to process.
01412     
01413     //
01414     // Configuration parameters
01415     //
01416     ConfigParam<bool>       _is_switch_to_spt_enabled;
01417     ConfigParam<uint32_t>   _switch_to_spt_threshold_interval_sec;
01418     ConfigParam<uint32_t>   _switch_to_spt_threshold_bytes;
01419 
01420     //
01421     // A local copy with the interface state information
01422     //
01423     IfMgrIfTree _iftree;
01424 
01425     //
01426     // Debug and test-related state
01427     //
01428     bool    _is_log_trace;      // If true, enable XLOG_TRACE()
01429     list<PimJpHeader> _test_jp_headers_list; // J/P headers to send test J/P messages
01430 };
01431 
01432 
01433 #endif // __PIM_PIM_NODE_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations