[go: up one dir, main page]

Menu

[d23328]: / src / flom_handle.h  Maximize  Restore  History

Download this file

752 lines (586 with data), 26.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
/*
* Copyright (c) 2013-2016, Christian Ferrari <tiian@users.sourceforge.net>
* All rights reserved.
*
* This file is part of FLoM, Free Lock Manager
*
* FLoM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2.0 as
* published by the Free Software Foundation.
*
* FLoM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with FLoM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FLOM_HANDLE_H
# define FLOM_HANDLE_H
#include <stdlib.h>
#include "flom_errors.h"
#include "flom_types.h"
/**
* This scalar type is used to represent the state of an handle
*/
typedef enum flom_handle_state_e {
/**
* Initial state
*/
FLOM_HANDLE_STATE_INIT = 22,
/**
* The client is connected to the daemon and the resource is NOT locked
*/
FLOM_HANDLE_STATE_CONNECTED,
/**
* The client is connected to the daemon and the resource is locked
*/
FLOM_HANDLE_STATE_LOCKED,
/**
* The client is NOT connected to the daemon
*/
FLOM_HANDLE_STATE_DISCONNECTED,
/**
* The handle memory was released and the handle itself can NOT be used
* without a call to @ref flom_handle_init method
*/
FLOM_HANDLE_STATE_CLEANED
} flom_handle_state_t;
/**
* This object is used to save all the necessary context to interact with
* libflom library.
* Some fields use "void *" type to avoid useless internal details exposure
* (flom methods proxies the correct types)
*/
typedef struct flom_handle_s {
/**
* Handle state
*/
flom_handle_state_t state;
/**
* Connection data
*/
void *conn;
/**
* Configuration data
*/
void *config;
/**
* (last) Locked element (useful for resource sets)
*/
char *locked_element;
} flom_handle_t;
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* Initializes an object handle; this function MUST be called before the
* first usage of a new statically allocated handle or after an handle
* has been cleaned up with function @ref flom_handle_clean
* @param handle (Input/Output): a statically allocated object to
* initialize
* @return a reason code (see file @ref flom_errors.h)
*/
int flom_handle_init(flom_handle_t *handle);
/**
* Cleans an object handle; this function MUST be called before the handle
* will go out of scope of an handle;
* if this method is not called a memory leak will be generated.
* For every object initialized with @ref flom_handle_init
* there must be a call to this method.
* If the handle is locked, it will be unlocked before proceeding with
* clean-up to avoid memory leaks.
* @param handle (Input/Output): a statically allocated object to clean
* @return a reason code (see file @ref flom_errors.h)
*/
int flom_handle_clean(flom_handle_t *handle);
/**
* Allocates and initializes (using function @ref flom_handle_init) a
* new dynamically allocated object handle
* @return a new object handle or NULL if any error happens
*/
flom_handle_t *flom_handle_new(void);
/**
* Cleans (using function @ref flom_handle_clean) and deallocates an
* object allocated (created) with function @ref flom_handle_new
* @param handle (Input): a dynamically allocated object to delete
*/
void flom_handle_delete(flom_handle_t *handle);
/**
* Locks the (logical) resource linked to an handle; the resource MUST
* be unlocked using function @ref flom_handle_unlock when the lock
* condition is no more necessary
* @param handle (Input/Output): a valid object handle
* @return a reason code (see file @ref flom_errors.h)
*/
int flom_handle_lock(flom_handle_t *handle);
/**
* Unlocks the (logical) resource linked to an handle; the resource MUST
* be previously locked using function @ref flom_handle_lock
* @param handle (Input/Output): a valid object handle
* @return a reason code (see file @ref flom_errors.h)
*/
int flom_handle_unlock(flom_handle_t *handle);
/**
* Unlocks the (logical) resource linked to an handle and rollback the
* transactional resource state; the resource MUST be previously locked
* using function @ref flom_handle_lock . This method should be used only
* with transactional resources, for example: transactional unique
* sequences
* @param handle (Input/Output): a valid object handle
* @return a reason code (see file @ref flom_errors.h)
*/
int flom_handle_unlock_rollback(flom_handle_t *handle);
/**
* Return the name of the locked element if the resource is of type set.<P>
* Note 1: this function can be used only after @ref flom_handle_lock
* and before @ref flom_handle_unlock<P>
* Note 2: this function can be used only when locking a resource of
* type "resource set"<P>
* Note 3: the return string must copied as soon as possible to a different
* place because it's a dynamic string removed by
* @ref flom_handle_unlock<P>
* @param handle (Input): a valid object handle
* @return the name of the locked element
*/
const char *flom_handle_get_locked_element(const flom_handle_t *handle) {
return handle->locked_element;
}
/**
* Get the maximum number of attempts that will be tryed during
* auto-discovery phase using UDP/IP multicast (see
* @ref flom_handle_get_multicast_address,
* @ref flom_handle_get_multicast_port).
* The current value can be altered using function
* @ref flom_handle_set_discovery_attempts
* @param handle (Input): a valid object handle
* @return the current value
*/
int flom_handle_get_discovery_attempts(const flom_handle_t *handle);
/**
* Set the maximum number of attempts that will be tryed during
* auto-discovery phase using UDP/IP multicast (see
* @ref flom_handle_set_multicast_address,
* @ref flom_handle_set_multicast_port).
* The current value can be inspected using function
* @ref flom_handle_get_discovery_attempts
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_discovery_attempts(flom_handle_t *handle, int value);
/**
* Get the number of milliseconds between two consecutive attempts that
* will be tryed during auto-discovery phase using UDP/IP multicast (see
* @ref flom_handle_get_multicast_address,
* @ref flom_handle_get_multicast_port).
* The current value can be altered using function
* @ref flom_handle_set_discovery_timeout
* @param handle (Input): a valid object handle
* @return the current value
*/
int flom_handle_get_discovery_timeout(const flom_handle_t *handle);
/**
* Set the number of milliseconds between two consecutive attempts that
* will be tryed during auto-discovery phase using UDP/IP multicast (see
* @ref flom_handle_set_multicast_address,
* @ref flom_handle_set_multicast_port).
* The current value can be inspected using function
* @ref flom_handle_get_discovery_timeout.
* @param handle (Input): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_discovery_timeout(flom_handle_t *handle, int value);
/**
* Get the UDP/IP multicast TTL parameter used during auto-discovery
* phase; for a definition of the parameter, see
* http://www.tldp.org/HOWTO/Multicast-HOWTO-2.html
* . The current value can be altered using function
* @ref flom_handle_set_discovery_ttl
* @param handle (Input): a valid object handle
* @return the current value
*/
int flom_handle_get_discovery_ttl(const flom_handle_t *handle);
/**
* Set the UDP/IP multicast TTL parameter used during auto-discovery
* phase; for a definition of the parameter, see
* http://www.tldp.org/HOWTO/Multicast-HOWTO-2.html
* . The current value can be inspected using function
* @ref flom_handle_get_discovery_ttl.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_discovery_ttl(flom_handle_t *handle, int value);
/**
* Get lock mode property: how a simple or hierarchical resource will
* be locked when function @ref flom_handle_lock is called; FLoM
* supports the same lock mode semantic proposed by DLM, see
* http://en.wikipedia.org/wiki/Distributed_lock_manager#Lock_modes
* for a detailed explanation
* . The current value can be altered using function
* @ref flom_handle_set_lock_mode
* @param handle (Input): a valid object handle
* @return the current value
*/
flom_lock_mode_t flom_handle_get_lock_mode(const flom_handle_t *handle);
/**
* Set lock mode property: how a simple or hierarchical resource will
* be locked when function @ref flom_handle_lock is called; FLoM
* supports the same lock mode semantic proposed by DLM, see
* http://en.wikipedia.org/wiki/Distributed_lock_manager#Lock_modes
* for a detailed explanation
* . The current value can be inspected using function
* @ref flom_handle_get_lock_mode
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_lock_mode(flom_handle_t *handle,
flom_lock_mode_t value);
/**
* Get the multicast address: the IP address (or a network name that the
* system can resolve) of the IP multicast group that must be contacted
* to reach FLoM daemon (server) using UDP/IP; see also
* @ref flom_handle_get_multicast_port.
* The current value can be altered using function
* @ref flom_handle_set_multicast_address.
* @param handle (Input): a valid object handle
* @return the current value
*/
const char *flom_handle_get_multicast_address(const flom_handle_t *handle);
/**
* Set the multicast address: the IP address (or a network name that the
* system can resolve) of the IP multicast group that must be contacted
* to reach FLoM daemon (server) using UDP/IP; see also
* @ref flom_handle_set_multicast_port.
* The current value can be inspected using function
* @ref flom_handle_get_multicast_address.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_multicast_address(flom_handle_t *handle,
const char *value);
/**
* Get the UDP/IP multicast port that must be used to contact the FLoM
* daemon (server) using UDP/IP; see also
* @ref flom_handle_get_multicast_address.
* The current value can be altered using function
* @ref flom_handle_set_multicast_port.
* @param handle (Input): a valid object handle
* @return the current value
*/
int flom_handle_get_multicast_port(const flom_handle_t *handle);
/**
* Set the UDP/IP multicast port that must be used to contact the FLoM
* daemon (server) using UDP/IP; see also
* @ref flom_handle_set_multicast_address.
* The current value can be inspected using function
* @ref flom_handle_get_multicast_port.
* @param handle (Input): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_multicast_port(flom_handle_t *handle, int value);
/**
* Get the network interface that must be used for IPv6 link local
* addresses
* The current value can be altered using function
* @ref flom_handle_set_network_interface.
* @param handle (Input): a valid object handle
* @return the current value
*/
const char *flom_handle_get_network_interface(const flom_handle_t *handle);
/**
* Set the network interface that must be used for IPv6 link local
* addresses
* The current value can be inspected using function
* @ref flom_handle_get_network_interface.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return a reason code
*/
int flom_handle_set_network_interface(flom_handle_t *handle,
const char *value);
/**
* Get "resource create" boolean property: it specifies if function
* @ref flom_handle_lock can create a new resource when the specified
* one is not defined; the default value is TRUE.
* The current value can be altered using function
* @ref flom_handle_set_resource_create.
* @param handle (Input): a valid object handle
* @return the current value
*/
int flom_handle_get_resource_create(const flom_handle_t *handle);
/**
* Set "resource create" boolean property: it specifies if function
* @ref flom_handle_lock can create a new resource when the specified
* one is not defined.
* The current value can be inspected using function
* @ref flom_handle_get_resource_create.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_resource_create(flom_handle_t *handle, int value);
/**
* Get "resource idle lifespan" property: it specifies how many
* milliseconds a resource will be kept after the last locker released it;
* the expiration is necessary to avoid useless resource allocation.
* The current value can be altered using function
* @ref flom_handle_set_resource_idle_lifespan.
* @param handle (Input): a valid object handle
* @return the current value
*/
int flom_handle_get_resource_idle_lifespan(const flom_handle_t *handle);
/**
* Set "resource idle lifespan" property: it specifies how many
* milliseconds a resource will be kept after the last locker released it;
* the expiration is necessary to avoid useless resource allocation.
* The current value can be inspected using function
* @ref flom_handle_get_resource_idle_lifespan.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_resource_idle_lifespan(flom_handle_t *handle,
int value);
/**
* Get the resource name: the name of the resource that can be locked and
* unlocked using @ref flom_handle_lock and @ref flom_handle_unlock
* functions.
* The current value can be altered using function
* @ref flom_handle_set_resource_name.
* @param handle (Input): a valid object handle
* @return the current value
*/
const char *flom_handle_get_resource_name(const flom_handle_t *handle);
/**
* Set the resource name: the name of the resource that can be locked and
* unlocked using @ref flom_handle_lock and @ref flom_handle_unlock
* functions.
* The current value can be inspected using function
* @ref flom_handle_get_resource_name.
* NOTE: the resource type is determined by its name; take a look to
* flom command man page (-r, --resource-name option) for an
* explanation of the resource name grammar.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_resource_name(flom_handle_t *handle,
const char *value);
/**
* Get "resource quantity" property: the number of units that will be
* locked and unlocked using @ref flom_handle_lock and
* @ref flom_handle_unlock functions.
* The current value can be altered using function
* @ref flom_handle_set_resource_quantity.
* NOTE: this property applies to "numeric resources" only.
* @param handle (Input): a valid object handle
* @return the current value
*/
int flom_handle_get_resource_quantity(const flom_handle_t *handle);
/**
* Set "resource quantity" property: the number of units that will be
* locked and unlocked using @ref flom_handle_lock and
* @ref flom_handle_unlock functions.
* The current value can be inspected using function
* @ref flom_handle_get_resource_quantity.
* NOTE: this property applies to "numeric resources" only.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_resource_quantity(flom_handle_t *handle, int value);
/**
* Get "resource timeout" property: how long a lock operation
* (see @ref flom_handle_lock) will wait if the resource is locked
* by another requester.
* The current value can be altered using function
* @ref flom_handle_set_resource_timeout.
* @param handle (Input): a valid object handle
* @return the current value: <BR>
* 0: no wait <BR>
* >0: maximum number of milliseconds to wait <BR>
* <0: unlimited wait
*/
int flom_handle_get_resource_timeout(const flom_handle_t *handle);
/**
* Set "resource timeout" property: how long a lock operation
* (see @ref flom_handle_lock) will wait if the resource is locked
* by another requester.
* The current value can be inspected using function
* @ref flom_handle_get_resource_timeout.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value: <BR>
* 0: no wait <BR>
* >0: maximum number of milliseconds to wait <BR>
* <0: unlimited wait
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_resource_timeout(flom_handle_t *handle, int value);
/**
* Get the socket name: the AF_LOCAL/AF_UNIX socket name that must be
* used to contact a local FLoM daemon (server).
* The current value can be altered using function
* @ref flom_handle_set_socket_name.
* @param handle (Input): a valid object handle
* @return the current value
*/
const char *flom_handle_get_socket_name(const flom_handle_t *handle);
/**
* Set the socket name: the AF_LOCAL/AF_UNIX socket name that must be
* used to contact a local FLoM daemon (server).
* The current value can be inspected using function
* @ref flom_handle_get_socket_name.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return a reason code (see file @ref flom_errors.h)
*/
int flom_handle_set_socket_name(flom_handle_t *handle,
const char *value);
/**
* Get the trace filename: the name (absolute or relative path) used
* by libflom (FLoM client library) to record trace messages.
* The current value can be altered using function
* @ref flom_handle_set_trace_filename.
* @param handle (Input): a valid object handle
* @return the current value
*/
const char *flom_handle_get_trace_filename(const flom_handle_t *handle);
/**
* Set the trace filename: the name (absolute or relative path) used
* by libflom (FLoM client library) to record trace messages.
* The current value can be inspected using function
* @ref flom_handle_get_trace_filename.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK
*/
int flom_handle_set_trace_filename(flom_handle_t *handle,
const char *value);
/**
* Get the unicast address: the IP address (or a network name that the
* system can resolve) of the host that must be contacted
* to reach FLoM daemon (server) using TCP/IP; see also
* @ref flom_handle_get_unicast_port.
* The current value can be altered using function
* @ref flom_handle_set_unicast_address.
* @param handle (Input): a valid object handle
* @return the current value
*/
const char *flom_handle_get_unicast_address(const flom_handle_t *handle);
/**
* Set the unicast address: the IP address (or a network name that the
* system can resolve) of the host that must be contacted
* to reach FLoM daemon (server) using TCP/IP; see also
* @ref flom_handle_set_unicast_port.
* The current value can be inspected using function
* @ref flom_handle_get_unicast_address.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_unicast_address(flom_handle_t *handle,
const char *value);
/**
* Get the TCP/IP unicast port that must be used to contact the FLoM
* daemon (server) using TCP/IP; see also
* @ref flom_handle_get_unicast_address.
* The current value can be altered using function
* @ref flom_handle_set_unicast_port.
* @param handle (Input): a valid object handle
* @return the current value
*/
int flom_handle_get_unicast_port(const flom_handle_t *handle);
/**
* Set the TCP/IP unicast port that must be used to contact the FLoM
* daemon (server) using TCP/IP; see also
* @ref flom_handle_set_unicast_address.
* The current value can be inspected using function
* @ref flom_handle_get_unicast_port.
* @param handle (Input): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_unicast_port(flom_handle_t *handle, int value);
/**
* Get the TLS certificate file name.
* The current value can be altered using function
* @ref flom_handle_set_tls_certificate.
* @param handle (Input): a valid object handle
* @return the current value
*/
const char *flom_handle_get_tls_certificate(const flom_handle_t *handle);
/**
* Set the TLS certificate file name.
* The current value can be inspected using function
* @ref flom_handle_get_tls_certificate.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_tls_certificate(flom_handle_t *handle,
const char *value);
/**
* Get the TLS private key file name.
* The current value can be altered using function
* @ref flom_handle_set_tls_private_key.
* @param handle (Input): a valid object handle
* @return the current value
*/
const char *flom_handle_get_tls_private_key(const flom_handle_t *handle);
/**
* Set the TLS private key file name.
* The current value can be inspected using function
* @ref flom_handle_get_tls_private_key.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_tls_private_key(flom_handle_t *handle,
const char *value);
/**
* Get the TLS private key file name.
* The current value can be altered using function
* @ref flom_handle_set_tls_ca_certificate.
* @param handle (Input): a valid object handle
* @return the current value
*/
const char *flom_handle_get_tls_ca_certificate(
const flom_handle_t *handle);
/**
* Set the TLS private key file name.
* The current value can be inspected using function
* @ref flom_handle_get_tls_ca_certificate.
* @param handle (Input/Output): a valid object handle
* @param value (Input): the new value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_tls_ca_certificate(flom_handle_t *handle,
const char *value);
/**
* Get the TLS check peer id boolean flag
* The current value can be altered using function
* @ref flom_handle_set_tls_check_peer_id.
* @param handle (Input): a valid object handle
* @return the current (boolean) value
*/
int flom_handle_get_tls_check_peer_id(const flom_handle_t *handle);
/**
* Set the TLS check peer id boolean flag
* The current value can be inspected using function
* @ref flom_handle_get_tls_check_peer_id.
* @param handle (Input): a valid object handle
* @param value (Input): the new (boolean) value
* @return @ref FLOM_RC_OK or @ref FLOM_RC_API_IMMUTABLE_HANDLE
*/
int flom_handle_set_tls_check_peer_id(flom_handle_t *handle, int value);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* FLOM_HANDLE_H */