libflom: FLoM (Free Lock Manager) client library

flom_handle.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2020, Christian Ferrari <tiian@users.sourceforge.net>
3  * All rights reserved.
4  *
5  * This file is part of FLoM, Free Lock Manager
6  *
7  * FLoM is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2.0 as
9  * published by the Free Software Foundation.
10  *
11  * FLoM is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with FLoM. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef FLOM_HANDLE_H
20 # define FLOM_HANDLE_H
21 
22 
23 
24 #include <stdlib.h>
25 
26 
27 
28 #include "flom_errors.h"
29 #include "flom_types.h"
30 
31 
32 
36 typedef enum flom_handle_state_e {
59 
60 
61 
68 typedef struct flom_handle_s {
76  void *conn;
80  void *config;
86 
87 
88 
89 #ifdef __cplusplus
90 extern "C" {
91 #endif /* __cplusplus */
92 
93 
94 
103  int flom_handle_init(flom_handle_t *handle);
104 
105 
106 
118  int flom_handle_clean(flom_handle_t *handle);
119 
120 
121 
128 
129 
130 
136  void flom_handle_delete(flom_handle_t *handle);
137 
138 
139 
147  int flom_handle_lock(flom_handle_t *handle);
148 
149 
150 
157  int flom_handle_unlock(flom_handle_t *handle);
158 
159 
160 
171 
172 
173 
186  const char *flom_handle_get_locked_element(const flom_handle_t *handle) {
187  return handle->locked_element;
188  }
189 
190 
191 
203 
204 
205 
217  int flom_handle_set_discovery_attempts(flom_handle_t *handle, int value);
218 
219 
220 
232 
233 
234 
246  int flom_handle_set_discovery_timeout(flom_handle_t *handle, int value);
247 
248 
249 
259  int flom_handle_get_discovery_ttl(const flom_handle_t *handle);
260 
261 
262 
273  int flom_handle_set_discovery_ttl(flom_handle_t *handle, int value);
274 
275 
276 
289 
290 
291 
305  flom_lock_mode_t value);
306 
307 
308 
319  const char *flom_handle_get_multicast_address(const flom_handle_t *handle);
320 
321 
322 
335  const char *value);
336 
337 
338 
349 
350 
351 
362  int flom_handle_set_multicast_port(flom_handle_t *handle, int value);
363 
364 
365 
374  const char *flom_handle_get_network_interface(const flom_handle_t *handle);
375 
376 
377 
388  const char *value);
389 
390 
391 
402 
403 
404 
415  int flom_handle_set_resource_create(flom_handle_t *handle, int value);
416 
417 
418 
429 
430 
431 
443  int value);
444 
445 
446 
456  const char *flom_handle_get_resource_name(const flom_handle_t *handle);
457 
458 
459 
474  const char *value);
475 
476 
477 
489 
490 
491 
503  int flom_handle_set_resource_quantity(flom_handle_t *handle, int value);
504 
505 
506 
520 
521 
522 
536  int flom_handle_set_resource_timeout(flom_handle_t *handle, int value);
537 
538 
539 
548  const char *flom_handle_get_socket_name(const flom_handle_t *handle);
549 
550 
551 
562  const char *value);
563 
564 
565 
574  const char *flom_handle_get_trace_filename(const flom_handle_t *handle);
575 
576 
577 
588  const char *value);
589 
590 
591 
602  const char *flom_handle_get_unicast_address(const flom_handle_t *handle);
603 
604 
605 
618  const char *value);
619 
620 
621 
631  int flom_handle_get_unicast_port(const flom_handle_t *handle);
632 
633 
634 
645  int flom_handle_set_unicast_port(flom_handle_t *handle, int value);
646 
647 
648 
656  const char *flom_handle_get_tls_certificate(const flom_handle_t *handle);
657 
658 
659 
669  const char *value);
670 
671 
672 
680  const char *flom_handle_get_tls_private_key(const flom_handle_t *handle);
681 
682 
683 
693  const char *value);
694 
695 
696 
705  const flom_handle_t *handle);
706 
707 
708 
718  const char *value);
719 
720 
721 
730 
731 
732 
741  int flom_handle_set_tls_check_peer_id(flom_handle_t *handle, int value);
742 
743 
744 
745 #ifdef __cplusplus
746 }
747 #endif /* __cplusplus */
748 
749 
750 
751 #endif /* FLOM_HANDLE_H */
int flom_handle_get_discovery_ttl(const flom_handle_t *handle)
int flom_handle_set_lock_mode(flom_handle_t *handle, flom_lock_mode_t value)
int flom_handle_set_tls_check_peer_id(flom_handle_t *handle, int value)
const char * flom_handle_get_unicast_address(const flom_handle_t *handle)
int flom_handle_lock(flom_handle_t *handle)
flom_lock_mode_t flom_handle_get_lock_mode(const flom_handle_t *handle)
int flom_handle_unlock_rollback(flom_handle_t *handle)
int flom_handle_set_discovery_ttl(flom_handle_t *handle, int value)
char * locked_element
Definition: flom_handle.h:84
flom_handle_state_e
Definition: flom_handle.h:36
void * config
Definition: flom_handle.h:80
int flom_handle_set_resource_idle_lifespan(flom_handle_t *handle, int value)
int flom_handle_set_discovery_attempts(flom_handle_t *handle, int value)
int flom_handle_set_resource_timeout(flom_handle_t *handle, int value)
const char * flom_handle_get_multicast_address(const flom_handle_t *handle)
int flom_handle_get_discovery_timeout(const flom_handle_t *handle)
int flom_handle_set_network_interface(flom_handle_t *handle, const char *value)
int flom_handle_set_unicast_address(flom_handle_t *handle, const char *value)
flom_handle_state_t state
Definition: flom_handle.h:72
int flom_handle_get_multicast_port(const flom_handle_t *handle)
int flom_handle_get_discovery_attempts(const flom_handle_t *handle)
const char * flom_handle_get_trace_filename(const flom_handle_t *handle)
enum flom_handle_state_e flom_handle_state_t
int flom_handle_clean(flom_handle_t *handle)
const char * flom_handle_get_locked_element(const flom_handle_t *handle)
Definition: flom_handle.h:186
int flom_handle_set_multicast_port(flom_handle_t *handle, int value)
struct flom_handle_s flom_handle_t
int flom_handle_set_trace_filename(flom_handle_t *handle, const char *value)
int flom_handle_set_resource_create(flom_handle_t *handle, int value)
int flom_handle_get_resource_create(const flom_handle_t *handle)
int flom_handle_get_resource_idle_lifespan(const flom_handle_t *handle)
const char * flom_handle_get_socket_name(const flom_handle_t *handle)
int flom_handle_set_discovery_timeout(flom_handle_t *handle, int value)
int flom_handle_get_resource_timeout(const flom_handle_t *handle)
int flom_handle_set_resource_name(flom_handle_t *handle, const char *value)
const char * flom_handle_get_tls_ca_certificate(const flom_handle_t *handle)
int flom_handle_set_resource_quantity(flom_handle_t *handle, int value)
int flom_handle_get_unicast_port(const flom_handle_t *handle)
int flom_handle_init(flom_handle_t *handle)
flom_handle_t * flom_handle_new(void)
int flom_handle_set_unicast_port(flom_handle_t *handle, int value)
int flom_handle_set_tls_ca_certificate(flom_handle_t *handle, const char *value)
void flom_handle_delete(flom_handle_t *handle)
int flom_handle_set_multicast_address(flom_handle_t *handle, const char *value)
const char * flom_handle_get_network_interface(const flom_handle_t *handle)
const char * flom_handle_get_tls_certificate(const flom_handle_t *handle)
enum flom_lock_mode_e flom_lock_mode_t
int flom_handle_get_resource_quantity(const flom_handle_t *handle)
int flom_handle_unlock(flom_handle_t *handle)
int flom_handle_get_tls_check_peer_id(const flom_handle_t *handle)
int flom_handle_set_tls_private_key(flom_handle_t *handle, const char *value)
const char * flom_handle_get_resource_name(const flom_handle_t *handle)
int flom_handle_set_socket_name(flom_handle_t *handle, const char *value)
int flom_handle_set_tls_certificate(flom_handle_t *handle, const char *value)
const char * flom_handle_get_tls_private_key(const flom_handle_t *handle)

Copyright © 2013-2020, Christian Ferrari tiian@users.sourceforge.net