xorp

Tlv Class Reference

<Type,Length,Value> Read and Write TLV records. More...

#include <tlv.hh>

List of all members.

Public Member Functions

bool open (string &fname, bool read)
 Open file for reading or writing.
bool read (uint32_t &type, vector< uint8_t > &data)
 Read a TLV entry from the file.
bool write (uint32_t type, vector< uint8_t > &data)
 Write a TLV entry to the file.
bool close ()
 Close the TLV file.
bool get32 (vector< uint8_t > &data, uint32_t offset, uint32_t &u32)
bool put32 (vector< uint8_t > &data, uint32_t offset, uint32_t u32)

Private Attributes

FILE * _fp

Detailed Description

<Type,Length,Value> Read and Write TLV records.


Member Function Documentation

bool Tlv::close ( ) [inline]

Close the TLV file.

Returns:
true on success
bool Tlv::open ( string &  fname,
bool  read 
) [inline]

Open file for reading or writing.

Parameters:
fnamefilename or '-' for stdin/stdout.
readtrue if the file is to be opened for reading, false if opened for writing.
Returns:
true on success
bool Tlv::read ( uint32_t &  type,
vector< uint8_t > &  data 
) [inline]

Read a TLV entry from the file.

Returns:
type of entry.
data read.
true on success
bool Tlv::write ( uint32_t  type,
vector< uint8_t > &  data 
) [inline]

Write a TLV entry to the file.

Returns:
type of entry.
data to be written.
true on success

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations