Print this page
OS-4335 ipadm_door_call should work in a branded zone without chroot
OS-4336 ipmgmtd should work in a branded zone without chroot
Reviewed by: Robert Mustacchi <rm@joyent.com>

@@ -19,10 +19,11 @@
  * CDDL HEADER END
  */
 
 /*
  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2015 Joyent, Inc.
  */
 
 #ifndef _IPMGMT_IMPL_H
 #define _IPMGMT_IMPL_H
 

@@ -132,36 +133,26 @@
 #define ADDROBJ_ADD             0x00000001
 #define ADDROBJ_DELETE          0x00000002
 #define ADDROBJ_LOOKUPADD       0x00000004
 #define ADDROBJ_SETLIFNUM       0x00000008
 
-/* Permanent data store for ipadm */
-#define IPADM_DB_FILE           "/etc/ipadm/ipadm.conf"
 #define IPADM_FILE_MODE         (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
 
 /*
  * With the initial integration of the daemon (PSARC 2010/080), the version
  * of the ipadm data-store (/etc/ipadm/ipadm.conf) was 0. A subsequent fix
  * needed an upgrade to the data-store and we bumped the version to 1.
  */
 #define IPADM_DB_VERSION        1
 
-/*
- * A temporary file created in SMF volatile filesystem. This file captures the
- * in-memory copy of list `aobjmap' on disk. This is done to recover from
- * daemon reboot (using svcadm) or crashes.
- */
-#define IPADM_TMPFS_DIR         "/etc/svc/volatile/ipadm"
-#define ADDROBJ_MAPPING_DB_FILE IPADM_TMPFS_DIR"/aobjmap.conf"
+typedef enum ipadm_path {
+        IPADM_PATH_TMPFS_DIR = 1,
+        IPADM_PATH_ADDROBJ_MAP_DB,
+        IPADM_PATH_DB,
+        IPADM_PATH_VOL_DB
+} ipadm_path_t;
 
-/*
- * A temporary copy of the ipadm configuration file might need
- * to be created if write requests are encountered during boottime
- * and the root filesystem is mounted read-only.
- */
-#define IPADM_VOL_DB_FILE       IPADM_TMPFS_DIR"/ipadm.conf"
-
 /* SCF resources required to interact with svc.configd */
 typedef struct scf_resources {
         scf_handle_t            *sr_handle;
         scf_instance_t          *sr_inst;
         scf_propertygroup_t     *sr_pg;

@@ -186,10 +177,12 @@
                             scf_resources_t *);
 extern void             ipmgmt_release_scf_resources(scf_resources_t *);
 extern boolean_t        ipmgmt_needs_upgrade(scf_resources_t *);
 extern void             ipmgmt_update_dbver(scf_resources_t *);
 
+extern void             ipmgmt_path(ipadm_path_t, char *, size_t);
+
 #ifdef  __cplusplus
 }
 #endif
 
 #endif  /* _IPMGMT_IMPL_H */