inline int arg_count ()
| arg_count |
#include <c_format.hh>
template <class A>
inline int arg_count (A)
| arg_count |
#include <c_format.hh>
template <class A, class B>
inline int arg_count (A,B)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C>
inline int arg_count (A,B,C)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C, class D>
inline int arg_count (A,B,C,D)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C, class D, class E>
inline int arg_count (A,B,C,D,E)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C,class D, class E, class F>
inline int arg_count (A,B,C,D,E,F)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C, class D, class E, class F, class G>
inline int arg_count (A,B,C,D,E,F,G)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C, class D, class E, class F, class G,
class H>
inline int arg_count (A,B,C,D,E,F,G,H)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C, class D, class E, class F, class G,
class H, class I>
inline int arg_count (A,B,C,D,E,F,G,H,I)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C, class D, class E, class F, class G,
class H, class I, class J>
inline int arg_count (A,B,C,D,E,F,G,H,I,J)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C, class D, class E, class F, class G,
class H, class I, class J, class K>
inline int arg_count (A,B,C,D,E,F,G,H,I,J,K)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C, class D, class E, class F, class G,
class H, class I, class J, class K, class L>
inline int arg_count (A,B,C,D,E,F,G,H,I,J,K,L)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C, class D, class E, class F, class G,
class H, class I, class J, class K, class L, class M>
inline int arg_count (A,B,C,D,E,F,G,H,I,J,K,L,M)
| arg_count |
#include <c_format.hh>
template <class A, class B, class C, class D, class E, class F, class G,
class H, class I, class J, class K, class L, class M, class N>
inline int arg_count (A,B,C,D,E,F,G,H,I,J,K,L,M,N)
| arg_count |
#include <c_format.hh>
void c_format_validate (const char* fmt, int n)
| c_format_validate |
#include <c_format.hh>
string do_c_format (const char* fmt, ...)
| do_c_format |
#include <c_format.hh>
inline void swallow_args (const char*)
| swallow_args |
#include <debug.h>
template <class A>
inline void swallow_args (const char*, A)
| swallow_args |
#include <debug.h>
template <class A, class B>
inline void swallow_args (const char*, A, B)
| swallow_args |
#include <debug.h>
template <class A, class B, class C>
inline void swallow_args (const char*, A, B, C)
| swallow_args |
#include <debug.h>
template <class A, class B, class C, class D>
inline void swallow_args (const char*, A, B, C, D)
| swallow_args |
#include <debug.h>
template <class A, class B, class C, class D, class E>
inline void swallow_args (const char*, A, B, C, D, E)
| swallow_args |
#include <debug.h>
template <class A, class B, class C, class D, class E, class F>
inline void swallow_args (const char*, A, B, C, D, E, F)
| swallow_args |
#include <debug.h>
template <class A, class B, class C, class D, class E, class F, class G>
inline void swallow_args (const char*, A, B, C, D, E, F, G)
| swallow_args |
#include <debug.h>
template <class A, class B, class C, class D, class E, class F, class G, class H>
inline void swallow_args (const char*, A, B, C, D, E, F, G, H)
| swallow_args |
#include <debug.h>
inline void
check_args (const char*, ...)
| check_args |
#include <debug.h>
struct ether_addr* ether_aton (const char *a)
| ether_aton |
#include <ether_compat.h>
char* ether_ntoa (const struct ether_addr* ea)
| ether_ntoa |
#include <ether_compat.h>
void xorp_catch_standard_exceptions ()
| xorp_catch_standard_exceptions |
#include <exceptions.hh>
Print diagnostic message if exception is derived from XorpException or from standard exceptions, and terminate the program.
void xorp_print_standard_exceptions ()
| xorp_print_standard_exceptions |
#include <exceptions.hh>
Print diagnostic message if exception is derived from XorpException or from standard exceptions.
Note that unlike xorp_catch_standard_exceptions(), the program does NOT terminate.
void xorp_unexpected_handler ()
| xorp_unexpected_handler |
#include <exceptions.hh>
Unexpected exceptions are programming errors and this handler can be installed with XorpUnexpectedHandler to print out as much information as possible. The default behaviour is just to dump core, but it very hard to detect what happened.
template <class A> uint32_t
overlap (const IPNet<A>& a1, const IPNet<A>& a2)
| overlap |
#include <ipnet.hh>
Determine the number of the most significant bits overlapping between two subnets.
Parameters:
a1 | the first subnet. |
a2 | the subnet. |
Returns: the number of bits overlapping between a1 and a2.
typedef IPNet<IPv4> IPv4Net | IPv4Net |
#include <ipv4net.hh>
typedef IPNet<IPv6> IPv6Net | IPv6Net |
#include <ipv6net.hh>
inline size_t
family2addr_size (const int family)
| family2addr_size |
#include <ipvx.hh>
inline uint32_t
family2addr_bitlen (const int family)
| family2addr_bitlen |
#include <ipvx.hh>
typedef IPNet<IPvX> BaseIPvXNet | BaseIPvXNet |
#include <ipvxnet.hh>
Base IPvXNet just has IPNet methods. IPvXNet is derived from BaseIPvXNet and has IPvX specific functions such as whether contained type is an IPv4 network or an IPv6 network.
See IPNet for available methods.
inline bool
operator== (const Mac& m1, const Mac& m2)
| operator== |
#include <mac.hh>
inline bool
operator== (const EtherMac& m1, const EtherMac& m2)
| operator== |
#include <mac.hh>
typedef IPNextHop<IPv4> IPv4NextHop | IPv4NextHop |
#include <nexthop.hh>
typedef IPNextHop<IPv6> IPv6NextHop | IPv6NextHop |
#include <nexthop.hh>
typedef IPNextHop<IPvX> IPvXNextHop | IPvXNextHop |
#include <nexthop.hh>
typedef IPPeerNextHop<IPv4> IPv4PeerNextHop | IPv4PeerNextHop |
#include <nexthop.hh>
typedef IPPeerNextHop<IPv6> IPv6PeerNextHop | IPv6PeerNextHop |
#include <nexthop.hh>
typedef IPPeerNextHop<IPvX> IPvXPeerNextHop | IPvXPeerNextHop |
#include <nexthop.hh>
typedef IPEncapsNextHop<IPv4> IPv4EncapsNextHop | IPv4EncapsNextHop |
#include <nexthop.hh>
typedef IPEncapsNextHop<IPv6> IPv6EncapsNextHop | IPv6EncapsNextHop |
#include <nexthop.hh>
typedef IPEncapsNextHop<IPvX> IPvXEncapsNextHop | IPvXEncapsNextHop |
#include <nexthop.hh>
typedef IPExternalNextHop<IPv4> IPv4ExternalNextHop | IPv4ExternalNextHop |
#include <nexthop.hh>
typedef IPExternalNextHop<IPv6> IPv6ExternalNextHop | IPv6ExternalNextHop |
#include <nexthop.hh>
typedef IPExternalNextHop<IPvX> IPvXExternalNextHop | IPvXExternalNextHop |
#include <nexthop.hh>
enum SelectorMask { SEL_RD = 0x01, SEL_WR = 0x02, SEL_EX = 0x04, SEL_ALL = SEL_RD | SEL_WR | SEL_EX } | SelectorMask |
#include <selector.hh>
typedef XorpCallback2<void,int,SelectorMask>::RefPtr SelectorCallback | SelectorCallback |
#include <selector.hh>
typedef ref_ptr<SelectorTag> Selector | Selector |
#include <selector.hh>
enum ServiceStatus { READY = 0x001, STARTING = 0x002, RUNNING = 0x004, PAUSING = 0x008, PAUSED = 0x010, RESUMING = 0x020, SHUTTING_DOWN = 0x040, SHUTDOWN = 0x080, FAILED = 0x100, ALL = READY | STARTING | RUNNING | PAUSING | PAUSED | RESUMING | SHUTTING_DOWN | SHUTDOWN | FAILED } | ServiceStatus |
#include <service.hh>
Enumeration of states objects derived from ServiceBase may be in.
const char* service_status_name (ServiceStatus s)
| service_status_name |
#include <service.hh>
Get text description of enumerated service status.
Parameters:
s | service status to recover name for. |
typedef enum -- | -- |
#include <status_codes.h>
Explanation of Process States ----------------------------- +-------------> PROC_NULL | | | | (1) | V | PROC_STARTUP | | | | (2) | V | PROC_NOT_READY | | ^ |(9) (3) | | (4) | V | | PROC_READY | / \ | (5)/ \(6) | V V | PROC_SHUTDOWN PROC_FAILED | \ / | (7)\ /(8) | \ / | V V | PROC_DONE | | | | | | | V +-------------------+ Events/Actions -------------- (1) Register with finder. (2) External dependencies satisfied, ready to be configured. (3) Finished processing any config changes, ready for other processes that depend on this process to be configured. (4) Received a config change that needs to be processed before other processes that depend on this process are configured. (5) Received a request for a clean shutdown. (6) Something failed, this process is no longer functioning correctly. (7) The shutdown has completed. (8) The process has completed the cleanup after the failure. (9) Deregister with finder. States ------ PROC_NULL Process is not registered with finder. It may or may not be running. PROC_STARTUP Process is registered with finder, but is waiting on some other processes before it is ready to be configured. PROC_NOT_READY For any reason, the process is not ready for processes that depend on this process to be configured or reconfigured. A common reason is that this process just received a config change, and is still in the process of making the config change active. PROC_READY Process is running normally. Processes that depend on the state of this process can be configured or reconfigured. PROC_SHUTDOWN Process has received a shutdown request is shutting down cleanly. Normally the process will terminate by itself after being in this state. PROC_FAILED Process has suffered a fatal error, and is in the process of cleaning up the mess. Normally the process will terminate by itself after being in this state. PROC_DONE The process has completed operation, but is still capable of responding to XRLs. Notes ----- A process may spend zero time in PROC_STARTUP, PROC_NOT_READY, PROC_READY, PROC_SHUTDOWN, PROC_FAILED, or PROC_DONE states. For example, a process may effectively go directly from PROC_NULL to PROC_READY state on startup if there are no dependencies that need to be taken into account. A process may go from PROC_STARTUP or PROC_NOT_READY states to PROC_SHUTDOWN or PROC_FAILED states without spending any time in PROC_READY state if required. On reconfiguration, a process does not need to go to NOT_READY state unless it needs to delay the reconfiguration of processes that depend on the completion of this reconfiguration. After shutdown or a failure, the process may remain indefinitely in PROC_DONE state (e.g., if the process itself shoudn't really exit but rather await further instructions).
enum -- { PROC_NULL = 0, PROC_STARTUP = 1, PROC_NOT_READY = 2, PROC_READY = 3, PROC_SHUTDOWN = 4, PROC_FAILED = 5, PROC_DONE = 6 } | -- |
#include <status_codes.h>
typedef XorpCallback0<void>::RefPtr OneoffTimerCallback | OneoffTimerCallback |
#include <timer.hh>
typedef XorpCallback0<bool>::RefPtr PeriodicTimerCallback | PeriodicTimerCallback |
#include <timer.hh>
typedef XorpCallback1<void, XorpTimer&>::RefPtr BasicTimerCallback | BasicTimerCallback |
#include <timer.hh>
typedef void (*query_current_time) (TimeVal*) | (*query_current_time) |
#include <timer.hh>
inline TimeVal
operator- (const TimeVal& v)
| operator- |
#include <timeval.hh>
inline TimeVal
operator* (int n, const TimeVal& t)
| operator* |
#include <timeval.hh>
inline TimeVal
operator* (const double& d, const TimeVal& t)
| operator* |
#include <timeval.hh>
inline TimeVal
random_uniform (const TimeVal& lower, const TimeVal& upper)
| random_uniform |
#include <timeval.hh>
Generate a TimeVal value from a uniform random distribution between specified bounds.
Parameters:
lower | lower bound of generated value. |
upper | upper bound of generated value. |
Returns: value chosen from uniform random distribution.
inline TimeVal
random_uniform (const TimeVal& upper)
| random_uniform |
#include <timeval.hh>
Generate a TimeVal value from a uniform random distribution between zero and specified bound.
Parameters:
upper | upper bound of generated value. |
Returns: value chosen from uniform random distribution.
inline TimeVal
positive_random_uniform (const TimeVal& center, const double& factor)
| positive_random_uniform |
#include <timeval.hh>
Generate a TimeVal value from a uniform random distribution between the bounds center - factor * center and center + factor * center. If the lower bound is less than TimeVal::ZERO() it is rounded up to TimeVal::ZERO().
Parameters:
center | mid-point of generated time value. |
factor | the spread of the uniform random distribution. |
Returns: value chosen from uniform random distribution.
string copy_token (const string& token_org)
| copy_token |
#include <token.hh>
Copy a token.
If the token contains token separators, enclose it within quotations.
Parameters:
token_org | the token to copy. |
Returns: the copy of the token with token separators enclosed within quotations.
string pop_token (string& token_line)
| pop_token |
#include <token.hh>
Pop a token from a token line.
Parameters:
token_line | the token line to pop a token from. |
Returns: the first token from the front of the line. Also, token_line is modified to exlude that token.
bool is_token_separator (const char c)
| is_token_separator |
#include <token.hh>
Test if a character is a token separator.
Currently, the is_space(3) characters and '|' are considered as token separators.
Parameters:
c | the character to test whether it is token separator. |
Returns: true if c is a token separator, otherwise false.
bool has_more_tokens (const string& token_line)
| has_more_tokens |
#include <token.hh>
Test if a token line contains more tokens.
Parameters:
token_line | the token line to test. |
Returns: true if token_line contains more tokens, otherwise false.
string char_line2token_line (const char *char_line)
| char_line2token_line |
#include <token.hh>
Create a copy of a token line.
Create a copy of a token line, but all tokens with a single space between.
Parameters:
char_line | C-style token line to copy. |
Returns: C++ string copy of char_line, but with all tokens inside with a single space between.
extern int xorp_isalnum (int c)
| xorp_isalnum |
#include <utility.h>
extern int xorp_isalpha (int c)
| xorp_isalpha |
#include <utility.h>
extern int xorp_iscntrl (int c)
| xorp_iscntrl |
#include <utility.h>
extern int xorp_isdigit (int c)
| xorp_isdigit |
#include <utility.h>
extern int xorp_isgraph (int c)
| xorp_isgraph |
#include <utility.h>
extern int xorp_islower (int c)
| xorp_islower |
#include <utility.h>
extern int xorp_isprint (int c)
| xorp_isprint |
#include <utility.h>
extern int xorp_ispunct (int c)
| xorp_ispunct |
#include <utility.h>
extern int xorp_isspace (int c)
| xorp_isspace |
#include <utility.h>
extern int xorp_isupper (int c)
| xorp_isupper |
#include <utility.h>
extern int xorp_isxdigit (int c)
| xorp_isxdigit |
#include <utility.h>
extern int xorp_tolower (int c)
| xorp_tolower |
#include <utility.h>
extern int xorp_toupper (int c)
| xorp_toupper |
#include <utility.h>
template<class T> void
delete_pointers_list (list<T *>& delete_list)
| delete_pointers_list |
#include <utils.hh>
Template to delete a list of pointers, and the objects pointed to.
Parameters:
delete_list | the list of pointers to objects to delete. |
template<class T> void
delete_pointers_vector (vector<T *>& delete_vector)
| delete_pointers_vector |
#include <utils.hh>
Template to delete an array of pointers, and the objects pointed to.
Parameters:
delete_vector | the vector of pointers to objects to delete. |
typedef enum -- | -- |
#include <xlog.h>
The log levels. Typically used only by xlog_enable() and xlog_disable()
enum -- { XLOG_LEVEL_FATAL = 0, XLOG_LEVEL_ERROR, XLOG_LEVEL_WARNING, XLOG_LEVEL_INFO, XLOG_LEVEL_TRACE, XLOG_LEVEL_MAX } | -- |
#include <xlog.h>
typedef enum -- | -- |
#include <xlog.h>
The messages verbose level. Typically used only by xlog_set_verbose() and xlog_level_set_verbose()
enum -- { XLOG_VERBOSE_LOW = 0, XLOG_VERBOSE_MEDIUM, XLOG_VERBOSE_HIGH, XLOG_VERBOSE_MAX } | -- |
#include <xlog.h>
typedef int (*xlog_output_func_t) (void *obj, const char *msg) | (*xlog_output_func_t) |
#include <xlog.h>
The type of add-on functions to process the log messages.
int xlog_init (const char *argv0, const char *preamble_message)
| xlog_init |
#include <xlog.h>
Initialize the log utility.
As part of the initialization, the preamble string will be set to <process_name><preamble_message> Use in preference to xlog_set_preamble which will be removed.
Parameters:
argv0 | the path of the process executable from which the program name will be extract to become part of the preamble string. |
preamble_message | a string that will become part of the preamble string. |
Returns: 0 on success, otherwise -1.
int xlog_exit (void)
| xlog_exit |
#include <xlog.h>
Gracefully exit logging.
Returns: 0 on success, otherwise -1.
int xlog_start (void)
| xlog_start |
#include <xlog.h>
Start logging.
Returns: 0 on success, otherwise -1.
int xlog_stop (void)
| xlog_stop |
#include <xlog.h>
Stop logging.
Returns: 0 on success, otherwise -1.
int xlog_is_running (void)
| xlog_is_running |
#include <xlog.h>
Check if xlog is running.
Returns: non-zero if xlog is running, otherwise 0.
int xlog_enable (xlog_level_t log_level)
| xlog_enable |
#include <xlog.h>
Enable logging for messages of a given type (log_level_t).
By default, all message types are enabled.
Parameters:
log_level | the message type xlog_level_t (e.g., XLOG_LEVEL_WARNING) to enable the logging for. |
Returns: 0 on success, otherwise -1.
int xlog_disable (xlog_level_t log_level)
| xlog_disable |
#include <xlog.h>
Disable logging for messages of a given type (log_level_t).
Note: XLOG_LEVEL_FATAL cannot be disabled.
Parameters:
log_level | the message type xlog_level_t (e.g., XLOG_LEVEL_WARNING) to disable the logging for. |
Returns: 0 on success, otherwise -1.
void xlog_set_preamble (const char *text)
| xlog_set_preamble |
#include <xlog.h>
Set the preamble string for the log entries.
Parameters:
text | the preamble string, or NULL if no preamble. |
const char* xlog_process_name (void)
| xlog_process_name |
#include <xlog.h>
Get process name as set with xlog_init.
Returns: pointer to name on success, NULL otherwise.
void xlog_set_verbose (xlog_verbose_t verbose_level)
| xlog_set_verbose |
#include <xlog.h>
Set the level of verbosity (xlog_verbose_t) for the log entries.
Applies for all type of messages except for XLOG_LEVEL_FATAL which always is set to the most verbose level.
Parameters:
verbose_level | the level of verbosity xlog_verbose_t (higher is more verbose). |
void xlog_level_set_verbose (xlog_level_t log_level,
xlog_verbose_t verbose_level)
| xlog_level_set_verbose |
#include <xlog.h>
Set the level of verbosity (xlog_verbose_t) for the log entries of messages of a given type (xlog_level_t).
Note: XLOG_LEVEL_FATAL verbosity cannot be changed, and is always set to the most verbose level.
Parameters:
log_level | the message type xlog_level_t to set the verbosity of. |
verbose_level | the level of verbosity xlog_verbose_t (higher is more verbose). |
int xlog_add_output (FILE *fp)
| xlog_add_output |
#include <xlog.h>
Add a file descriptor to the set of output streams.
Parameters:
fp | the file descriptor to add to the set of output streams. |
Returns: 0 on success, otherwise -1.
int xlog_remove_output (FILE *fp)
| xlog_remove_output |
#include <xlog.h>
Remove a file descriptor from the set of output streams.
Parameters:
fp | the file descriptor to remove from the set of output streams. |
Returns: 0 on success, otherwise -1.
int xlog_add_output_func (xlog_output_func_t func, void *obj)
| xlog_add_output_func |
#include <xlog.h>
Add a processing function and an object to the set of output streams.
Parameters:
func | the function to add to the set of output streams. |
obj | the object to supply func with when called. |
Returns: 0 on success, otherwise -1.
int xlog_remove_output_func (xlog_output_func_t func, void *obj)
| xlog_remove_output_func |
#include <xlog.h>
Remove a processing function and an object from the set of output streams.
Parameters:
func | the function to remove from the set of output streams. |
obj | the object that func was supplied with. |
Returns: 0 on success, otherwise -1.
int xlog_add_default_output (void)
| xlog_add_default_output |
#include <xlog.h>
Add default output stream to list of output streams.
XXX: right now the default is '/dev/stderr', but it should eventually be: `/dev/console' if the process has sufficient permissions, and `/dev/stderr' otherwise.
Returns: 0 on success, otherwise -1.
int xlog_remove_default_output (void)
| xlog_remove_default_output |
#include <xlog.h>
Remove the default output stream from the set of output streams.
Returns: 0 on success, otherwise -1.
void _xcond_trace_entry (const char *module_name, const char *file,
int line, const char *fn)
| _xcond_trace_entry |
#include <xlog.h>
A marker that can be used to indicate code that is not yet implemented and hence should not be run.
Note that it cannot be conditionally disabled and logs error through the standard XLOG mechanism. Always calls XLOG_FATAL.
const char * xlog_localtime2string (void)
| xlog_localtime2string |
#include <xlog.h>
Compute the current local time and return it as a string.
The return string has the format: Year/Month/Day Hour:Minute:Second.Microsecond Example: 2002/02/05 20:22:09.808632 Note that the returned string uses statically allocated memory, and does not need to be de-allocated.
Returns: a statically allocated string with the local time using the format described above.
int x_vasprintf (char **ret, const char *format, va_list ap)
| x_vasprintf |
#include <xlog.h>
A local implementation of vasprintf(3).
If vasprintf(3) is available, it is called instead.
Parameters:
ret | a pointer to the string pointer to store the result. |
format | the printf(3)-style format. |
ap | the variable arguments for format. |
Returns: (From FreeBSD vasprintf(3) manual page): The number of characters printed (not including the trailing '\0' used to end output to strings). Also, set the value pointed to by ret to be a pointer to a buffer sufficiently large to hold the formatted string. This pointer should be passed to free(3) to release the allocated storage when it is no longer needed. If sufficient space cannot be allocated, will return -1 and set ret to be a NULL pointer.
int x_asprintf (char **ret, const char *format, ...)
| x_asprintf |
#include <xlog.h>
A local implementation of asprintf(3).
Parameters:
ret | a pointer to the string pointer to store the result. |
format | the printf(3)-style format. @param ... the variable arguments for format. |
Returns: (From FreeBSD asprintf(3) manual page): The number of characters printed (not including the trailing '\0' used to end output to strings). Also, set ret to be a pointer to a buffer sufficiently large to hold the formatted string. This pointer should be passed to free(3) to release the allocated storage when it is no longer needed. If sufficient space cannot be allocated, will return -1 and set ret to be a NULL pointer.
typedef enum -- | -- |
#include <xorp.h>
enum -- { true = TRUE, false = FALSE } | -- |
#include <xorp.h>
typedef bool bool_t | bool_t |
#include <xorp.h>