summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/common-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/common-utils.h')
-rw-r--r--libglusterfs/src/common-utils.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index 75692309e..3c99a4212 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -23,6 +23,7 @@
#include <string.h>
#include <assert.h>
#include <pthread.h>
+#include <openssl/md5.h>
#ifndef GF_BSD_HOST_OS
#include <alloca.h>
#endif
@@ -65,6 +66,8 @@ void trap (void);
#define GEOREP "geo-replication"
#define GHADOOP "glusterfs-hadoop"
+#define GF_SELINUX_XATTR_KEY "security.selinux"
+
#define WIPE(statp) do { typeof(*statp) z = {0,}; if (statp) *statp = z; } while (0)
#define IS_EXT_FS(fs_name) \
@@ -75,7 +78,7 @@ void trap (void);
/* Defining this here as it is needed by glusterd for setting
* nfs port in volume status.
*/
-#define GF_NFS3_PORT 38467
+#define GF_NFS3_PORT 2049
#define GF_CLIENT_PORT_CEILING 1024
enum _gf_boolean
@@ -107,8 +110,9 @@ void gf_global_variable_init(void);
in_addr_t gf_resolve_ip (const char *hostname, void **dnscache);
-void gf_log_volume_file (FILE *specfp);
+void gf_log_dump_graph (FILE *specfp, glusterfs_graph_t *graph);
void gf_print_trace (int32_t signal, glusterfs_ctx_t *ctx);
+int gf_set_log_file_path (cmd_args_t *cmd_args);
#define VECTORSIZE(count) (count * (sizeof (struct iovec)))
@@ -172,7 +176,6 @@ void gf_print_trace (int32_t signal, glusterfs_ctx_t *ctx);
} \
} while (0)
-
#define GF_IF_INTERNAL_XATTR_GOTO(pattern, dict, op_errno, label) \
do { \
if (!dict) { \
@@ -180,13 +183,9 @@ void gf_print_trace (int32_t signal, glusterfs_ctx_t *ctx);
"setxattr dict is null"); \
goto label; \
} \
- int _handle_keyvalue_pair (dict_t *d, char *k, \
- data_t *v, void *tmp) \
- { \
- return 0; \
- } \
- if (dict_foreach_fnmatch (dict, pattern, \
- _handle_keyvalue_pair, NULL) > 0) { \
+ if (dict_foreach_fnmatch (dict, pattern, \
+ dict_null_foreach_fn, \
+ NULL) > 0) { \
op_errno = EPERM; \
gf_log (this->name, GF_LOG_ERROR, \
"attempt to set internal" \
@@ -487,6 +486,9 @@ mkdir_p (char *path, mode_t mode, gf_boolean_t allow_symlinks);
* nr
*/
+int
+gf_lstat_dir (const char *path, struct stat *stbuf_in);
+
int32_t gf_roundup_power_of_two (int32_t nr);
/*
@@ -557,6 +559,8 @@ char valid_internet_address (char *address, gf_boolean_t wildcard_acc);
char valid_ipv4_wildcard_check (char *address);
char valid_ipv6_wildcard_check (char *address);
char valid_wildcard_internet_address (char *address);
+gf_boolean_t gf_sock_union_equal_addr (union gf_sock_union *a,
+ union gf_sock_union *b);
char *uuid_utoa (uuid_t uuid);
char *uuid_utoa_r (uuid_t uuid, char *dst);
@@ -579,5 +583,12 @@ char *generate_glusterfs_ctx_id (void);
char *gf_get_reserved_ports();
int gf_process_reserved_ports (gf_boolean_t ports[]);
gf_boolean_t gf_ports_reserved (char *blocked_port, gf_boolean_t *ports);
+int gf_get_hostname_from_ip (char *client_ip, char **hostname);
+gf_boolean_t gf_is_local_addr (char *hostname);
+gf_boolean_t gf_is_same_address (char *host1, char *host2);
+void md5_wrapper(const unsigned char *data, size_t len, char *md5);
+
+int gf_thread_create (pthread_t *thread, const pthread_attr_t *attr,
+ void *(*start_routine)(void *), void *arg);
#endif /* _COMMON_UTILS_H */