xorp

pim_vif.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 // $XORP: xorp/pim/pim_vif.hh,v 1.48 2008/10/02 21:57:55 bms Exp $
00021 
00022 
00023 #ifndef __PIM_PIM_VIF_HH__
00024 #define __PIM_PIM_VIF_HH__
00025 
00026 
00027 //
00028 // PIM virtual interface definition.
00029 //
00030 
00031 
00032 
00033 
00034 #include "libxorp/config_param.hh"
00035 #include "libxorp/vif.hh"
00036 #include "libxorp/timer.hh"
00037 #include "libproto/proto_unit.hh"
00038 #include "mrt/buffer.h"
00039 #include "mrt/mifset.hh"
00040 #include "mrt/multicast_defs.h"
00041 #include "pim_nbr.hh"
00042 #include "pim_proto_join_prune_message.hh"
00043 
00044 
00045 //
00046 // Constants definitions
00047 //
00048 
00049 //
00050 // Structures/classes, typedefs and macros
00051 //
00052 
00053 class AssertMetric;
00054 class BsrZone;
00055 class PimJpGroup;
00056 class PimJpHeader;
00057 class PimNbr;
00058 class PimNode;
00059 
00060 
00064 class PimVif : public ProtoUnit, public Vif {
00065 public:
00072     PimVif(PimNode* pim_node, const Vif& vif);
00073     
00077     virtual ~PimVif();
00078 
00082     void    set_default_config();
00083     
00093     int     set_proto_version(int proto_version);
00094     
00101     int     start(string& error_msg);
00102     
00105     void notifyUpdated();
00106 
00119     int     stop(string& error_msg);
00120     
00130     int     final_stop(string& error_msg);
00131 
00137     void    enable();
00138     
00145     void    disable();
00146     
00155     int     pim_recv(const IPvX& src, const IPvX& dst, buffer_t *buffer);
00156     
00166     string  flags_string() const;
00167     
00173     PimNode* pim_node() const { return _pim_node; }
00174     
00180     PimMrt& pim_mrt() const;
00181     
00188     PimNbr& pim_nbr_me()        { return (_pim_nbr_me);     }
00189     
00193     void    pim_hello_start();
00194     
00198     void    pim_hello_stop();
00199     
00203     void    pim_dr_elect();
00204     
00216     bool    i_may_become_dr(const IPvX& exclude_addr);
00217     
00223     const IPvX& primary_addr() const    { return (_pim_nbr_me.primary_addr()); }
00224 
00230     const IPvX& domain_wide_addr() const    { return (_domain_wide_addr); }
00231 
00237     void    set_domain_wide_addr(const IPvX& v) { _domain_wide_addr = v; }
00238 
00251     int     update_primary_and_domain_wide_address(string& error_msg);
00252 
00258     const IPvX& dr_addr() const     { return (_dr_addr);        }
00259 
00260     //
00261     // Hello-related configuration parameters
00262     //
00263     ConfigParam<uint16_t>& hello_triggered_delay() { return (_hello_triggered_delay); }
00264     ConfigParam<uint16_t>& hello_period() { return (_hello_period); }
00265     ConfigParam<uint16_t>& hello_holdtime() { return (_hello_holdtime); }
00266     ConfigParam<uint32_t>& dr_priority() { return (_dr_priority); }
00267     ConfigParam<uint16_t>& propagation_delay() { return (_propagation_delay); }
00268     ConfigParam<uint16_t>& override_interval() { return (_override_interval); }
00269     ConfigParam<bool>& is_tracking_support_disabled() { return (_is_tracking_support_disabled); }
00270     ConfigParam<bool>& accept_nohello_neighbors() { return (_accept_nohello_neighbors); }
00271     
00272     //
00273     // Hello-related non-configurable parameters
00274     //
00275     ConfigParam<uint32_t>& genid() { return (_genid); }
00276     
00277     //
00278     // Join/Prune-related configuration parameters
00279     //
00280     ConfigParam<uint16_t>& join_prune_period() { return (_join_prune_period); }
00281     ConfigParam<uint16_t>& join_prune_holdtime() { return (_join_prune_holdtime); }
00282     
00283     //
00284     // Assert-related configuration parameters
00285     //
00286     ConfigParam<uint32_t>& assert_time() { return (_assert_time); }
00287     ConfigParam<uint32_t>& assert_override_interval() { return (_assert_override_interval); }
00288     
00289     //
00290     // Functions for sending protocol messages.
00291     //
00292     int     pim_send(const IPvX& src, const IPvX& dst,
00293              uint8_t message_type, buffer_t *buffer,
00294              string& error_msg);
00295     int     pim_hello_send(string& error_msg);
00296     int     pim_hello_first_send();
00297     int     pim_join_prune_send(PimNbr *pim_nbr, PimJpHeader *jp_header,
00298                     string& error_msg);
00299     int     pim_assert_mre_send(PimMre *pim_mre,
00300                     const IPvX& assert_source_addr,
00301                     string& error_msg);
00302     int     pim_assert_cancel_send(PimMre *pim_mre, string& error_msg);
00303     int     pim_assert_send(const IPvX& assert_source_addr,
00304                 const IPvX& assert_group_addr,
00305                 bool rpt_bit,
00306                 uint32_t metric_preference,
00307                 uint32_t metric,
00308                 string& error_msg);
00309     int     pim_register_send(const IPvX& rp_addr,
00310                   const IPvX& source_addr,
00311                   const IPvX& group_addr,
00312                   const uint8_t *rcvbuf,
00313                   size_t rcvlen,
00314                   string& error_msg);
00315     int     pim_register_null_send(const IPvX& rp_addr,
00316                        const IPvX& source_addr,
00317                        const IPvX& group_addr,
00318                        string& error_msg);
00319     int     pim_register_stop_send(const IPvX& dr_addr,
00320                        const IPvX& source_addr,
00321                        const IPvX& group_addr,
00322                        string& error_msg);
00323     int     pim_bootstrap_send(const IPvX& dst_addr,
00324                    const BsrZone& bsr_zone,
00325                    string& error_msg);
00326     buffer_t    *pim_bootstrap_send_prepare(const IPvX& src_addr,
00327                         const IPvX& dst_addr,
00328                         const BsrZone& bsr_zone,
00329                         bool is_first_fragment);
00330     int     pim_cand_rp_adv_send(const IPvX& bsr_addr,
00331                      const BsrZone& bsr_zone);
00332     
00333     void    hello_timer_start(uint32_t sec, uint32_t usec);
00334     void    hello_timer_start_random(uint32_t sec, uint32_t usec);
00335     
00336     bool    is_lan_delay_enabled() const;
00337     // Link-related time intervals
00338     const TimeVal& effective_propagation_delay() const;
00339     const TimeVal& effective_override_interval() const;
00340     bool    is_lan_suppression_state_enabled() const;
00341     const TimeVal& upstream_join_timer_t_suppressed() const;
00342     const TimeVal& upstream_join_timer_t_override() const;
00343     
00344     // Misc. functions
00345     const TimeVal& jp_override_interval() const;
00346     list<PimNbr *>& pim_nbrs() { return (_pim_nbrs); }
00347     size_t  pim_nbrs_number() const { return (_pim_nbrs.size()); }
00348     bool    i_am_dr() const;
00349     void    set_i_am_dr(bool v);
00350     PimNbr  *pim_nbr_find(const IPvX& nbr_addr);
00351     void    add_pim_nbr(PimNbr *pim_nbr);
00352     int     delete_pim_nbr(PimNbr *pim_nbr);
00353     void    delete_pim_nbr_from_nbr_list(PimNbr *pim_nbr);
00354     const list<IPvXNet>& alternative_subnet_list() const { return _alternative_subnet_list; }
00355     void add_alternative_subnet(const IPvXNet& subnet);
00356     void delete_alternative_subnet(const IPvXNet& subnet);
00357     void remove_all_alternative_subnets();
00358 
00359     // Usage-related functions
00360     size_t  usage_by_pim_mre_task() const { return (_usage_by_pim_mre_task); }
00361     void    incr_usage_by_pim_mre_task();
00362     void    decr_usage_by_pim_mre_task();
00363     
00375     uint16_t    calculate_ipv6_pseudo_header_checksum(const IPvX& src,
00376                               const IPvX& dst,
00377                               size_t len,
00378                               uint8_t protocol);
00379     buffer_t    *buffer_send_prepare();
00380     buffer_t    *buffer_send_prepare(buffer_t *buffer);
00381 
00382     //
00383     // Statistics-related counters and values
00384     //
00385     void    clear_pim_statistics();
00386     //
00387     uint32_t    pimstat_hello_messages_received() const { return _pimstat_hello_messages_received.get(); }
00388     uint32_t    pimstat_hello_messages_sent() const { return _pimstat_hello_messages_sent.get(); }
00389     uint32_t    pimstat_hello_messages_rx_errors() const { return _pimstat_hello_messages_rx_errors.get(); }
00390     uint32_t    pimstat_register_messages_received() const { return _pimstat_register_messages_received.get(); }
00391     uint32_t    pimstat_register_messages_sent() const { return _pimstat_register_messages_sent.get(); }
00392     uint32_t    pimstat_register_messages_rx_errors() const { return _pimstat_register_messages_rx_errors.get(); }
00393     uint32_t    pimstat_register_stop_messages_received() const { return _pimstat_register_stop_messages_received.get(); }
00394     uint32_t    pimstat_register_stop_messages_sent() const { return _pimstat_register_stop_messages_sent.get(); }
00395     uint32_t    pimstat_register_stop_messages_rx_errors() const { return _pimstat_register_stop_messages_rx_errors.get(); }
00396     uint32_t    pimstat_join_prune_messages_received() const { return _pimstat_join_prune_messages_received.get(); }
00397     uint32_t    pimstat_join_prune_messages_sent() const { return _pimstat_join_prune_messages_sent.get(); }
00398     uint32_t    pimstat_join_prune_messages_rx_errors() const { return _pimstat_join_prune_messages_rx_errors.get(); }
00399     uint32_t    pimstat_bootstrap_messages_received() const { return _pimstat_bootstrap_messages_received.get(); }
00400     uint32_t    pimstat_bootstrap_messages_sent() const { return _pimstat_bootstrap_messages_sent.get(); }
00401     uint32_t    pimstat_bootstrap_messages_rx_errors() const { return _pimstat_bootstrap_messages_rx_errors.get(); }
00402     uint32_t    pimstat_assert_messages_received() const { return _pimstat_assert_messages_received.get(); }
00403     uint32_t    pimstat_assert_messages_sent() const { return _pimstat_assert_messages_sent.get(); }
00404     uint32_t    pimstat_assert_messages_rx_errors() const { return _pimstat_assert_messages_rx_errors.get(); }
00405     uint32_t    pimstat_graft_messages_received() const { return _pimstat_graft_messages_received.get(); }
00406     uint32_t    pimstat_graft_messages_sent() const { return _pimstat_graft_messages_sent.get(); }
00407     uint32_t    pimstat_graft_messages_rx_errors() const { return _pimstat_graft_messages_rx_errors.get(); }
00408     uint32_t    pimstat_graft_ack_messages_received() const { return _pimstat_graft_ack_messages_received.get(); }
00409     uint32_t    pimstat_graft_ack_messages_sent() const { return _pimstat_graft_ack_messages_sent.get(); }
00410     uint32_t    pimstat_graft_ack_messages_rx_errors() const { return _pimstat_graft_ack_messages_rx_errors.get(); }
00411     uint32_t    pimstat_candidate_rp_messages_received() const { return _pimstat_candidate_rp_messages_received.get(); }
00412     uint32_t    pimstat_candidate_rp_messages_sent() const { return _pimstat_candidate_rp_messages_sent.get(); }
00413     uint32_t    pimstat_candidate_rp_messages_rx_errors() const { return _pimstat_candidate_rp_messages_rx_errors.get(); }
00414     //
00415     uint32_t    pimstat_unknown_type_messages() const { return _pimstat_unknown_type_messages.get(); }
00416     uint32_t    pimstat_unknown_version_messages() const { return _pimstat_unknown_version_messages.get(); }
00417     uint32_t    pimstat_neighbor_unknown_messages() const { return _pimstat_neighbor_unknown_messages.get(); }
00418     uint32_t    pimstat_bad_length_messages() const { return _pimstat_bad_length_messages.get(); }
00419     uint32_t    pimstat_bad_checksum_messages() const { return _pimstat_bad_checksum_messages.get(); }
00420     uint32_t    pimstat_bad_receive_interface_messages() const { return _pimstat_bad_receive_interface_messages.get(); }
00421     uint32_t    pimstat_rx_interface_disabled_messages() const { return _pimstat_rx_interface_disabled_messages.get(); }
00422     uint32_t    pimstat_rx_register_not_rp() const { return _pimstat_rx_register_not_rp.get(); }
00423     uint32_t    pimstat_rp_filtered_source() const { return _pimstat_rp_filtered_source.get(); }
00424     uint32_t    pimstat_unknown_register_stop() const { return _pimstat_unknown_register_stop.get(); }
00425     uint32_t    pimstat_rx_join_prune_no_state() const { return _pimstat_rx_join_prune_no_state.get(); }
00426     uint32_t    pimstat_rx_graft_graft_ack_no_state() const { return _pimstat_rx_graft_graft_ack_no_state.get(); }
00427     uint32_t    pimstat_rx_graft_on_upstream_interface() const { return _pimstat_rx_graft_on_upstream_interface.get(); }
00428     uint32_t    pimstat_rx_candidate_rp_not_bsr() const { return _pimstat_rx_candidate_rp_not_bsr.get(); }
00429     uint32_t    pimstat_rx_bsr_when_bsr() const { return _pimstat_rx_bsr_when_bsr.get(); }
00430     uint32_t    pimstat_rx_bsr_not_rpf_interface() const { return _pimstat_rx_bsr_not_rpf_interface.get(); }
00431     uint32_t    pimstat_rx_unknown_hello_option() const { return _pimstat_rx_unknown_hello_option.get(); }
00432     uint32_t    pimstat_rx_data_no_state() const { return _pimstat_rx_data_no_state.get(); }
00433     uint32_t    pimstat_rx_rp_no_state() const { return _pimstat_rx_rp_no_state.get(); }
00434     uint32_t    pimstat_rx_aggregate() const { return _pimstat_rx_aggregate.get(); }
00435     uint32_t    pimstat_rx_malformed_packet() const { return _pimstat_rx_malformed_packet.get(); }
00436     uint32_t    pimstat_no_rp() const { return _pimstat_no_rp.get(); }
00437     uint32_t    pimstat_no_route_upstream() const { return _pimstat_no_route_upstream.get(); }
00438     uint32_t    pimstat_rp_mismatch() const { return _pimstat_rp_mismatch.get(); }
00439     uint32_t    pimstat_rpf_neighbor_unknown() const { return _pimstat_rpf_neighbor_unknown.get(); }
00440     //
00441     uint32_t    pimstat_rx_join_rp() const { return _pimstat_rx_join_rp.get(); }
00442     uint32_t    pimstat_rx_prune_rp() const { return _pimstat_rx_prune_rp.get(); }
00443     uint32_t    pimstat_rx_join_wc() const { return _pimstat_rx_join_wc.get(); }
00444     uint32_t    pimstat_rx_prune_wc() const { return _pimstat_rx_prune_wc.get(); }
00445     uint32_t    pimstat_rx_join_sg() const { return _pimstat_rx_join_sg.get(); }
00446     uint32_t    pimstat_rx_prune_sg() const { return _pimstat_rx_prune_sg.get(); }
00447     uint32_t    pimstat_rx_join_sg_rpt() const { return _pimstat_rx_join_sg_rpt.get(); }
00448     uint32_t    pimstat_rx_prune_sg_rpt() const { return _pimstat_rx_prune_sg_rpt.get(); }
00449     
00450 private:
00451     // Private functions
00452     void    hello_timer_timeout();
00453     void    hello_once_timer_timeout();
00454     
00455     //
00456     // Callbacks for configuration and non-configurable parameters
00457     //
00458     void    set_hello_period_callback(uint16_t v) {
00459     uint16_t old_hello_holdtime_divided
00460         = (uint16_t) (_hello_holdtime.get() / PIM_HELLO_HELLO_HOLDTIME_PERIOD_RATIO);
00461     if (v != old_hello_holdtime_divided)
00462         _hello_holdtime.set(
00463         (uint16_t)(v * PIM_HELLO_HELLO_HOLDTIME_PERIOD_RATIO));
00464     _pim_nbr_me.set_hello_holdtime(_hello_holdtime.get());
00465     }
00466     void    set_hello_holdtime_callback(uint16_t v) {
00467     uint16_t new_hello_period
00468         = (uint16_t)(v / PIM_HELLO_HELLO_HOLDTIME_PERIOD_RATIO);
00469     if (_hello_period.get() != new_hello_period)
00470         _hello_period.set(new_hello_period);
00471     _pim_nbr_me.set_hello_holdtime(_hello_holdtime.get());
00472     }
00473     void    set_dr_priority_callback(uint32_t v) {
00474     _pim_nbr_me.set_dr_priority(v);
00475     _pim_nbr_me.set_is_dr_priority_present(true);
00476     }
00477     void    set_propagation_delay_callback(uint16_t v) {
00478     _pim_nbr_me.set_propagation_delay(v);
00479     _pim_nbr_me.set_is_lan_prune_delay_present(true);
00480     }
00481     void    set_override_interval_callback(uint16_t v) {
00482     _pim_nbr_me.set_override_interval(v);
00483     _pim_nbr_me.set_is_lan_prune_delay_present(true);
00484     }
00485     void    set_is_tracking_support_disabled_callback(bool v) {
00486     _pim_nbr_me.set_is_tracking_support_disabled(v);
00487     }
00488     void    set_genid_callback(uint32_t v) {
00489     _pim_nbr_me.set_genid(v);
00490     _pim_nbr_me.set_is_genid_present(true);
00491     }
00492     void    set_join_prune_period_callback(uint16_t v) {
00493     _join_prune_holdtime.set(
00494         (uint16_t)(v * PIM_JOIN_PRUNE_HOLDTIME_PERIOD_RATIO));
00495     }
00496     
00497     
00498     int jp_entry_add(const IPvX& source_addr, const IPvX& group_addr,
00499              mrt_entry_type_t mrt_entry_type, action_jp_t action_jp,
00500              uint16_t holdtime);
00501     int jp_entry_flush();
00502     
00503     bool is_send_unicast_bootstrap() const {
00504     return (! _send_unicast_bootstrap_nbr_list.empty());
00505     }
00506     void add_send_unicast_bootstrap_nbr(const IPvX& nbr_addr) {
00507     _send_unicast_bootstrap_nbr_list.push_back(nbr_addr);
00508     }
00509     const list<IPvX>& send_unicast_bootstrap_nbr_list() const {
00510     return (_send_unicast_bootstrap_nbr_list);
00511     }
00512     void delete_send_unicast_bootstrap_nbr_list() {
00513     _send_unicast_bootstrap_nbr_list.clear();
00514     }
00515 
00516     bool should_send_pim_hello() const { return (_should_send_pim_hello); }
00517     void set_should_send_pim_hello(bool v) { _should_send_pim_hello = v; }
00518     
00519     // Private state
00520     PimNode*    _pim_node;      // The PIM node I belong to
00521     buffer_t    *_buffer_send;      // Buffer for sending messages
00522     buffer_t    *_buffer_send_hello;    // Buffer for sending Hello messages
00523     buffer_t    *_buffer_send_bootstrap;// Buffer for sending Bootstrap msgs
00524     enum {
00525     PIM_VIF_DR  = 1 << 0    // I am the Designated Router
00526     };
00527     uint32_t    _proto_flags;       // Various flags (PIM_VIF_*)
00528     IPvX    _dr_addr;       // IP address of the current DR
00529     XorpTimer   _hello_timer;       // Timer to send a HELLO message
00530     XorpTimer   _hello_once_timer;  // Timer to send once a HELLO message
00531     list<PimNbr *> _pim_nbrs;       // List of all PIM neighbors
00532     PimNbr  _pim_nbr_me;        // Myself (for misc. purpose)
00533     IPvX    _domain_wide_addr;  // The domain-wide reachable address on
00534                     // this vif
00535     list<IPvX>  _send_unicast_bootstrap_nbr_list; // List of new nbrs to
00536                           // unicast to them the
00537                           // Bootstrap message.
00538 
00539     // The alternative subnets on a vif. Used to make incoming traffic with a
00540     // non-local source address to appear as it is coming from a local subnet.
00541     list<IPvXNet> _alternative_subnet_list;
00542 
00543     //
00544     // Misc configuration parameters
00545     //
00546 
00547     //
00548     // Hello-related configuration parameters
00549     //
00550     ConfigParam<uint16_t> _hello_triggered_delay; // The Triggered_Hello_Delay
00551     ConfigParam<uint16_t> _hello_period;    // The Hello_Period
00552     ConfigParam<uint16_t> _hello_holdtime;  // The Hello_Holdtime
00553     ConfigParam<uint32_t> _dr_priority;     // The DR Priority
00554     ConfigParam<uint16_t> _propagation_delay;   // The Propagation_Delay
00555     ConfigParam<uint16_t> _override_interval;   // The Override_Interval
00556     ConfigParam<bool>     _is_tracking_support_disabled; // The T-bit
00557     ConfigParam<bool>     _accept_nohello_neighbors; // If true, accept
00558                         // neighbors that didn't send
00559                         // a Hello message first
00560     
00561     //
00562     // Hello-related non-configurable parameters
00563     //
00564     ConfigParam<uint32_t> _genid;       // The Generation ID
00565     
00566     //
00567     // Join/Prune-related configuration parameters
00568     //
00569     ConfigParam<uint16_t> _join_prune_period;   // The period between J/P msgs
00570     ConfigParam<uint16_t> _join_prune_holdtime; // The holdtime in J/P msgs
00571     
00572     //
00573     // Assert-related configuration parameters
00574     //
00575     ConfigParam<uint32_t> _assert_time;     // The Assert_Time
00576     ConfigParam<uint32_t> _assert_override_interval; // The Assert_Override_Interval
00577     
00578     bool    _should_send_pim_hello; // True if PIM_HELLO should be sent
00579                     // before any other control messages
00580     
00581     //
00582     // Statistics-related counters and values
00583     //
00584     ConfigParam<uint32_t> _pimstat_hello_messages_received;
00585     ConfigParam<uint32_t> _pimstat_hello_messages_sent;
00586     ConfigParam<uint32_t> _pimstat_hello_messages_rx_errors;
00587     ConfigParam<uint32_t> _pimstat_register_messages_received;
00588     ConfigParam<uint32_t> _pimstat_register_messages_sent;
00589     ConfigParam<uint32_t> _pimstat_register_messages_rx_errors;
00590     ConfigParam<uint32_t> _pimstat_register_stop_messages_received;
00591     ConfigParam<uint32_t> _pimstat_register_stop_messages_sent;
00592     ConfigParam<uint32_t> _pimstat_register_stop_messages_rx_errors;
00593     ConfigParam<uint32_t> _pimstat_join_prune_messages_received;
00594     ConfigParam<uint32_t> _pimstat_join_prune_messages_sent;
00595     ConfigParam<uint32_t> _pimstat_join_prune_messages_rx_errors;
00596     ConfigParam<uint32_t> _pimstat_bootstrap_messages_received;
00597     ConfigParam<uint32_t> _pimstat_bootstrap_messages_sent;
00598     ConfigParam<uint32_t> _pimstat_bootstrap_messages_rx_errors;
00599     ConfigParam<uint32_t> _pimstat_assert_messages_received;
00600     ConfigParam<uint32_t> _pimstat_assert_messages_sent;
00601     ConfigParam<uint32_t> _pimstat_assert_messages_rx_errors;
00602     ConfigParam<uint32_t> _pimstat_graft_messages_received;
00603     ConfigParam<uint32_t> _pimstat_graft_messages_sent;
00604     ConfigParam<uint32_t> _pimstat_graft_messages_rx_errors;
00605     ConfigParam<uint32_t> _pimstat_graft_ack_messages_received;
00606     ConfigParam<uint32_t> _pimstat_graft_ack_messages_sent;
00607     ConfigParam<uint32_t> _pimstat_graft_ack_messages_rx_errors;
00608     ConfigParam<uint32_t> _pimstat_candidate_rp_messages_received;
00609     ConfigParam<uint32_t> _pimstat_candidate_rp_messages_sent;
00610     ConfigParam<uint32_t> _pimstat_candidate_rp_messages_rx_errors;
00611     //
00612     ConfigParam<uint32_t> _pimstat_unknown_type_messages;
00613     ConfigParam<uint32_t> _pimstat_unknown_version_messages;
00614     ConfigParam<uint32_t> _pimstat_neighbor_unknown_messages;
00615     ConfigParam<uint32_t> _pimstat_bad_length_messages;
00616     ConfigParam<uint32_t> _pimstat_bad_checksum_messages;
00617     ConfigParam<uint32_t> _pimstat_bad_receive_interface_messages; // XXX: unused
00618     ConfigParam<uint32_t> _pimstat_rx_interface_disabled_messages;
00619     ConfigParam<uint32_t> _pimstat_rx_register_not_rp;
00620     ConfigParam<uint32_t> _pimstat_rp_filtered_source;      // XXX: unused
00621     ConfigParam<uint32_t> _pimstat_unknown_register_stop;
00622     ConfigParam<uint32_t> _pimstat_rx_join_prune_no_state;  // XXX: unused
00623     ConfigParam<uint32_t> _pimstat_rx_graft_graft_ack_no_state; // XXX: unused
00624     ConfigParam<uint32_t> _pimstat_rx_graft_on_upstream_interface; // XXX: unused
00625     ConfigParam<uint32_t> _pimstat_rx_candidate_rp_not_bsr;
00626     ConfigParam<uint32_t> _pimstat_rx_bsr_when_bsr;     // XXX: unused
00627     ConfigParam<uint32_t> _pimstat_rx_bsr_not_rpf_interface;
00628     ConfigParam<uint32_t> _pimstat_rx_unknown_hello_option;
00629     ConfigParam<uint32_t> _pimstat_rx_data_no_state;        // XXX: unused
00630     ConfigParam<uint32_t> _pimstat_rx_rp_no_state;      // XXX: unused
00631     ConfigParam<uint32_t> _pimstat_rx_aggregate;        // XXX: unused
00632     ConfigParam<uint32_t> _pimstat_rx_malformed_packet;
00633     ConfigParam<uint32_t> _pimstat_no_rp;           // XXX: unused
00634     ConfigParam<uint32_t> _pimstat_no_route_upstream;       // XXX: unused
00635     ConfigParam<uint32_t> _pimstat_rp_mismatch;         // XXX: unused
00636     ConfigParam<uint32_t> _pimstat_rpf_neighbor_unknown;    // XXX: unused
00637     //
00638     ConfigParam<uint32_t> _pimstat_rx_join_rp;
00639     ConfigParam<uint32_t> _pimstat_rx_prune_rp;
00640     ConfigParam<uint32_t> _pimstat_rx_join_wc;
00641     ConfigParam<uint32_t> _pimstat_rx_prune_wc;
00642     ConfigParam<uint32_t> _pimstat_rx_join_sg;
00643     ConfigParam<uint32_t> _pimstat_rx_prune_sg;
00644     ConfigParam<uint32_t> _pimstat_rx_join_sg_rpt;
00645     ConfigParam<uint32_t> _pimstat_rx_prune_sg_rpt;
00646     
00647     size_t  _usage_by_pim_mre_task; // Counter for usage by PimMreTask
00648     
00649     // Not-so handy private functions that should go somewhere else
00650     // PIM control messages recv functions
00651     int     pim_hello_recv(PimNbr *pim_nbr, const IPvX& src,
00652                    const IPvX& dst, buffer_t *buffer,
00653                    int nbr_proto_version);
00654     int     pim_register_recv(PimNbr *pim_nbr, const IPvX& src,
00655                   const IPvX& dst, buffer_t *buffer);
00656     int     pim_register_stop_recv(PimNbr *pim_nbr, const IPvX& src,
00657                        const IPvX& dst, buffer_t *buffer);
00658     int     pim_join_prune_recv(PimNbr *pim_nbr, const IPvX& src,
00659                     const IPvX& dst, buffer_t *buffer,
00660                     uint8_t message_type);
00661     int     pim_bootstrap_recv(PimNbr *pim_nbr, const IPvX& src,
00662                    const IPvX& dst, buffer_t *buffer);
00663     int     pim_assert_recv(PimNbr *pim_nbr, const IPvX& src,
00664                 const IPvX& dst, buffer_t *buffer);
00665     int     pim_graft_recv(PimNbr *pim_nbr, const IPvX& src,
00666                    const IPvX& dst, buffer_t *buffer);
00667     int     pim_graft_ack_recv(PimNbr *pim_nbr, const IPvX& src,
00668                    const IPvX& dst, buffer_t *buffer);
00669     int     pim_cand_rp_adv_recv(PimNbr *pim_nbr, const IPvX& src,
00670                      const IPvX& dst, buffer_t *buffer);
00671     
00672     // PIM control messages process functions
00673     int     pim_process(const IPvX& src, const IPvX& dst, buffer_t *buffer);
00674     int     pim_assert_process(PimNbr *pim_nbr,
00675                    const IPvX& src,
00676                    const IPvX& dst,
00677                    const IPvX& assert_source_addr,
00678                    const IPvX& assert_group_addr,
00679                    uint8_t assert_group_mask_len,
00680                    AssertMetric *assert_metric);
00681     int     pim_register_stop_process(const IPvX& rp_addr,
00682                       const IPvX& source_addr,
00683                       const IPvX& group_addr,
00684                       uint8_t group_mask_len);
00685     bool wants_to_be_started; // as soon as we can, ie if the interface appears.
00686 };
00687 
00688 //
00689 // Global variables
00690 //
00691 
00692 //
00693 // Global functions prototypes
00694 //
00695 
00696 #endif // __PIM_PIM_VIF_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations