Patch to remove segfault on the exiting of a service.
[openais.git] / exec / totemrrp.h
blob72fe39870a6d03724cd501b563787456691a6312
1 /*
2 * Copyright (c) 2005 MontaVista Software, Inc.
4 * All rights reserved.
6 * Author: Steven Dake (sdake@mvista.com)
8 * This software licensed under BSD license, the text of which follows:
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
13 * - Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * - Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * - Neither the name of the MontaVista Software, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived from this
20 * software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 * THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef TOTEMRRP_H_DEFINED
35 #define TOTEMRRP_H_DEFINED
37 #include <sys/types.h>
38 #include <sys/socket.h>
40 #include "totem.h"
41 #include "aispoll.h"
43 typedef unsigned int totemrrp_handle;
45 #define TOTEMRRP_NOFLUSH 0
46 #define TOTEMRRP_FLUSH 1
49 * Totem Network interface - also does encryption/decryption
50 * depends on poll abstraction, POSIX, IPV4
54 * Create an instance
56 extern int totemrrp_initialize (
57 poll_handle poll_handle,
58 totemrrp_handle *handle,
59 struct totem_config *totem_config,
60 void *context,
62 void (*deliver_fn) (
63 void *context,
64 void *msg,
65 int msg_len),
67 void (*iface_change_fn) (
68 void *context,
69 struct totem_ip_address *iface_addr,
70 unsigned int iface_no),
72 void (*token_seqid_get) (
73 void *msg,
74 unsigned int *seqid,
75 unsigned int *token_is),
77 unsigned int (*msgs_missing) (void));
80 extern int totemrrp_processor_count_set (
81 totemrrp_handle handle,
82 unsigned int processor_count);
84 extern int totemrrp_token_send (
85 totemrrp_handle handle,
86 struct iovec *iovec,
87 unsigned int iov_len);
89 extern int totemrrp_mcast_noflush_send (
90 totemrrp_handle handle,
91 struct iovec *iovec,
92 unsigned int iov_len);
94 extern int totemrrp_mcast_flush_send (
95 totemrrp_handle handle,
96 struct iovec *iovec,
97 unsigned int iov_len);
99 extern int totemrrp_recv_flush (totemrrp_handle handle);
101 extern int totemrrp_send_flush (totemrrp_handle handle);
103 extern int totemrrp_token_target_set (
104 totemrrp_handle handle,
105 struct totem_ip_address *target,
106 unsigned int iface_no);
108 extern int totemrrp_iface_check (totemrrp_handle handle);
110 extern int totemrrp_finalize (totemrrp_handle handle);
112 extern int totemrrp_ifaces_get (
113 totemrrp_handle handle,
114 char ***status,
115 unsigned int *iface_count);
117 extern int totemrrp_ring_reenable (
118 totemrrp_handle handle);
120 #endif /* TOTEMRRP_H_DEFINED */