summaryrefslogtreecommitdiffstats
path: root/src/vlib/unix/unix.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-07-20 19:17:06 +0200
committerDave Wallace <dwallacelf@gmail.com>2017-08-24 19:49:09 +0000
commit57d963f88b2c99e698e2b29f72e190f47f41b1ad (patch)
tree0a26d5fd1e09b4b997db5950fe9bf70835ab9798 /src/vlib/unix/unix.h
parentd48e9763bfc39106eca954a28223b72261bf1aeb (diff)
Make VPP runtime directory configurable
New startup config command: unix { runtime-dir /run/vpp } Also, adds recursive mkdir funtion for use in deifferent places like cli-config socket path and dpdk hugepage directory path. Change-Id: I1446ceab9c220c25804e73a743a3ebb383450124 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/unix/unix.h')
-rw-r--r--src/vlib/unix/unix.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vlib/unix/unix.h b/src/vlib/unix/unix.h
index ffa92bba1dc..ee1312e3498 100644
--- a/src/vlib/unix/unix.h
+++ b/src/vlib/unix/unix.h
@@ -44,9 +44,6 @@
#include <termios.h>
-/** VPP runtime ephemeral directory. Typically stored in a tmpfs. */
-#define VPP_RUN_DIR "/run/vpp"
-
struct unix_file;
typedef clib_error_t *(unix_file_function_t) (struct unix_file * f);
@@ -106,6 +103,9 @@ typedef struct
/* startup-config filename */
u8 *startup_config_filename;
+ /* runtime directory path */
+ u8 *runtime_dir;
+
/* unix config complete */
volatile int unix_config_complete;
@@ -214,6 +214,12 @@ vlib_unix_get_main (void)
return &unix_main;
}
+static inline char *
+vlib_unix_get_runtime_dir (void)
+{
+ return (char *) unix_main.runtime_dir;
+}
+
/* thread stack array; vec_len = max number of threads */
extern u8 **vlib_thread_stacks;
@@ -233,7 +239,7 @@ clib_error_t *foreach_directory_file (char *dir_name,
u8 * file_name),
void *arg, int scan_dirs);
-clib_error_t *unix_make_vpp_run_dir (void);
+clib_error_t *vlib_unix_recursive_mkdir (char *path);
#endif /* included_unix_unix_h */