Utility functions.  
More...
#include <sys/types.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
#include <signal.h>
#include <glib.h>
#include <crm/common/acl.h>
#include <crm/common/actions.h>
#include <crm/common/agents.h>
#include <crm/common/results.h>
#include <crm/common/scores.h>
#include <crm/common/strings.h>
#include <crm/common/nvpair.h>
#include <crm/common/util_compat.h>
Go to the source code of this file.
|  | 
| #define | pcmk_is_set(g,  f)   pcmk_all_flags_set((g), (f)) | 
|  | Convenience alias for pcmk_all_flags_set(), to check single flag.  More... 
 | 
|  | 
Utility functions. 
Definition in file util.h.
◆ pcmk_is_set
      
        
          | #define pcmk_is_set | ( |  | g, | 
        
          |  |  |  | f | 
        
          |  | ) |  | pcmk_all_flags_set((g), (f)) | 
      
 
Convenience alias for pcmk_all_flags_set(), to check single flag. 
Definition at line 80 of file util.h.
 
 
◆ compare_version()
      
        
          | int compare_version | ( | const char * | version1, | 
        
          |  |  | const char * | version2 | 
        
          |  | ) |  |  | 
      
 
 
◆ crm_default_remote_port()
      
        
          | int crm_default_remote_port | ( | void |  | ) |  | 
      
 
Get the default remote connection TCP port on this host. 
- Returns
- Remote connection TCP port number 
Definition at line 1008 of file remote.c.
 
 
◆ crm_generate_uuid()
      
        
          | char* crm_generate_uuid | ( | void |  | ) |  | 
      
 
 
◆ crm_md5sum()
      
        
          | char* crm_md5sum | ( | const char * | buffer | ) |  | 
      
 
 
◆ crm_user_lookup()
      
        
          | int crm_user_lookup | ( | const char * | name, | 
        
          |  |  | uid_t * | uid, | 
        
          |  |  | gid_t * | gid | 
        
          |  | ) |  |  | 
      
 
 
◆ pcmk_common_cleanup()
      
        
          | void pcmk_common_cleanup | ( | void |  | ) |  | 
      
 
Free all memory used by libcrmcommon. 
Free all global memory allocated by the libcrmcommon library. This should be called before exiting a process that uses the library, and the process should not call any libcrmcommon or libxml2 APIs after calling this one. 
Definition at line 54 of file utils.c.
 
 
◆ pcmk_daemon_user()
      
        
          | int pcmk_daemon_user | ( | uid_t * | uid, | 
        
          |  |  | gid_t * | gid | 
        
          |  | ) |  |  | 
      
 
Get user and group IDs of pacemaker daemon user. 
- Parameters
- 
  
    | [out] | uid | If non-NULL, where to store daemon user ID |  | [out] | gid | If non-NULL, where to store daemon group ID |  
 
- Returns
- pcmk_ok on success, -errno otherwise 
Definition at line 139 of file utils.c.
 
 
◆ pcmk_promotion_score_name()
      
        
          | char* pcmk_promotion_score_name | ( | const char * | rsc_id | ) |  | 
      
 
Return the name of the node attribute used as a promotion score. 
- Parameters
- 
  
    | [in] | rsc_id | Resource ID that promotion score is for (or NULL to check the OCF_RESOURCE_INSTANCE environment variable) |  
 
- Returns
- Newly allocated string with the node attribute name (or NULL on error, including no ID or environment variable specified) 
- Note
- It is the caller's responsibility to free() the result. 
Definition at line 88 of file attrs.c.