corosync 3.1.7
totemnet.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005 MontaVista Software, Inc.
3 * Copyright (c) 2006-2007, 2009 Red Hat, Inc.
4 *
5 * All rights reserved.
6 *
7 * Author: Steven Dake (sdake@redhat.com)
8 *
9 * This software licensed under BSD license, the text of which follows:
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * - Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 * - Redistributions in binary form must reproduce the above copyright notice,
17 * this list of conditions and the following disclaimer in the documentation
18 * and/or other materials provided with the distribution.
19 * - Neither the name of the MontaVista Software, Inc. nor the names of its
20 * contributors may be used to endorse or promote products derived from this
21 * software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
33 * THE POSSIBILITY OF SUCH DAMAGE.
34 */
35
43#ifndef TOTEMNET_H_DEFINED
44#define TOTEMNET_H_DEFINED
45
46#include <sys/types.h>
47#include <sys/socket.h>
48
50
51#define TOTEMNET_NOFLUSH 0
52#define TOTEMNET_FLUSH 1
53
58 qb_loop_t *poll_handle,
59 void **net_context,
61 totemsrp_stats_t *stats,
62 void *context,
63
64 void (*deliver_fn) (
65 void *context,
66 const void *msg,
67 unsigned int msg_len,
68 const struct sockaddr_storage *system_from),
69
70 void (*iface_change_fn) (
71 void *context,
72 const struct totem_ip_address *iface_address,
73 unsigned int iface_no),
74
75 void (*mtu_changed) (
76 void *context,
77 int net_mtu),
78
79 void (*target_set_completed) (
80 void *context));
81
82extern void *totemnet_buffer_alloc (void *net_context);
83
84extern void totemnet_buffer_release (void *net_context, void *ptr);
85
87 void *net_context,
88 int processor_count);
89
90extern int totemnet_token_send (
91 void *net_context,
92 const void *msg,
93 unsigned int msg_len);
94
96 void *net_context,
97 const void *msg,
98 unsigned int msg_len);
99
101 void *net_context,
102 const void *msg,
103 unsigned int msg_len);
104
105extern int totemnet_recv_flush (void *net_context);
106
107extern int totemnet_send_flush (void *net_context);
108
109extern int totemnet_iface_set (void *net_context,
110 const struct totem_ip_address *interface_addr,
111 unsigned short ip_port,
112 unsigned int iface_no);
113
114extern int totemnet_iface_check (void *net_context);
115
116extern int totemnet_finalize (void *net_context);
117
118extern int totemnet_net_mtu_adjust (void *net_context, struct totem_config *totem_config);
119
120extern int totemnet_reconfigure (void *net_context, struct totem_config *totem_config);
121
123
124extern void totemnet_stats_clear (void *net_context);
125
126extern const char *totemnet_iface_print (void *net_context);
127
128extern int totemnet_nodestatus_get (
129 void *net_context,
130 unsigned int nodeid,
131 struct totem_node_status *node_status);
132
133extern int totemnet_ifaces_get (
134 void *net_context,
135 char ***status,
136 unsigned int *iface_count);
137
138extern int totemnet_token_target_set (
139 void *net_context,
140 unsigned int target_nodeid);
141
142extern int totemnet_crypto_set (
143 void *net_context,
144 const char *cipher_type,
145 const char *hash_type);
146
147extern int totemnet_recv_mcast_empty (
148 void *net_context);
149
150extern int totemnet_member_add (
151 void *net_context,
152 const struct totem_ip_address *local,
153 const struct totem_ip_address *member,
154 int ring_no);
155
156extern int totemnet_member_remove (
157 void *net_context,
158 const struct totem_ip_address *member,
159 int ring_no);
160
162 void *net_context,
163 const struct totem_ip_address *member,
164 int active);
165
166#endif /* TOTEMNET_H_DEFINED */
unsigned int nodeid
Definition: coroapi.h:0
The totem_ip_address struct.
Definition: coroapi.h:111
unsigned int target_nodeid
Definition: totem.h:5
cfg_message_crypto_reconfig_phase_t
Definition: totem.h:154
int totemnet_iface_set(void *net_context, const struct totem_ip_address *interface_addr, unsigned short ip_port, unsigned int iface_no)
Definition: totemnet.c:471
int totemnet_member_remove(void *net_context, const struct totem_ip_address *member, int ring_no)
Definition: totemnet.c:553
void * totemnet_buffer_alloc(void *net_context)
Definition: totemnet.c:367
int totemnet_token_send(void *net_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:414
int totemnet_send_flush(void *net_context)
Definition: totemnet.c:404
void totemnet_buffer_release(void *net_context, void *ptr)
Definition: totemnet.c:375
int totemnet_mcast_flush_send(void *net_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:426
int totemnet_member_add(void *net_context, const struct totem_ip_address *local, const struct totem_ip_address *member, int ring_no)
Definition: totemnet.c:533
int totemnet_finalize(void *net_context)
Definition: totemnet.c:306
int totemnet_crypto_set(void *net_context, const char *cipher_type, const char *hash_type)
Definition: totemnet.c:292
int totemnet_ifaces_get(void *net_context, char ***status, unsigned int *iface_count)
Definition: totemnet.c:497
int totemnet_processor_count_set(void *net_context, int processor_count)
Definition: totemnet.c:383
const char * totemnet_iface_print(void *net_context)
int totemnet_token_target_set(void *net_context, unsigned int target_nodeid)
Definition: totemnet.c:510
int totemnet_recv_flush(void *net_context)
Definition: totemnet.c:394
int totemnet_iface_check(void *net_context)
Definition: totemnet.c:452
int totemnet_mcast_noflush_send(void *net_context, const void *msg, unsigned int msg_len)
Definition: totemnet.c:439
int totemnet_recv_mcast_empty(void *net_context)
Definition: totemnet.c:522
int totemnet_net_mtu_adjust(void *net_context, struct totem_config *totem_config)
Definition: totemnet.c:462
int totemnet_nodestatus_get(void *net_context, unsigned int nodeid, struct totem_node_status *node_status)
Definition: totemnet.c:484
void totemnet_stats_clear(void *net_context)
Definition: totemnet.c:619
int totemnet_reconfigure(void *net_context, struct totem_config *totem_config)
Definition: totemnet.c:589
int totemnet_member_set_active(void *net_context, const struct totem_ip_address *member, int active)
Definition: totemnet.c:571
int totemnet_crypto_reconfigure_phase(void *net_context, struct totem_config *totem_config, cfg_message_crypto_reconfig_phase_t phase)
Definition: totemnet.c:603
int totemnet_initialize(qb_loop_t *poll_handle, 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 iface_no), void(*mtu_changed)(void *context, int net_mtu), void(*target_set_completed)(void *context))
Create an instance.
struct srp_addr system_from
Definition: totemsrp.c:1