~ubuntu-branches/ubuntu/precise/corosync/precise-proposed

« back to all changes in this revision

Viewing changes to include/corosync/totem/totem.h

  • Committer: Bazaar Package Importer
  • Author(s): Ante Karamatic
  • Date: 2009-08-21 09:29:56 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090821092956-w9qxxxx3zeoh8dem
Tags: 1.0.0-4ubuntu2
* debian/control:
  - 'Ubuntu Developers' instead of 'Ubuntu Core Developers'
    as maintainer
  - Bump debhelper dependecy to 7

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Copyright (c) 2005 MontaVista Software, Inc.
3
 
 * Copyright (c) 2006-2008 Red Hat, Inc.
 
3
 * Copyright (c) 2006-2009 Red Hat, Inc.
4
4
 *
5
5
 * Author: Steven Dake (sdake@redhat.com)
6
6
 *
7
7
 * All rights reserved.
8
8
 *
9
9
 * This software licensed under BSD license, the text of which follows:
10
 
 * 
 
10
 *
11
11
 * Redistribution and use in source and binary forms, with or without
12
12
 * modification, are permitted provided that the following conditions are met:
13
13
 *
50
50
#define SEND_THREADS_MAX        16
51
51
#define INTERFACE_MAX           2
52
52
 
53
 
/*
54
 
 * Array location of various timeouts as
55
 
 * specified in corosync.conf.  The last enum
56
 
 * specifies the size of the timeouts array and
57
 
 * needs to remain the last item in the list.
58
 
 */
59
 
enum {
60
 
        TOTEM_RETRANSMITS_BEFORE_LOSS,
61
 
        TOTEM_TOKEN,
62
 
        TOTEM_RETRANSMIT_TOKEN,
63
 
        TOTEM_HOLD_TOKEN,
64
 
        TOTEM_JOIN,
65
 
        TOTEM_CONSENSUS,
66
 
        TOTEM_MERGE,
67
 
        TOTEM_DOWNCHECK,
68
 
        TOTEM_FAIL_RECV_CONST,
69
 
 
70
 
        MAX_TOTEM_TIMEOUTS      /* Last item */
71
 
} totem_timeout_types;
72
 
 
73
53
struct totem_interface {
74
54
        struct totem_ip_address bindnet;
75
55
        struct totem_ip_address boundto;
78
58
};
79
59
 
80
60
struct totem_logging_configuration {
81
 
        void (*log_printf) (char *, int, int, char *, ...) __attribute__((format(printf, 4, 5)));
 
61
        void (*log_printf) (
 
62
                unsigned int rec_ident,
 
63
                const char *function_name,
 
64
                const char *file_name,
 
65
                int file_line,
 
66
                const char *format,
 
67
                ...) __attribute__((format(printf, 5, 6)));
 
68
 
82
69
        int log_level_security;
83
70
        int log_level_error;
84
71
        int log_level_warning;
85
72
        int log_level_notice;
86
73
        int log_level_debug;
 
74
        int log_subsys_id;
87
75
};
88
76
 
 
77
enum { TOTEM_PRIVATE_KEY_LEN = 128 };
 
78
enum { TOTEM_RRP_MODE_BYTES = 64 };
 
79
 
89
80
struct totem_config {
90
81
        int version;
91
82
 
93
84
         * network
94
85
         */
95
86
        struct totem_interface *interfaces;
96
 
        int interface_count;
 
87
        unsigned int interface_count;
97
88
        unsigned int node_id;
 
89
        unsigned int clear_node_high_bit;
98
90
 
99
91
        /*
100
92
         * key information
101
93
         */
102
 
        unsigned char private_key[128];
 
94
        unsigned char private_key[TOTEM_PRIVATE_KEY_LEN];
103
95
 
104
 
        int private_key_len;
 
96
        unsigned int private_key_len;
105
97
 
106
98
        /*
107
99
         * Totem configuration parameters
134
126
 
135
127
        unsigned int rrp_problem_count_threshold;
136
128
 
137
 
        char rrp_mode[64];
 
129
        char rrp_mode[TOTEM_RRP_MODE_BYTES];
138
130
 
139
131
        struct totem_logging_configuration totem_logging_configuration;
140
132
 
 
133
        void (*log_rec) (
 
134
                int subsysid,
 
135
                const char *function_name,
 
136
                const char *file_name,
 
137
                int file_line,
 
138
                unsigned int rec_ident,
 
139
                ...);
 
140
 
141
141
        unsigned int secauth;
142
142
 
143
143
        unsigned int net_mtu;
144
144
 
145
145
        unsigned int threads;
146
 
        
 
146
 
147
147
        unsigned int heartbeat_failures_allowed;
148
 
        
 
148
 
149
149
        unsigned int max_network_delay;
150
150
 
151
151
        unsigned int window_size;
152
152
 
153
153
        unsigned int max_messages;
154
154
 
155
 
        char *vsf_type;
 
155
        const char *vsf_type;
 
156
 
 
157
        unsigned int broadcast_use;
 
158
 
 
159
        enum { TOTEM_CRYPTO_SOBER=0, TOTEM_CRYPTO_NSS } crypto_type;
 
160
        enum { TOTEM_CRYPTO_ACCEPT_OLD=0, TOTEM_CRYPTO_ACCEPT_NEW } crypto_accept;
 
161
 
 
162
        int crypto_crypt_type;
 
163
        int crypto_sign_type;
156
164
};
157
165
 
158
166
#define TOTEM_CONFIGURATION_TYPE
159
167
enum totem_configuration_type {
160
168
        TOTEM_CONFIGURATION_REGULAR,
161
 
        TOTEM_CONFIGURATION_TRANSITIONAL        
 
169
        TOTEM_CONFIGURATION_TRANSITIONAL
162
170
};
163
171
 
 
172
#define TOTEM_CALLBACK_TOKEN_TYPE
164
173
enum totem_callback_token_type {
165
174
        TOTEM_CALLBACK_TOKEN_RECEIVED = 1,
166
175
        TOTEM_CALLBACK_TOKEN_SENT = 2