xorp

ifmgr_cmds.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 Lesser General Public License, Version
00007 // 2.1, June 1999 as published by the Free Software Foundation.
00008 // Redistribution and/or modification of this program under the terms of
00009 // any other version of the GNU Lesser General Public License is not
00010 // permitted.
00011 // 
00012 // This program is distributed in the hope that it will be useful, but
00013 // WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00015 // see the GNU Lesser General Public License, Version 2.1, a copy of
00016 // which can be found in the XORP LICENSE.lgpl file.
00017 // 
00018 // XORP, Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00019 // http://xorp.net
00020 
00021 #ifndef __LIBFEACLIENT_IFMGR_CMDS_HH__
00022 #define __LIBFEACLIENT_IFMGR_CMDS_HH__
00023 
00024 #include "ifmgr_cmd_base.hh"
00025 #include "libxorp/fea_share.hh"
00026 
00030 class IfMgrIfCommandBase : public IfMgrCommandBase {
00031 public:
00032     IfMgrIfCommandBase(const string& ifname)
00033     : _ifname(ifname)
00034     {}
00035 
00039     const string& ifname() const        { return _ifname; }
00040 
00041 protected:
00042     string  _ifname;
00043 };
00044 
00048 class IfMgrIfAdd : public IfMgrIfCommandBase {
00049 public:
00050     IfMgrIfAdd(const string& ifname)
00051     : IfMgrIfCommandBase(ifname)
00052     {}
00053 
00054     bool execute(IfMgrIfTree& tree) const;
00055 
00056     bool forward(XrlSender&     sender,
00057          const string&      xrl_target,
00058          const IfMgrXrlSendCB&  xscb) const;
00059 
00060     string str() const;
00061 };
00062 
00066 class IfMgrIfRemove : public IfMgrIfCommandBase {
00067 public:
00068     IfMgrIfRemove(const string& ifname)
00069     : IfMgrIfCommandBase(ifname)
00070     {}
00071 
00072     bool execute(IfMgrIfTree& tree) const;
00073 
00074     bool forward(XrlSender&     sender,
00075          const string&      xrl_target,
00076          const IfMgrXrlSendCB&  xscb) const;
00077 
00078     string str() const;
00079 };
00080 
00084 class IfMgrIfSetEnabled : public IfMgrIfCommandBase {
00085 public:
00086     IfMgrIfSetEnabled(const string& ifname, bool enabled)
00087     : IfMgrIfCommandBase(ifname),
00088       _enabled(enabled)
00089     {}
00090 
00091     bool enabled() const            { return _enabled; }
00092 
00093     bool execute(IfMgrIfTree& tree) const;
00094 
00095     bool forward(XrlSender&     sender,
00096          const string&      xrl_target,
00097          const IfMgrXrlSendCB&  xscb) const;
00098 
00099     string str() const;
00100 
00101 protected:
00102     bool    _enabled;
00103 };
00104 
00108 class IfMgrIfSetDiscard : public IfMgrIfCommandBase {
00109 public:
00110     IfMgrIfSetDiscard(const string& ifname, bool discard)
00111     : IfMgrIfCommandBase(ifname),
00112       _discard(discard)
00113     {}
00114 
00115     bool discard() const            { return _discard; }
00116 
00117     bool execute(IfMgrIfTree& tree) const;
00118 
00119     bool forward(XrlSender&     sender,
00120          const string&      xrl_target,
00121          const IfMgrXrlSendCB&  xscb) const;
00122 
00123     string str() const;
00124 
00125 protected:
00126     bool    _discard;
00127 };
00128 
00132 class IfMgrIfSetUnreachable : public IfMgrIfCommandBase {
00133 public:
00134     IfMgrIfSetUnreachable(const string& ifname, bool unreachable)
00135     : IfMgrIfCommandBase(ifname),
00136       _unreachable(unreachable)
00137     {}
00138 
00139     bool unreachable() const            { return _unreachable; }
00140 
00141     bool execute(IfMgrIfTree& tree) const;
00142 
00143     bool forward(XrlSender&     sender,
00144          const string&      xrl_target,
00145          const IfMgrXrlSendCB&  xscb) const;
00146 
00147     string str() const;
00148 
00149 protected:
00150     bool    _unreachable;
00151 };
00152 
00156 class IfMgrIfSetManagement : public IfMgrIfCommandBase {
00157 public:
00158     IfMgrIfSetManagement(const string& ifname, bool management)
00159     : IfMgrIfCommandBase(ifname),
00160       _management(management)
00161     {}
00162 
00163     bool management() const         { return _management; }
00164 
00165     bool execute(IfMgrIfTree& tree) const;
00166 
00167     bool forward(XrlSender&     sender,
00168          const string&      xrl_target,
00169          const IfMgrXrlSendCB&  xscb) const;
00170 
00171     string str() const;
00172 
00173 protected:
00174     bool    _management;
00175 };
00176 
00180 class IfMgrIfSetMtu : public IfMgrIfCommandBase {
00181 public:
00182     IfMgrIfSetMtu(const string& ifname, uint32_t mtu)
00183     : IfMgrIfCommandBase(ifname),
00184       _mtu(mtu)
00185     {}
00186 
00187     uint32_t mtu() const            { return _mtu; }
00188 
00189     bool execute(IfMgrIfTree& tree) const;
00190 
00191     bool forward(XrlSender&     sender,
00192          const string&      xrl_target,
00193          const IfMgrXrlSendCB&  xscb) const;
00194 
00195     string str() const;
00196 
00197 protected:
00198     uint32_t    _mtu;
00199 };
00200 
00204 class IfMgrIfSetMac : public IfMgrIfCommandBase {
00205 public:
00206     IfMgrIfSetMac(const string& ifname, const Mac& mac)
00207     : IfMgrIfCommandBase(ifname),
00208       _mac(mac)
00209     {}
00210 
00211     const Mac& mac() const          { return _mac; }
00212 
00213     bool execute(IfMgrIfTree& tree) const;
00214 
00215     bool forward(XrlSender&     sender,
00216          const string&      xrl_target,
00217          const IfMgrXrlSendCB&  xscb) const;
00218 
00219     string str() const;
00220 
00221 protected:
00222     Mac     _mac;
00223 };
00224 
00228 class IfMgrIfSetPifIndex : public IfMgrIfCommandBase {
00229 public:
00230     IfMgrIfSetPifIndex(const string& ifname, uint32_t pif_index)
00231     : IfMgrIfCommandBase(ifname),
00232       _pif_index(pif_index)
00233     {}
00234 
00235     uint32_t pif_index() const          { return _pif_index; }
00236 
00237     bool execute(IfMgrIfTree& tree) const;
00238 
00239     bool forward(XrlSender&     sender,
00240          const string&      xrl_target,
00241          const IfMgrXrlSendCB&  xscb) const;
00242 
00243     string str() const;
00244 
00245 protected:
00246     uint32_t    _pif_index;
00247 };
00248 
00252 class IfMgrIfSetNoCarrier : public IfMgrIfCommandBase {
00253 public:
00254     IfMgrIfSetNoCarrier(const string& ifname, bool no_carrier)
00255     : IfMgrIfCommandBase(ifname),
00256       _no_carrier(no_carrier)
00257     {}
00258 
00259     bool no_carrier() const         { return _no_carrier; }
00260 
00261     bool execute(IfMgrIfTree& tree) const;
00262 
00263     bool forward(XrlSender&     sender,
00264          const string&      xrl_target,
00265          const IfMgrXrlSendCB&  xscb) const;
00266 
00267     string str() const;
00268 
00269 protected:
00270     bool    _no_carrier;
00271 };
00272 
00276 class IfMgrIfSetBaudrate : public IfMgrIfCommandBase {
00277 public:
00278     IfMgrIfSetBaudrate(const string& ifname, uint64_t baudrate)
00279     : IfMgrIfCommandBase(ifname),
00280       _baudrate(baudrate)
00281     {}
00282 
00283     uint64_t baudrate() const           { return _baudrate; }
00284 
00285     bool execute(IfMgrIfTree& tree) const;
00286 
00287     bool forward(XrlSender&     sender,
00288          const string&      xrl_target,
00289          const IfMgrXrlSendCB&  xscb) const;
00290 
00291     string str() const;
00292 
00293 protected:
00294     uint64_t    _baudrate;
00295 };
00296 
00297 
00301 class IfMgrVifCommandBase : public IfMgrIfCommandBase {
00302 public:
00303     IfMgrVifCommandBase(const string& ifname, const string& vifname)
00304     : IfMgrIfCommandBase(ifname),
00305       _vifname(vifname)
00306     {}
00307 
00311     const string& vifname() const       { return _vifname; }
00312 
00313 protected:
00314     string  _vifname;
00315 };
00316 
00320 class IfMgrIfSetString : public IfMgrIfCommandBase {
00321 public:
00322     IfMgrIfSetString(const string& ifname,
00323              const string& str,
00324              IfStringTypeE tp)
00325     : IfMgrIfCommandBase(ifname),
00326       _str(str),
00327       _tp(tp)
00328     {}
00329 
00330     bool execute(IfMgrIfTree& tree) const;
00331 
00332     bool forward(XrlSender&     sender,
00333          const string&      xrl_target,
00334          const IfMgrXrlSendCB&  xscb) const;
00335 
00336     string str() const;
00337 
00338 protected:
00339     string _str;
00340     IfStringTypeE _tp;
00341 };
00342 
00346 class IfMgrVifSetVlanId : public IfMgrVifCommandBase {
00347 public:
00348     IfMgrVifSetVlanId(const string& ifname,
00349               const string& vifname,
00350               uint16_t      vlan_id)
00351     : IfMgrVifCommandBase(ifname, vifname),
00352       _vlan_id(vlan_id)
00353     {}
00354 
00355     uint16_t vlan_id() const    { return _vlan_id; }
00356 
00357     bool execute(IfMgrIfTree& tree) const;
00358 
00359     bool forward(XrlSender&     sender,
00360          const string&      xrl_target,
00361          const IfMgrXrlSendCB&  xscb) const;
00362 
00363     string str() const;
00364 
00365 protected:
00366     uint16_t    _vlan_id;
00367 };
00368 
00369 
00370 
00371 
00375 class IfMgrVifAdd : public IfMgrVifCommandBase {
00376 public:
00377     IfMgrVifAdd(const string& ifname, const string& vifname)
00378     : IfMgrVifCommandBase(ifname, vifname)
00379     {}
00380 
00381     bool execute(IfMgrIfTree& tree) const;
00382 
00383     bool forward(XrlSender&     sender,
00384          const string&      xrl_target,
00385          const IfMgrXrlSendCB&  xscb) const;
00386 
00387     string str() const;
00388 };
00389 
00393 class IfMgrVifRemove : public IfMgrVifCommandBase {
00394 public:
00395     IfMgrVifRemove(const string& ifname, const string& vifname)
00396     : IfMgrVifCommandBase(ifname, vifname)
00397     {}
00398 
00399     bool execute(IfMgrIfTree& tree) const;
00400 
00401     bool forward(XrlSender&     sender,
00402          const string&      xrl_target,
00403          const IfMgrXrlSendCB&  xscb) const;
00404 
00405     string str() const;
00406 };
00407 
00411 class IfMgrVifSetEnabled : public IfMgrVifCommandBase {
00412 public:
00413     IfMgrVifSetEnabled(const string&    ifname,
00414                const string&    vifname,
00415                bool     enabled)
00416     : IfMgrVifCommandBase(ifname, vifname), _enabled(enabled)
00417     {}
00418 
00419     bool enabled() const            { return _enabled; }
00420 
00421     bool execute(IfMgrIfTree& tree) const;
00422 
00423     bool forward(XrlSender&     sender,
00424          const string&      xrl_target,
00425          const IfMgrXrlSendCB&  xscb) const;
00426 
00427     string str() const;
00428 
00429 protected:
00430     bool    _enabled;
00431 };
00432 
00436 class IfMgrVifSetMulticastCapable : public IfMgrVifCommandBase {
00437 public:
00438     IfMgrVifSetMulticastCapable(const string&   ifname,
00439                 const string&   vifname,
00440                 bool        multicast_capable)
00441     : IfMgrVifCommandBase(ifname, vifname),
00442       _multicast_capable(multicast_capable)
00443     {}
00444 
00445     bool multicast_capable() const  { return _multicast_capable; }
00446 
00447     bool execute(IfMgrIfTree& tree) const;
00448 
00449     bool forward(XrlSender&     sender,
00450          const string&      xrl_target,
00451          const IfMgrXrlSendCB&  xscb) const;
00452 
00453     string str() const;
00454 
00455 protected:
00456     bool    _multicast_capable;
00457 };
00458 
00462 class IfMgrVifSetBroadcastCapable : public IfMgrVifCommandBase {
00463 public:
00464     IfMgrVifSetBroadcastCapable(const string&   ifname,
00465                 const string&   vifname,
00466                 bool        broadcast_capable)
00467     : IfMgrVifCommandBase(ifname, vifname),
00468       _broadcast_capable(broadcast_capable)
00469     {}
00470 
00471     bool broadcast_capable() const  { return _broadcast_capable; }
00472 
00473     bool execute(IfMgrIfTree& tree) const;
00474 
00475     bool forward(XrlSender&     sender,
00476          const string&      xrl_target,
00477          const IfMgrXrlSendCB&  xscb) const;
00478 
00479     string str() const;
00480 
00481 protected:
00482     bool    _broadcast_capable;
00483 };
00484 
00488 class IfMgrVifSetP2PCapable : public IfMgrVifCommandBase {
00489 public:
00490     IfMgrVifSetP2PCapable(const string& ifname,
00491               const string& vifname,
00492               bool      p2p_capable)
00493     : IfMgrVifCommandBase(ifname, vifname),
00494       _p2p_capable(p2p_capable)
00495     {}
00496 
00497     bool p2p_capable() const        { return _p2p_capable; }
00498 
00499     bool execute(IfMgrIfTree& tree) const;
00500 
00501     bool forward(XrlSender&     sender,
00502          const string&      xrl_target,
00503          const IfMgrXrlSendCB&  xscb) const;
00504 
00505     string str() const;
00506 
00507 protected:
00508     bool    _p2p_capable;
00509 };
00510 
00514 class IfMgrVifSetLoopbackCapable : public IfMgrVifCommandBase {
00515 public:
00516     IfMgrVifSetLoopbackCapable(const string&    ifname,
00517                    const string&    vifname,
00518                    bool     loopback_capable)
00519     : IfMgrVifCommandBase(ifname, vifname),
00520       _loopback_capable(loopback_capable)
00521     {}
00522 
00523     bool loopback_capable() const   { return _loopback_capable; }
00524 
00525     bool execute(IfMgrIfTree& tree) const;
00526 
00527     bool forward(XrlSender&     sender,
00528          const string&      xrl_target,
00529          const IfMgrXrlSendCB&  xscb) const;
00530 
00531     string str() const;
00532 
00533 protected:
00534     bool    _loopback_capable;
00535 };
00536 
00540 class IfMgrVifSetPimRegister : public IfMgrVifCommandBase {
00541 public:
00542     IfMgrVifSetPimRegister(const string&    ifname,
00543                const string&    vifname,
00544                bool         pim_register)
00545     : IfMgrVifCommandBase(ifname, vifname),
00546       _pim_register(pim_register)
00547     {}
00548 
00549     bool pim_register() const   { return _pim_register; }
00550 
00551     bool execute(IfMgrIfTree& tree) const;
00552 
00553     bool forward(XrlSender&     sender,
00554          const string&      xrl_target,
00555          const IfMgrXrlSendCB&  xscb) const;
00556 
00557     string str() const;
00558 
00559 protected:
00560     bool    _pim_register;
00561 };
00562 
00567 class IfMgrVifSetPifIndex : public IfMgrVifCommandBase {
00568 public:
00569     IfMgrVifSetPifIndex(const string&   ifname,
00570             const string&   vifname,
00571             uint32_t        pif_index)
00572     : IfMgrVifCommandBase(ifname, vifname),
00573       _pif_index(pif_index)
00574     {}
00575 
00576     uint32_t pif_index() const          { return _pif_index; }
00577 
00578     bool execute(IfMgrIfTree& tree) const;
00579 
00580     bool forward(XrlSender&     sender,
00581          const string&      xrl_target,
00582          const IfMgrXrlSendCB&  xscb) const;
00583 
00584     string str() const;
00585 
00586 protected:
00587     uint32_t    _pif_index;
00588 };
00589 
00594 class IfMgrVifSetVifIndex : public IfMgrVifCommandBase {
00595 public:
00596     IfMgrVifSetVifIndex(const string&   ifname,
00597             const string&   vifname,
00598             uint32_t    vif_index)
00599     : IfMgrVifCommandBase(ifname, vifname),
00600       _vif_index(vif_index)
00601     {}
00602 
00603     uint32_t vif_index() const          { return _vif_index; }
00604 
00605     bool execute(IfMgrIfTree& tree) const;
00606 
00607     bool forward(XrlSender&     sender,
00608          const string&      xrl_target,
00609          const IfMgrXrlSendCB&  xscb) const;
00610 
00611     string str() const;
00612 
00613 protected:
00614     uint32_t    _vif_index;
00615 };
00616 
00620 class IfMgrIPv4CommandBase : public IfMgrVifCommandBase {
00621 public:
00622     IfMgrIPv4CommandBase(const string&  ifname,
00623              const string&  vifname,
00624              const IPv4&    addr)
00625     : IfMgrVifCommandBase(ifname, vifname),
00626       _addr(addr)
00627     {}
00628 
00632     const IPv4& addr() const            { return _addr; }
00633 
00634 protected:
00635     IPv4    _addr;
00636 };
00637 
00641 class IfMgrIPv4Add : public IfMgrIPv4CommandBase {
00642 public:
00643     IfMgrIPv4Add(const string&  ifname,
00644          const string&  vifname,
00645          const IPv4&    addr)
00646     : IfMgrIPv4CommandBase(ifname, vifname, addr)
00647     {}
00648 
00649     bool execute(IfMgrIfTree& tree) const;
00650 
00651     bool forward(XrlSender&     sender,
00652           const string&     xrl_target,
00653           const IfMgrXrlSendCB& xscb) const;
00654 
00655     string str() const;
00656 };
00657 
00661 class IfMgrIPv4Remove : public IfMgrIPv4CommandBase {
00662 public:
00663     IfMgrIPv4Remove(const string&   ifname,
00664             const string&   vifname,
00665             const IPv4&     addr)
00666     : IfMgrIPv4CommandBase(ifname, vifname, addr)
00667     {}
00668 
00669     bool execute(IfMgrIfTree& tree) const;
00670 
00671     bool forward(XrlSender&     sender,
00672           const string&     xrl_target,
00673           const IfMgrXrlSendCB& xscb) const;
00674 
00675     string str() const;
00676 };
00677 
00681 class IfMgrIPv4SetPrefix : public IfMgrIPv4CommandBase {
00682 public:
00683     IfMgrIPv4SetPrefix(const string&    ifname,
00684                const string&    vifname,
00685                const IPv4&  addr,
00686                uint32_t     prefix_len)
00687     : IfMgrIPv4CommandBase(ifname, vifname, addr),
00688       _prefix_len(prefix_len)
00689     {}
00690 
00691     uint32_t prefix_len() const         { return _prefix_len; }
00692 
00693     bool execute(IfMgrIfTree& tree) const;
00694 
00695     bool forward(XrlSender&     sender,
00696          const string&      xrl_target,
00697          const IfMgrXrlSendCB&  xscb) const;
00698 
00699     string str() const;
00700 
00701 protected:
00702     uint32_t    _prefix_len;
00703 };
00704 
00708 class IfMgrIPv4SetEnabled : public IfMgrIPv4CommandBase {
00709 public:
00710     IfMgrIPv4SetEnabled(const string&   ifname,
00711             const string&   vifname,
00712             const IPv4& addr,
00713             bool        enabled)
00714     : IfMgrIPv4CommandBase(ifname, vifname, addr),
00715       _enabled(enabled)
00716     {}
00717 
00718     bool enabled() const                { return _enabled; }
00719 
00720     bool execute(IfMgrIfTree& tree) const;
00721 
00722     bool forward(XrlSender&     sender,
00723          const string&      xrl_target,
00724          const IfMgrXrlSendCB&  xscb) const;
00725 
00726     string str() const;
00727 
00728 protected:
00729     bool    _enabled;
00730 };
00731 
00735 class IfMgrIPv4SetMulticastCapable : public IfMgrIPv4CommandBase {
00736 public:
00737     IfMgrIPv4SetMulticastCapable(const string&  ifname,
00738                  const string&  vifname,
00739                  const IPv4&    addr,
00740                  bool       multicast_capable)
00741     : IfMgrIPv4CommandBase(ifname, vifname, addr),
00742       _multicast_capable(multicast_capable)
00743     {}
00744 
00745     bool multicast_capable() const  { return _multicast_capable; }
00746 
00747     bool execute(IfMgrIfTree& tree) const;
00748 
00749     bool forward(XrlSender&     sender,
00750          const string&      xrl_target,
00751          const IfMgrXrlSendCB&  xscb) const;
00752 
00753     string str() const;
00754 
00755 protected:
00756     bool    _multicast_capable;
00757 };
00758 
00762 class IfMgrIPv4SetLoopback : public IfMgrIPv4CommandBase {
00763 public:
00764     IfMgrIPv4SetLoopback(const string&  ifname,
00765              const string&  vifname,
00766              const IPv4&    addr,
00767              bool       loopback)
00768     : IfMgrIPv4CommandBase(ifname, vifname, addr),
00769       _loopback(loopback)
00770     {}
00771 
00772     bool loopback() const           { return _loopback; }
00773 
00774     bool execute(IfMgrIfTree& tree) const;
00775 
00776     bool forward(XrlSender&     sender,
00777          const string&      xrl_target,
00778          const IfMgrXrlSendCB&  xscb) const;
00779 
00780     string str() const;
00781 
00782 protected:
00783     bool    _loopback;
00784 };
00785 
00790 class IfMgrIPv4SetBroadcast : public IfMgrIPv4CommandBase {
00791 public:
00792     IfMgrIPv4SetBroadcast(const string& ifname,
00793               const string& vifname,
00794               const IPv4&   addr,
00795               const IPv4&   broadcast_addr)
00796     : IfMgrIPv4CommandBase(ifname, vifname, addr),
00797       _broadcast_addr(broadcast_addr)
00798     {}
00799 
00800     const IPv4& broadcast_addr() const  { return _broadcast_addr; }
00801 
00802     bool execute(IfMgrIfTree& tree) const;
00803 
00804     bool forward(XrlSender&     sender,
00805          const string&      xrl_target,
00806          const IfMgrXrlSendCB&  xscb) const;
00807 
00808     string str() const;
00809 
00810 protected:
00811     IPv4    _broadcast_addr;
00812 };
00813 
00818 class IfMgrIPv4SetEndpoint : public IfMgrIPv4CommandBase {
00819 public:
00820     IfMgrIPv4SetEndpoint(const string&  ifname,
00821              const string&  vifname,
00822              const IPv4&    addr,
00823              const IPv4&    endpoint_addr)
00824     : IfMgrIPv4CommandBase(ifname, vifname, addr),
00825       _endpoint_addr(endpoint_addr)
00826     {}
00827 
00828     const IPv4& endpoint_addr() const       { return _endpoint_addr; }
00829 
00830     bool execute(IfMgrIfTree& tree) const;
00831 
00832     bool forward(XrlSender&     sender,
00833          const string&      xrl_target,
00834          const IfMgrXrlSendCB&  xscb) const;
00835 
00836     string str() const;
00837 
00838 protected:
00839     IPv4    _endpoint_addr;
00840 };
00841 
00842 
00843 
00844 #ifdef HAVE_IPV6
00845 
00849 class IfMgrIPv6CommandBase : public IfMgrVifCommandBase {
00850 public:
00851     IfMgrIPv6CommandBase(const string&  ifname,
00852              const string&  vifname,
00853              const IPv6&    addr)
00854     : IfMgrVifCommandBase(ifname, vifname),
00855       _addr(addr)
00856     {}
00857 
00861     const IPv6& addr() const            { return _addr; }
00862 
00863 protected:
00864     IPv6    _addr;
00865 };
00866 
00870 class IfMgrIPv6Add : public IfMgrIPv6CommandBase {
00871 public:
00872     IfMgrIPv6Add(const string&  ifname,
00873          const string&  vifname,
00874          const IPv6&    addr)
00875     : IfMgrIPv6CommandBase(ifname, vifname, addr)
00876     {}
00877 
00878     bool execute(IfMgrIfTree& tree) const;
00879 
00880     bool forward(XrlSender&     sender,
00881           const string&     xrl_target,
00882           const IfMgrXrlSendCB& xscb) const;
00883 
00884     string str() const;
00885 };
00886 
00890 class IfMgrIPv6Remove : public IfMgrIPv6CommandBase {
00891 public:
00892     IfMgrIPv6Remove(const string&   ifname,
00893             const string&   vifname,
00894             const IPv6&     addr)
00895     : IfMgrIPv6CommandBase(ifname, vifname, addr)
00896     {}
00897 
00898     bool execute(IfMgrIfTree& tree) const;
00899 
00900     bool forward(XrlSender&     sender,
00901           const string&     xrl_target,
00902           const IfMgrXrlSendCB& xscb) const;
00903 
00904     string str() const;
00905 };
00906 
00910 class IfMgrIPv6SetPrefix : public IfMgrIPv6CommandBase {
00911 public:
00912     IfMgrIPv6SetPrefix(const string&    ifname,
00913                const string&    vifname,
00914                const IPv6&  addr,
00915                uint32_t     prefix_len)
00916     : IfMgrIPv6CommandBase(ifname, vifname, addr), _prefix_len(prefix_len)
00917     {}
00918 
00919     uint32_t prefix_len() const         { return _prefix_len; }
00920 
00921     bool execute(IfMgrIfTree& tree) const;
00922 
00923     bool forward(XrlSender&     sender,
00924          const string&      xrl_target,
00925          const IfMgrXrlSendCB&  xscb) const;
00926 
00927     string str() const;
00928 
00929 protected:
00930     uint32_t    _prefix_len;
00931 };
00932 
00936 class IfMgrIPv6SetEnabled : public IfMgrIPv6CommandBase {
00937 public:
00938     IfMgrIPv6SetEnabled(const string&   ifname,
00939             const string&   vifname,
00940             const IPv6& addr,
00941             bool        enabled)
00942     : IfMgrIPv6CommandBase(ifname, vifname, addr), _enabled(enabled)
00943     {}
00944 
00945     bool enabled() const                { return _enabled; }
00946 
00947     bool execute(IfMgrIfTree& tree) const;
00948 
00949     bool forward(XrlSender&     sender,
00950          const string&      xrl_target,
00951          const IfMgrXrlSendCB&  xscb) const;
00952 
00953     string str() const;
00954 
00955 protected:
00956     bool    _enabled;
00957 };
00958 
00962 class IfMgrIPv6SetMulticastCapable : public IfMgrIPv6CommandBase {
00963 public:
00964     IfMgrIPv6SetMulticastCapable(const string&  ifname,
00965                  const string&  vifname,
00966                  const IPv6&    addr,
00967                  bool       multicast_capable)
00968     : IfMgrIPv6CommandBase(ifname, vifname, addr),
00969       _multicast_capable(multicast_capable)
00970     {}
00971 
00972     bool multicast_capable() const  { return _multicast_capable; }
00973 
00974     bool execute(IfMgrIfTree& tree) const;
00975 
00976     bool forward(XrlSender&     sender,
00977          const string&      xrl_target,
00978          const IfMgrXrlSendCB&  xscb) const;
00979 
00980     string str() const;
00981 
00982 protected:
00983     bool    _multicast_capable;
00984 };
00985 
00989 class IfMgrIPv6SetLoopback : public IfMgrIPv6CommandBase {
00990 public:
00991     IfMgrIPv6SetLoopback(const string&  ifname,
00992              const string&  vifname,
00993              const IPv6&    addr,
00994              bool       loopback)
00995     : IfMgrIPv6CommandBase(ifname, vifname, addr),
00996       _loopback(loopback)
00997     {}
00998 
00999     bool loopback() const           { return _loopback; }
01000 
01001     bool execute(IfMgrIfTree& tree) const;
01002 
01003     bool forward(XrlSender&     sender,
01004          const string&      xrl_target,
01005          const IfMgrXrlSendCB&  xscb) const;
01006 
01007     string str() const;
01008 
01009 protected:
01010     bool    _loopback;
01011 };
01012 
01017 class IfMgrIPv6SetEndpoint : public IfMgrIPv6CommandBase {
01018 public:
01019     IfMgrIPv6SetEndpoint(const string&  ifname,
01020              const string&  vifname,
01021              const IPv6&    addr,
01022              const IPv6&    endpoint_addr)
01023     : IfMgrIPv6CommandBase(ifname, vifname, addr),
01024       _endpoint_addr(endpoint_addr)
01025     {}
01026 
01027     const IPv6& endpoint_addr() const   { return _endpoint_addr; }
01028 
01029     bool execute(IfMgrIfTree& tree) const;
01030 
01031     bool forward(XrlSender&     sender,
01032          const string&      xrl_target,
01033          const IfMgrXrlSendCB&  xscb) const;
01034 
01035     string str() const;
01036 
01037 protected:
01038     IPv6    _endpoint_addr;
01039 };
01040 #endif
01041 
01042 
01049 class IfMgrHintCommandBase : public IfMgrCommandBase {
01050 public:
01057     bool execute(IfMgrIfTree& tree) const;
01058 };
01059 
01063 class IfMgrHintTreeComplete : public IfMgrHintCommandBase {
01064 public:
01065     bool forward(XrlSender&     sender,
01066          const string&      xrl_target,
01067          const IfMgrXrlSendCB&  xscb) const;
01068     string str() const;
01069 };
01070 
01075 class IfMgrHintUpdatesMade : public IfMgrHintCommandBase {
01076 public:
01077     bool forward(XrlSender&     sender,
01078          const string&      xrl_target,
01079          const IfMgrXrlSendCB&  xscb) const;
01080     string str() const;
01081 };
01082 
01083 #endif // __LIBFEACLIENT_IFMGR_CMDS_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations