MPLSPacket.cc

Go to the documentation of this file.
00001 //
00002 // (C) 2005 Vojtech Janota
00003 // (C) 2003 Xuan Thang Nguyen
00004 //
00005 // This library is free software, you can redistribute it
00006 // and/or modify
00007 // it under  the terms of the GNU Lesser General Public License
00008 // as published by the Free Software Foundation;
00009 // either version 2 of the License, or any later version.
00010 // The library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00013 // See the GNU Lesser General Public License for more details.
00014 //
00015 
00016 
00017 #include <omnetpp.h>
00018 #include "MPLSPacket.h"
00019 
00020 // constructors
00021 MPLSPacket::MPLSPacket(const char *name) : cPacket(name)
00022 {
00023 }
00024 
00025 MPLSPacket::MPLSPacket(const MPLSPacket & p)
00026 {
00027     setName(p.getName());
00028     operator=(p);
00029 }
00030 
00031 // assignment operator
00032 MPLSPacket & MPLSPacket::operator=(const MPLSPacket & p)
00033 {
00034     cPacket::operator=(p);
00035     labels = p.labels;
00036     return *this;
00037 }
00038 
00039 std::string MPLSPacket::info() const
00040 {
00041     std::stringstream out;
00042     for (int i = (int)labels.size()-1; i >= 0; i--)
00043         out << labels[i] << (i==0?"":" ");
00044     return out.str();
00045 }
00046 
00047