44 #include <qb/qbloop.h> 46 #define LOGSYS_UTILS_ONLY 1 54 void **transport_instance,
65 void (*iface_change_fn) (
68 unsigned int ring_no),
74 void (*target_set_completed) (
77 void *(*buffer_alloc) (void);
82 void *transport_context,
86 void *transport_context,
88 unsigned int msg_len);
91 void *transport_context,
93 unsigned int msg_len);
97 void *transport_context,
99 unsigned int msg_len);
109 void (*
net_mtu_adjust) (
void *transport_context,
struct totem_config *totem_config);
111 const char *(*iface_print) (
void *transport_context);
114 void *transport_context,
116 unsigned int *iface_count);
119 void *transport_context,
123 void *transport_context,
124 const char *cipher_type,
125 const char *hash_type);
128 void *transport_context);
131 void *transport_context,
133 unsigned short ip_port,
134 unsigned int ring_no);
137 void *transport_context,
143 void *transport_context,
148 void *transport_context,
154 struct totem_config *totem_config);
162 .
name =
"UDP/IP Multicast",
185 .name =
"UDP/IP Unicast",
237 void (*totemnet_log_printf) (
240 const char *
function,
249 #define log_printf(level, format, args...) \ 251 instance->totemnet_log_printf ( \ 253 instance->totemnet_subsys_id, \ 254 __FUNCTION__, __FILE__, __LINE__, \ 255 (const char *)format, ##args); \ 258 static void totemnet_instance_initialize (
260 struct totem_config *config)
271 "Initializing transport (%s).", transport_entries[transport].name);
273 instance->
transport = &transport_entries[transport];
278 const char *cipher_type,
279 const char *hash_type)
285 cipher_type, hash_type);
304 struct totem_config *totem_config,
311 unsigned int msg_len,
314 void (*iface_change_fn) (
317 unsigned int ring_no),
319 void (*mtu_changed) (
323 void (*target_set_completed) (
330 if (instance == NULL) {
333 totemnet_instance_initialize (instance, totem_config);
337 context, deliver_fn, iface_change_fn, mtu_changed, target_set_completed);
343 *net_context = instance;
354 assert (instance != NULL);
362 assert (instance != NULL);
401 unsigned int msg_len)
413 unsigned int msg_len)
426 unsigned int msg_len)
457 unsigned short ip_port,
458 unsigned int iface_no)
471 unsigned int *iface_count)
511 unsigned int res = 0;
530 unsigned int res = 0;
548 unsigned int res = 0;
562 struct totem_config *totem_config)
565 unsigned int res = 0;
int totemudp_crypto_set(void *udp_context, const char *cipher_type, const char *hash_type)
int totemudp_processor_count_set(void *udp_context, int processor_count)
int(* ifaces_get)(void *transport_context, char ***status, unsigned int *iface_count)
int(* finalize)(void *transport_context)
int totemknet_member_remove(void *knet_context, const struct totem_ip_address *token_target, int link_no)
int totemnet_mcast_flush_send(void *net_context, const void *msg, unsigned int msg_len)
int(* recv_mcast_empty)(void *transport_context)
int totemudp_iface_set(void *net_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no)
The totem_ip_address struct.
totem_transport_t transport_number
void(* stats_clear)(void *net_context)
int(* member_remove)(void *transport_context, const struct totem_ip_address *member, int ring_no)
void totemudp_net_mtu_adjust(void *udp_context, struct totem_config *totem_config)
int totemudpu_iface_set(void *net_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no)
void totemnet_stats_clear(void *net_context)
void(*) in totemnet_subsys_id)
int(* member_set_active)(void *transport_context, const struct totem_ip_address *member, int active)
int totemudp_token_target_set(void *udp_context, unsigned int nodeid)
int totemknet_finalize(void *knet_context)
void * totemudp_buffer_alloc(void)
int totemudp_mcast_flush_send(void *udp_context, const void *msg, unsigned int msg_len)
int totemnet_member_remove(void *net_context, const struct totem_ip_address *member, int ring_no)
int totemudpu_processor_count_set(void *udpu_context, int processor_count)
int(* send_flush)(void *transport_context)
void totemknet_buffer_release(void *ptr)
void totemknet_stats_clear(void *knet_context)
void(* buffer_release)(void *ptr)
int totemudpu_member_remove(void *udpu_context, const struct totem_ip_address *token_target, int ring_no)
int totemudp_mcast_noflush_send(void *udp_context, const void *msg, unsigned int msg_len)
void *(* buffer_alloc)(void)
int totemknet_crypto_set(void *knet_context, const char *cipher_type, const char *hash_type)
int totemudp_send_flush(void *udp_context)
int totemknet_mcast_flush_send(void *knet_context, const void *msg, unsigned int msg_len)
int totemknet_iface_check(void *knet_context)
Totem Network interface - also does encryption/decryption.
int totemudp_recv_flush(void *udp_context)
int totemnet_recv_flush(void *net_context)
int totemnet_token_target_set(void *net_context, unsigned int nodeid)
int totemnet_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
int(* token_target_set)(void *transport_context, unsigned int nodeid)
void(* totemnet_log_printf)(int level, int subsys, const char *function, const char *file, int line, const char *format,...) __attribute__((format(printf
int totemnet_net_mtu_adjust(void *net_context, struct totem_config *totem_config)
void totemudpu_buffer_release(void *ptr)
void * totemudpu_buffer_alloc(void)
int totemknet_token_target_set(void *knet_context, unsigned int nodeid)
int(* token_send)(void *transport_context, const void *msg, unsigned int msg_len)
int totemudp_token_send(void *udp_context, const void *msg, unsigned int msg_len)
int totemudp_member_remove(void *udp_context, const struct totem_ip_address *token_target, int ring_no)
int totemnet_crypto_set(void *net_context, const char *cipher_type, const char *hash_type)
void(* net_mtu_adjust)(void *transport_context, struct totem_config *totem_config)
int totemudpu_mcast_noflush_send(void *udpu_context, const void *msg, unsigned int msg_len)
void * totemnet_buffer_alloc(void *net_context)
int(* initialize)(qb_loop_t *loop_pt, void **transport_instance, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
int totemknet_reconfigure(void *knet_context, struct totem_config *totem_config)
int totemknet_iface_set(void *knet_context, const struct totem_ip_address *local_addr, unsigned short ip_port, unsigned int iface_no)
int(* mcast_flush_send)(void *transport_context, const void *msg, unsigned int msg_len)
int totemnet_member_set_active(void *net_context, const struct totem_ip_address *member, int active)
int totemknet_processor_count_set(void *knet_context, int processor_count)
int totemnet_recv_mcast_empty(void *net_context)
int totemknet_recv_flush(void *knet_context)
int totemknet_send_flush(void *knet_context)
int totemudpu_crypto_set(void *udpu_context, const char *cipher_type, const char *hash_type)
int totemnet_initialize(qb_loop_t *loop_pt, void **net_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
int totemnet_send_flush(void *net_context)
int totemnet_mcast_noflush_send(void *net_context, const void *msg, unsigned int msg_len)
int totemudpu_token_send(void *udpu_context, const void *msg, unsigned int msg_len)
int totemudp_finalize(void *udp_context)
int totemnet_finalize(void *net_context)
void(* log_printf)(int level, int subsys, const char *function_name, const char *file_name, int file_line, const char *format,...) __attribute__((format(printf
int(* crypto_set)(void *transport_context, const char *cipher_type, const char *hash_type)
int totemnet_token_send(void *net_context, const void *msg, unsigned int msg_len)
int totemudpu_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
int totemudp_reconfigure(void *udp_context, struct totem_config *totem_config)
int(* processor_count_set)(void *transport_context, int processor_count)
int(* iface_set)(void *transport_context, const struct totem_ip_address *local, unsigned short ip_port, unsigned int ring_no)
int totemudpu_token_target_set(void *udpu_context, unsigned int nodeid)
int totemudp_member_add(void *udp_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
struct transport transport_entries[]
int totemknet_member_add(void *knet_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int link_no)
int totemnet_member_add(void *net_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
#define log_printf(level, format, args...)
int totemudpu_initialize(qb_loop_t *poll_handle, void **udpu_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Create an instance.
struct totem_logging_configuration totem_logging_configuration
#define LOGSYS_LEVEL_NOTICE
int totemudpu_recv_mcast_empty(void *udpu_context)
int(* iface_check)(void *transport_context)
void totemnet_buffer_release(void *net_context, void *ptr)
int totemnet_reconfigure(void *net_context, struct totem_config *totem_config)
struct srp_addr system_from
void totemknet_net_mtu_adjust(void *knet_context, struct totem_config *totem_config)
int totemudpu_member_add(void *udpu_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
int totemudpu_reconfigure(void *udpu_context, struct totem_config *totem_config)
int totemudp_recv_mcast_empty(void *udp_context)
int totemknet_mcast_noflush_send(void *knet_context, const void *msg, unsigned int msg_len)
int totemudp_iface_check(void *udp_context)
int totemnet_iface_check(void *net_context)
int totemudp_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
int(* member_add)(void *transport_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
int totemknet_token_send(void *knet_context, const void *msg, unsigned int msg_len)
void totemudpu_net_mtu_adjust(void *udpu_context, struct totem_config *totem_config)
int totemudpu_mcast_flush_send(void *udpu_context, const void *msg, unsigned int msg_len)
struct transport * transport
int(* reconfigure)(void *net_context, struct totem_config *totem_config)
int totemudpu_send_flush(void *udpu_context)
int totemudp_initialize(qb_loop_t *poll_handle, void **udp_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int ring_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Create an instance.
int(* recv_flush)(void *transport_context)
int totemknet_recv_mcast_empty(void *knet_context)
int(* mcast_noflush_send)(void *transport_context, const void *msg, unsigned int msg_len)
int totemudpu_finalize(void *udpu_context)
int totemudpu_recv_flush(void *udpu_context)
int totemnet_iface_set(void *net_context, const struct totem_ip_address *interface_addr, unsigned short ip_port, unsigned int iface_no)
int totemknet_initialize(qb_loop_t *poll_handle, void **knet_context, struct totem_config *totem_config, totemsrp_stats_t *stats, void *context, void(*deliver_fn)(void *context, const void *msg, unsigned int msg_len, const struct sockaddr_storage *system_from), void(*iface_change_fn)(void *context, const struct totem_ip_address *iface_address, unsigned int link_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
int totemknet_ifaces_get(void *knet_context, char ***status, unsigned int *iface_count)
void totemudp_buffer_release(void *ptr)
int totemudpu_iface_check(void *udpu_context)
void * totemknet_buffer_alloc(void)
int totemnet_processor_count_set(void *net_context, int processor_count)