2 * Copyright (c) 2005 MontaVista Software, Inc.
6 * Author: Steven Dake (sdake@mvista.com)
8 * This software licensed under BSD license, the text of which follows:
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>
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
56 extern int totemrrp_initialize (
57 poll_handle poll_handle
,
58 totemrrp_handle
*handle
,
59 struct totem_config
*totem_config
,
67 void (*iface_change_fn
) (
69 struct totem_ip_address
*iface_addr
,
70 unsigned int iface_no
),
72 void (*token_seqid_get
) (
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
,
87 unsigned int iov_len
);
89 extern int totemrrp_mcast_noflush_send (
90 totemrrp_handle handle
,
92 unsigned int iov_len
);
94 extern int totemrrp_mcast_flush_send (
95 totemrrp_handle handle
,
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
,
115 unsigned int *iface_count
);
117 extern int totemrrp_ring_reenable (
118 totemrrp_handle handle
);
120 #endif /* TOTEMRRP_H_DEFINED */