void hmac_md5 (const unsigned char *data, int data_bytes,
const unsigned char *key, int key_bytes,
unsigned char digest[16])
| hmac_md5 |
#include <hmac_md5.h>
Generate MD5 message digest.
Parameters:
data | data to be digested. |
data_bytes | the amount of data to be digested. |
key | to be used in making digest. |
key_bytes | the amount of key data. |
digest | the buffer to write the digested data. |
const char* hmac_md5_digest_to_ascii (unsigned char digest[16],
char* b, unsigned int b_bytes)
| hmac_md5_digest_to_ascii |
#include <hmac_md5.h>
Render an MD5 digest as an ascii string.
Parameters:
digest | digest to be rendered. |
b | buffered to write rendering to. |
b_bytes | number of bytes available buffer (at least 33 bytes). |
Returns: pointer to buffer on success, NULL if insufficient buffer space is provided.
typedef list<IPv4> IPv4Hosts | IPv4Hosts |
#include <permits.hh>
typedef list<IPv4Net> IPv4Nets | IPv4Nets |
#include <permits.hh>
typedef list<IPv6> IPv6Hosts | IPv6Hosts |
#include <permits.hh>
typedef list<IPv6Net> IPv6Nets | IPv6Nets |
#include <permits.hh>
bool add_permitted_host (const IPv4& host)
| add_permitted_host |
#include <permits.hh>
Add a host to be permitted amongst hosts allowed to participate in IPC between XORP processes.
bool add_permitted_net (const IPv4Net& net)
| add_permitted_net |
#include <permits.hh>
Add a network to be permitted amongst hosts allowed to participate in IPC between XORP processes.
bool add_permitted_host (const IPv6Net& host)
| add_permitted_host |
#include <permits.hh>
Add a host to be permitted amongst hosts allowed to participate in IPC between XORP processes.
bool add_permitted_net (const IPv6Net& net)
| add_permitted_net |
#include <permits.hh>
Add a network to be permitted amongst hosts allowed to participate in IPC between XORP processes.
bool host_is_permitted (const IPv4& host)
| host_is_permitted |
#include <permits.hh>
Test if host is permitted.
Parameters:
host | address to be test amongst permitted IPv4 hosts and nets. |
Returns: true if host is permitted.
bool host_is_permitted (const IPv6& host)
| host_is_permitted |
#include <permits.hh>
Test if host is permitted.
Parameters:
host | address to be test amongst permitted IPv6 hosts and nets. |
Returns: true if host is permitted.
const IPv4Hosts& permitted_ipv4_hosts ()
| permitted_ipv4_hosts |
#include <permits.hh>
Get list of permitted IPv4 hosts.
const IPv4Nets& permitted_ipv4_nets ()
| permitted_ipv4_nets |
#include <permits.hh>
Get list of permitted IPv4 nets.
const IPv6Hosts& permitted_ipv6_hosts ()
| permitted_ipv6_hosts |
#include <permits.hh>
Get list of permitted IPv6 hosts.
const IPv6Nets& permitted_ipv6_nets ()
| permitted_ipv6_nets |
#include <permits.hh>
Get list of permitted IPv6 nets.
void clear_permitted_ipv4_hosts ()
| clear_permitted_ipv4_hosts |
#include <permits.hh>
Clear all IPv4 host related permissions.
void clear_permitted_ipv6_hosts ()
| clear_permitted_ipv6_hosts |
#include <permits.hh>
Clear all IPv6 host related permissions.
void clear_permitted_ipv4_nets ()
| clear_permitted_ipv4_nets |
#include <permits.hh>
Clear all IPv4 net related permissions.
void clear_permitted_ipv6_nets ()
| clear_permitted_ipv6_nets |
#include <permits.hh>
Clear all IPv6 net related permissions.
enum IPSocketType { UDP = IPPROTO_UDP, TCP = IPPROTO_TCP } | IPSocketType |
#include <sockutil.hh>
int create_connected_ip_socket (IPSocketType t, const string& addr_slash_port)
| create_connected_ip_socket |
#include <sockutil.hh>
Returns: fd of socket or -1 if unsuccessful.
int create_connected_ip_socket (IPSocketType t,
const string& addr, uint16_t port)
| create_connected_ip_socket |
#include <sockutil.hh>
Returns: fd of socket or -1 if unsuccessful.
int create_listening_ip_socket (IPSocketType ist, uint16_t port = 0)
| create_listening_ip_socket |
#include <sockutil.hh>
Returns: fd of socket or -1 if unsuccessful.
void close_socket (int fd)
| close_socket |
#include <sockutil.hh>
Release state associated with socket and close it.
bool get_local_socket_details (int fd, string& addr, uint16_t& port)
| get_local_socket_details |
#include <sockutil.hh>
Returns: true if addr and port were filled in.
bool get_remote_socket_details (int fd, string& addr, uint16_t& port)
| get_remote_socket_details |
#include <sockutil.hh>
Returns: true if addr and port were filled in.
int get_socket_sndbuf_bytes (int fd)
| get_socket_sndbuf_bytes |
#include <sockutil.hh>
Get socket send buffer size.
Returns: size or -1 if size could not be read.
int get_socket_rcvbuf_bytes (int fd)
| get_socket_rcvbuf_bytes |
#include <sockutil.hh>
Get socket receive buffer size.
Returns: size or -1 if size could not be read.
int set_socket_sndbuf_bytes (int fd, uint32_t bytes)
| set_socket_sndbuf_bytes |
#include <sockutil.hh>
Set socket send buffer size.
Returns: size or -1 if size could not be set.
int set_socket_rcvbuf_bytes (int fd, uint32_t bytes)
| set_socket_rcvbuf_bytes |
#include <sockutil.hh>
Set socket receive buffer size.
Returns: size or -1 if size could not be set.
string address_slash_port (const string& addr, uint16_t port)
| address_slash_port |
#include <sockutil.hh>
Returns: address slash port
bool split_address_slash_port (const string& address_slash_port,
string& address, uint16_t& port)
| split_address_slash_port |
#include <sockutil.hh>
Returns: true if address_slash_port was split successfully.
bool address_lookup (const string& addr, in_addr& ia)
| address_lookup |
#include <sockutil.hh>
Parameters:
address | to be resolved. |
network | address. |
Returns: true if address resolves.
uint32_t if_count ()
| if_count |
#include <sockutil.hh>
Returns: number of network interfaces reported by OS.
bool if_valid (const in_addr& ia)
| if_valid |
#include <sockutil.hh>
Determine if address is an interface address on host.
Parameters:
ia | address to be checked. |
Returns: true if address is a valid interface address, false otherwise.
bool if_probe (uint32_t index, string& name, in_addr& addr, uint16_t& flags)
| if_probe |
#include <sockutil.hh>
Query interface parameters.
Parameters:
index | of interface [1..if_count()]. |
reference | to string to take interface's name. |
reference | to in_addr to take interface's IPv4 address. |
reference | to uint16_t to take interface's flags. |
Returns: true on success, false on failure.
bool if_set_preferred (in_addr addr)
| if_set_preferred |
#include <sockutil.hh>
Set preferred interface for IPC communication.
Returns: true on success, false if addr is not a valid interface address or is marked as down.
in_addr if_get_preferred ()
| if_get_preferred |
#include <sockutil.hh>
Get preferred interface for IPC communication. If not set by if_set_preferred, it is the first valid non-loopback interface. Otherwise it is the loopback interface.
typedef Xrl XrlTemplate | XrlTemplate |
#include <xrl.hh>
enum XrlAtomType { xrlatom_no_type = 0, xrlatom_int32, xrlatom_uint32, xrlatom_ipv4, xrlatom_ipv4net, xrlatom_ipv6, xrlatom_ipv6net, xrlatom_mac, xrlatom_text, xrlatom_list, xrlatom_boolean, xrlatom_binary, xrlatom_start = xrlatom_int32, xrlatom_end = xrlatom_binary } | XrlAtomType |
#include <xrl_atom.hh>
inline XrlAtomType& operator++ (XrlAtomType& t)
| operator++ |
#include <xrl_atom.hh>
const char* xrlatom_type_name (const XrlAtomType&)
| xrlatom_type_name |
#include <xrl_atom.hh>
Returns: name of atom corresponding to type.
string
xrlatom_encode_value (const char* val, size_t val_bytes)
| xrlatom_encode_value |
#include <xrl_atom_encoding.hh>
Encode the string representation of an XrlAtom value into a value suitable for integrating into a spaceless Xrl representation. This is essentially URL encoding though a reduced subset of non-alphanumeric characters are escaped, ie only those that would otherwise interfere with Xrl parsing.
inline string
xrlatom_encode_value (const string& val)
| xrlatom_encode_value |
#include <xrl_atom_encoding.hh>
Encode the string representation of an XrlAtom value into a value suitable for integrating into a spaceless Xrl representation. This is essentially URL encoding though a reduced subset of non-alphanumeric characters are escaped, ie only those that would otherwise interfere with Xrl parsing.
inline string
xrlatom_encode_value (const vector<uint8_t>& v)
| xrlatom_encode_value |
#include <xrl_atom_encoding.hh>
Encode string representation of a binary data type XrlAtom value into a value suitable for integrating into a spaceless Xrl representation.
ssize_t
xrlatom_decode_value (const char* in, size_t in_bytes, string& out)
| xrlatom_decode_value |
#include <xrl_atom_encoding.hh>
Decode escaped XrlAtom representation.
Returns: -1 on success, or the index of the character causing the decode failure in the string "in".
ssize_t
xrlatom_decode_value (const char* in, size_t in_bytes, vector<uint8_t>& out)
| xrlatom_decode_value |
#include <xrl_atom_encoding.hh>
Decode escaped XrlAtom representation of XrlAtom binary data type.
Returns: -1 on success, or the index of the character causing the decode failure in the string "in".
typedef XorpCallback2<const XrlCmdError, const XrlArgs&, XrlArgs*>::RefPtr XrlRecvCallback | XrlRecvCallback |
#include <xrl_cmd_map.hh>
enum XrlErrorCode { OKAY = 100, BAD_ARGS = 101, COMMAND_FAILED = 102, NO_FINDER = 200, RESOLVE_FAILED = 201, NO_SUCH_METHOD = 202, SEND_FAILED = 210, REPLY_TIMED_OUT = 211, SEND_FAILED_TRANSIENT = 212, INTERNAL_ERROR = 220 } | XrlErrorCode |
#include <xrl_error.hh>
inline bool operator== (const XrlError& e1, const XrlError& e2)
| operator== |
#include <xrl_error.hh>
Test for equality between a pair of XrlError instances. The test only examines the error codes associated with each instance.
inline bool operator!= (const XrlError& e1, const XrlError& e2)
| operator!= |
#include <xrl_error.hh>
Test for inequality between a pair of XrlError instances. The test only examines the error codes associated with each instance.
enum STCPPacketType { STCP_PT_HELO = 0x00, STCP_PT_REQUEST = 0x01, STCP_PT_RESPONSE = 0x02 } | STCPPacketType |
#include <xrl_pf_stcp_ph.hh>
void wait_until_xrl_router_is_ready (EventLoop& e, XrlRouter& xr)
| wait_until_xrl_router_is_ready |
#include <xrl_router.hh>
Run EventLoop until an XrlRouter is ready. If XrlRouter instance fails while waiting to become ready, a warning is logged and exit() is called.
NB This method is essentially a placeholder. A future revision to the XrlRouter API is to add ServiceBase to its parent classes. This will allow a richer set of event notification semantics. For the time being, wait_until_xrl_router_is_ready should be used in appropriate cases to ease later refactoring.
Parameters:
e | eventloop to run. |
xr | xrl_router to wait for. |