OLD | NEW |
(Empty) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2010 Andrey Churin |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Andrey Churin <aachurin@gmail.com> |
| 19 */ |
| 20 |
| 21 #ifndef MPLS_LIB_ENTRY_H |
| 22 #define MPLS_LIB_ENTRY_H |
| 23 |
| 24 #include <ostream> |
| 25 #include <vector> |
| 26 |
| 27 #include "ns3/simple-ref-count.h" |
| 28 |
| 29 #include "forwarding-equivalence-class.h" |
| 30 |
| 31 namespace ns3 { |
| 32 namespace mpls { |
| 33 |
| 34 class MplsLibEntry : public SimpleRefCount<MplsLibEntry> |
| 35 { |
| 36 public: |
| 37 static const uint32_t UNDEFINED = -1; |
| 38 |
| 39 enum LabelOperation |
| 40 { |
| 41 PUSH = 1, |
| 42 POP, |
| 43 SWAP |
| 44 }; |
| 45 |
| 46 MplsLibEntry (); |
| 47 virtual ~MplsLibEntry (); |
| 48 |
| 49 void SetInLabel (uint32_t label); |
| 50 uint32_t GetInLabel (void) const; |
| 51 |
| 52 void SetInIfIndex (uint32_t ifIndex); |
| 53 uint32_t GetInIfIndex (void) const; |
| 54 |
| 55 void SetOutLabel (uint32_t label); |
| 56 uint32_t GetOutLabel (void) const; |
| 57 |
| 58 void SetOutIfIndex (uint32_t ifIndex); |
| 59 uint32_t GetOutIfIndex (void) const; |
| 60 |
| 61 void SetOperation (enum LabelOperation operation); |
| 62 enum LabelOperation GetOperation (void) const; |
| 63 |
| 64 const ForwardingEquivalenceClass* GetFec (void) const; |
| 65 void SetFec (const ForwardingEquivalenceClass &fec); |
| 66 |
| 67 void Print (std::ostream &os) const; |
| 68 |
| 69 private: |
| 70 const ForwardingEquivalenceClass* m_fec; |
| 71 uint32_t m_inIfIndex; |
| 72 uint32_t m_inLabel; |
| 73 uint32_t m_outIfIndex; |
| 74 enum LabelOperation m_operation; |
| 75 uint32_t m_outLabel; |
| 76 }; |
| 77 |
| 78 std::ostream& operator<< (std::ostream& os, const MplsLibEntry &entry); |
| 79 |
| 80 } // namespace mpls |
| 81 } // namespace ns3 |
| 82 |
| 83 #endif /* MPLS_LIB_ENTRY_H */ |
OLD | NEW |