41 #ifndef _DWMMPLSLABEL_HH_ 42 #define _DWMMPLSLABEL_HH_ 76 uint32_t
Label()
const;
81 uint32_t
Label(uint32_t label);
91 uint8_t
Exp(uint8_t exp);
111 uint8_t
Ttl(uint8_t ttl);
121 std::istream &
Read(std::istream & is);
126 std::ostream &
Write(std::ostream & os)
const;
132 ssize_t
Read(
int fd);
138 ssize_t
Write(
int fd)
const;
144 size_t Read(FILE *f);
150 size_t Write(FILE *f)
const;
156 int Read(gzFile gzf);
162 int Write(gzFile gzf)
const;
174 int BZWrite(BZFILE *bzf)
const;
185 friend std::ostream &
191 friend std::istream &
200 #endif // _DWMMPLSLABEL_HH_ uint32_t Label() const
Returns the 20-bit label portion of the label.
friend std::istream & operator>>(std::istream &is, MplsLabel &label)
Reads from an istream in 'label:exp:s:ttl' format.
This class is a pure virtual class, defining an interface for classes that can write their contents t...
Definition: DwmGZWritable.hh:57
Dwm::Writable pure virtual class definition.
Dwm::BZ2Readable pure virtual class definition.
friend std::ostream & operator<<(std::ostream &os, const MplsLabel &label)
Prints to an ostream in 'label:exp:s:ttl' format.
Dwm::GZReadable pure virtual class definition.
Dwm::Readable pure virtual class definition.
std::ostream & Write(std::ostream &os) const
Writes the MPLS label to an ostream. Returns the ostream.
Encapsulates an MPLS label.
Definition: DwmMplsLabel.hh:57
This class is a pure virtual class, defining an interface for classes that can read their contents fr...
Definition: DwmBZ2Readable.hh:57
uint8_t Ttl() const
Returns the TTL portion of the label.
MplsLabel()
Constructor. Sets all label bits to 0.
int BZWrite(BZFILE *bzf) const
Writes the MPLS lable to the given BZFILE bzf.
Dwm::BZ2Writable pure virtual class definition.
Definition: DwmBZ2IO.hh:67
bool S() const
Returns true if the S (bottom-of-stack) bit is set.
bool operator==(const MplsLabel &label) const
operator ==
This class is a pure virtual class, defining an interface for classes that can read their contents fr...
Definition: DwmGZReadable.hh:57
std::istream & Read(std::istream &is)
Reads the MPLS label from an istream. Returns the istream.
This class defines an interface for classes that can write their contents to an ostream, file descriptor or FILE pointer.
Definition: DwmWritable.hh:58
int BZRead(BZFILE *bzf)
Reads the MPLS label from the given BZFILE bzf.
This class is a pure virtual class, defining an interface for classes that can write their contents t...
Definition: DwmBZ2Writable.hh:57
Dwm::GZWritable pure virtual class definition.
This class defines an interface for classes that can read their contents from an istream, file descriptor or FILE pointer.
Definition: DwmReadable.hh:58
uint32_t StreamedLength() const
Returns the number of bytes that should be written if we call one of the Write() members.
uint8_t Exp() const
Returns the 3-bit exp portion of the label.