Scroll to navigation

libknet.h(3) Kronosnet Programmer's Manual libknet.h(3)

NAME

libknet.h - kronosnet API include file

SYNOPSIS

#include <libknet.h>

DESCRIPTION

Kronosnet is an advanced VPN system for High Availability applications.


int           knet_addrtostr(const struct sockaddr_storage *, socklen_t, char *, size_t, char *, size_t);
int           knet_get_compress_list(struct knet_compress_info *, size_t *);
int           knet_get_crypto_list(struct knet_crypto_info *, size_t *);
uint8_t       knet_get_transport_id_by_name(const char *);
int           knet_get_transport_list(struct knet_transport_info *, size_t *);
const char   *knet_get_transport_name_by_id(uint8_t);
int           knet_handle_add_datafd(knet_handle_t, int *, int8_t *);
int           knet_handle_clear_stats(knet_handle_t, int);
int           knet_handle_compress(knet_handle_t, struct knet_handle_compress_cfg *);
int           knet_handle_crypto(knet_handle_t, struct knet_handle_crypto_cfg *);
int           knet_handle_enable_filter(knet_handle_t, void *, int(*)(void *private_data, const unsigned char *outdata, ssize_t outdata_len, uint8_t tx_rx, knet_node_id_t this_host_id, knet_node_id_t src_host_id, int8_t *channel, knet_node_id_t *dst_host_ids, size_t *dst_host_ids_entries));
int           knet_handle_enable_pmtud_notify(knet_handle_t, void *, void(*)(void *private_data, unsigned int data_mtu));
int           knet_handle_enable_sock_notify(knet_handle_t, void *, void(*)(void *private_data, int datafd, int8_t channel, uint8_t tx_rx, int error, int errorno));
int           knet_handle_free(knet_handle_t);
int           knet_handle_get_channel(knet_handle_t, const int, int8_t *);
int           knet_handle_get_datafd(knet_handle_t, const int8_t, int *);
int           knet_handle_get_stats(knet_handle_t, struct knet_handle_stats *, size_t);
int           knet_handle_get_transport_reconnect_interval(knet_handle_t, uint32_t *);
knet_handle_t knet_handle_new(knet_node_id_t, int, uint8_t);
int           knet_handle_pmtud_get(knet_handle_t, unsigned int *);
int           knet_handle_pmtud_getfreq(knet_handle_t, unsigned int *);
int           knet_handle_pmtud_setfreq(knet_handle_t, unsigned int);
int           knet_handle_remove_datafd(knet_handle_t, int);
int           knet_handle_set_transport_reconnect_interval(knet_handle_t, uint32_t);
int           knet_handle_setfwd(knet_handle_t, unsigned int);
int           knet_host_add(knet_handle_t, knet_node_id_t);
int           knet_host_enable_status_change_notify(knet_handle_t, void *, void(*)(void *private_data, knet_node_id_t host_id, uint8_t reachable, uint8_t remote, uint8_t external));
int           knet_host_get_host_list(knet_handle_t, knet_node_id_t *, size_t *);
int           knet_host_get_id_by_host_name(knet_handle_t, const char *, knet_node_id_t *);
int           knet_host_get_name_by_host_id(knet_handle_t, knet_node_id_t, char *);
int           knet_host_get_policy(knet_handle_t, knet_node_id_t, uint8_t *);
int           knet_host_get_status(knet_handle_t, knet_node_id_t, struct knet_host_status *);
int           knet_host_remove(knet_handle_t, knet_node_id_t);
int           knet_host_set_name(knet_handle_t, knet_node_id_t, const char *);
int           knet_host_set_policy(knet_handle_t, knet_node_id_t, uint8_t);
int           knet_link_clear_config(knet_handle_t, knet_node_id_t, uint8_t);
int           knet_link_get_config(knet_handle_t, knet_node_id_t, uint8_t, uint8_t *, struct sockaddr_storage *, struct sockaddr_storage *, uint8_t *, uint64_t *);
int           knet_link_get_enable(knet_handle_t, knet_node_id_t, uint8_t, unsigned int *);
int           knet_link_get_link_list(knet_handle_t, knet_node_id_t, uint8_t *, size_t *);
int           knet_link_get_ping_timers(knet_handle_t, knet_node_id_t, uint8_t, time_t *, time_t *, unsigned int *);
int           knet_link_get_pong_count(knet_handle_t, knet_node_id_t, uint8_t, uint8_t *);
int           knet_link_get_priority(knet_handle_t, knet_node_id_t, uint8_t, uint8_t *);
int           knet_link_get_status(knet_handle_t, knet_node_id_t, uint8_t, struct knet_link_status *, size_t);
int           knet_link_set_config(knet_handle_t, knet_node_id_t, uint8_t, uint8_t, struct sockaddr_storage *, struct sockaddr_storage *, uint64_t);
int           knet_link_set_enable(knet_handle_t, knet_node_id_t, uint8_t, unsigned int);
int           knet_link_set_ping_timers(knet_handle_t, knet_node_id_t, uint8_t, time_t, time_t, unsigned int);
int           knet_link_set_pong_count(knet_handle_t, knet_node_id_t, uint8_t, uint8_t);
int           knet_link_set_priority(knet_handle_t, knet_node_id_t, uint8_t, uint8_t);
int           knet_log_get_loglevel(knet_handle_t, uint8_t, uint8_t *);
uint8_t       knet_log_get_loglevel_id(const char *);
const char   *knet_log_get_loglevel_name(uint8_t);
uint8_t       knet_log_get_subsystem_id(const char *);
const char   *knet_log_get_subsystem_name(uint8_t);
int           knet_log_set_loglevel(knet_handle_t, uint8_t, uint8_t);
ssize_t       knet_recv(knet_handle_t, char *, const size_t, const int8_t);
ssize_t       knet_send(knet_handle_t, const char *, const size_t, const int8_t);
int           knet_send_sync(knet_handle_t, const char *, const size_t, const int8_t);
int           knet_strtoaddr(const char *, const char *, struct sockaddr_storage *, socklen_t);


struct knet_handle_crypto_cfg {

char crypto_model;
char crypto_cipher_type;
char crypto_hash_type;
unsigned char private_key;
unsigned int private_key_len; };


struct knet_transport_info {

const char *name;
uint8_t id;
uint8_t properties;
char pad; };


struct knet_crypto_info {

const char *name;
uint8_t properties;
char pad; };


struct knet_handle_compress_cfg {

char compress_model;
uint32_t compress_threshold;
int compress_level; };


struct knet_compress_info {

const char *name;
uint8_t properties;
char pad; };


struct knet_host_status {

uint8_t reachable;
uint8_t remote;
uint8_t external; };


struct knet_link_status {

size_t size;
char src_ipaddr;
char src_port;
char dst_ipaddr;
char dst_port;
uint8_t enabled;
uint8_t connected;
uint8_t dynconnected;
unsigned long long latency;
struct timespec pong_last;
unsigned int mtu;
unsigned int proto_overhead;
struct knet_link_stats stats; };


struct knet_handle_stats {

size_t size;
uint64_t tx_uncompressed_packets;
uint64_t tx_compressed_packets;
uint64_t tx_compressed_original_bytes;
uint64_t tx_compressed_size_bytes;
uint64_t tx_compress_time_ave;
uint64_t tx_compress_time_min;
uint64_t tx_compress_time_max;
uint64_t rx_compressed_packets;
uint64_t rx_compressed_original_bytes;
uint64_t rx_compressed_size_bytes;
uint64_t rx_compress_time_ave;
uint64_t rx_compress_time_min;
uint64_t rx_compress_time_max;
uint64_t tx_crypt_packets;
uint64_t tx_crypt_byte_overhead;
uint64_t tx_crypt_time_ave;
uint64_t tx_crypt_time_min;
uint64_t tx_crypt_time_max;
uint64_t rx_crypt_packets;
uint64_t rx_crypt_time_ave;
uint64_t rx_crypt_time_min;
uint64_t rx_crypt_time_max; };

SEE ALSO

knet_addrtostr(3), knet_get_compress_list(3), knet_get_crypto_list(3), knet_get_transport_id_by_name(3), knet_get_transport_list(3), knet_get_transport_name_by_id(3), knet_handle_add_datafd(3), knet_handle_clear_stats(3), knet_handle_compress(3), knet_handle_crypto(3), knet_handle_enable_filter(3), knet_handle_enable_pmtud_notify(3), knet_handle_enable_sock_notify(3), knet_handle_free(3), knet_handle_get_channel(3), knet_handle_get_datafd(3), knet_handle_get_stats(3), knet_handle_get_transport_reconnect_interval(3), knet_handle_new(3), knet_handle_pmtud_get(3), knet_handle_pmtud_getfreq(3), knet_handle_pmtud_setfreq(3), knet_handle_remove_datafd(3), knet_handle_set_transport_reconnect_interval(3), knet_handle_setfwd(3), knet_host_add(3), knet_host_enable_status_change_notify(3), knet_host_get_host_list(3), knet_host_get_id_by_host_name(3), knet_host_get_name_by_host_id(3), knet_host_get_policy(3), knet_host_get_status(3), knet_host_remove(3), knet_host_set_name(3), knet_host_set_policy(3), knet_link_clear_config(3), knet_link_get_config(3), knet_link_get_enable(3), knet_link_get_link_list(3), knet_link_get_ping_timers(3), knet_link_get_pong_count(3), knet_link_get_priority(3), knet_link_get_status(3), knet_link_set_config(3), knet_link_set_enable(3), knet_link_set_ping_timers(3), knet_link_set_pong_count(3), knet_link_set_priority(3), knet_log_get_loglevel(3), knet_log_get_loglevel_id(3), knet_log_get_loglevel_name(3), knet_log_get_subsystem_id(3), knet_log_get_subsystem_name(3), knet_log_set_loglevel(3), knet_recv(3), knet_send(3), knet_send_sync(3), knet_strtoaddr(3)

COPYRIGHT

Copyright (C) 2010-2017 Red Hat, Inc. All rights reserved.

2017-11-23 kronosnet