xorp

Xrl Class Reference

XORP IPC request. More...

#include <xrl.hh>

List of all members.

Public Member Functions

 Xrl (const string &protocol, const string &protocol_target, const string &command, const XrlArgs &args)
 Construct an Xrl.
 Xrl (const string &target, const string &command, const XrlArgs &args)
 Construct an Xrl (with implicit finder protocol).
 Xrl (const string &protocol, const string &protocol_target, const string &command)
 Construct an Xrl that does not have an argument list.
 Xrl (const string &target, const string &command)
 Construct an Xrl that does not have an argument list.
 Xrl (const char *target, const char *command)
 Construct an Xrl that does not have an argument list.
 Xrl (const char *xrl_c_str) throw (InvalidString)
 Construct an Xrl object from the string representation of Xrl.
 Xrl (const Xrl &xrl)
Xrloperator= (const Xrl &rhs)
string str () const
 Render Xrl as a string.
const string & protocol () const
const string & target () const
const string & string_no_args () const
const string & command () const
XrlArgsargs ()
 Retrieve list of arguments associated with the XRL.
const XrlArgsargs () const
 Retrieve list of arguments associated with the XRL.
bool operator== (const Xrl &x) const
 Test the equivalence of two XRL's.
bool is_resolved () const
size_t packed_bytes () const
 Get number of bytes needed to pack XRL into a serialized byte form.
size_t pack (uint8_t *buffer, size_t buffer_bytes) const
 Pack XRL into a byte array.
size_t unpack (const uint8_t *buffer, size_t buffer_bytes)
 Unpack XRL from serialized byte array.
void set_args (const Xrl &x) const
size_t fill (const uint8_t *buffer, size_t buffer_bytes)
bool to_finder () const
bool resolved () const
void set_resolved (bool r) const
ref_ptr< XrlPFSenderresolved_sender () const
void set_resolved_sender (ref_ptr< XrlPFSender > &s) const
void set_target (const char *target)

Static Public Member Functions

static size_t unpack_command (string &cmd, const uint8_t *in, size_t len)

Private Member Functions

const char * parse_xrl_path (const char *xrl_path)
void clear_cache ()
void copy (const Xrl &xrl)

Private Attributes

string _protocol
string _target
string _command
XrlArgs _args
string _string_no_args
XrlAtom_sna_atom
size_t _packed_bytes
XrlArgs_argp
int _to_finder
bool _resolved
ref_ptr< XrlPFSender_resolved_sender

Static Private Attributes

static const string _finder_protocol = "finder"

Detailed Description

XORP IPC request.


Member Function Documentation

const string& Xrl::command ( ) const [inline]
Returns:
the name of the command
bool Xrl::is_resolved ( ) const
Returns:
true if Xrl is resolved, ie protocol == finder.
bool Xrl::operator== ( const Xrl x) const

Test the equivalence of two XRL's.

Returns:
true if the XRL's are equivalent.
size_t Xrl::pack ( uint8_t *  buffer,
size_t  buffer_bytes 
) const

Pack XRL into a byte array.

The size of the byte array should be larger or equal to the value returned by packed_bytes().

Parameters:
bufferbuffer to receive data.
buffer_bytessize of buffer.
Returns:
size of packed data on success, 0 on failure.
const string& Xrl::protocol ( ) const [inline]
Returns:
the protocol associated with XRL.
const string & Xrl::string_no_args ( ) const [inline]
Returns:
string representation of Xrl without arguments.
const string& Xrl::target ( ) const [inline]
Returns:
the name of the XRL target entity.
size_t Xrl::unpack ( const uint8_t *  buffer,
size_t  buffer_bytes 
)

Unpack XRL from serialized byte array.

Parameters:
bufferto read data from.
buffer_bytessize of buffer. The size should exactly match number of bytes of packed data, ie packed_bytes() value used when packing.
Returns:
number of bytes turned into atoms on success, 0 on failure.

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