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>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_impl.h
          +++ new/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_impl.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2015 Joyent, Inc.
  24   25   */
  25   26  
  26   27  #ifndef _IPMGMT_IMPL_H
  27   28  #define _IPMGMT_IMPL_H
  28   29  
  29   30  #ifdef  __cplusplus
  30   31  extern "C" {
  31   32  #endif
  32   33  
  33   34  #include <net/if.h>
↓ open down ↓ 93 lines elided ↑ open up ↑
 127  128  
 128  129  /* global `aobjmap' defined in ipmgmt_main.c */
 129  130  extern ipmgmt_aobjmap_list_t aobjmap;
 130  131  
 131  132  /* operations on the `aobjmap' linked list */
 132  133  #define ADDROBJ_ADD             0x00000001
 133  134  #define ADDROBJ_DELETE          0x00000002
 134  135  #define ADDROBJ_LOOKUPADD       0x00000004
 135  136  #define ADDROBJ_SETLIFNUM       0x00000008
 136  137  
 137      -/* Permanent data store for ipadm */
 138      -#define IPADM_DB_FILE           "/etc/ipadm/ipadm.conf"
 139  138  #define IPADM_FILE_MODE         (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
 140  139  
 141  140  /*
 142  141   * With the initial integration of the daemon (PSARC 2010/080), the version
 143  142   * of the ipadm data-store (/etc/ipadm/ipadm.conf) was 0. A subsequent fix
 144  143   * needed an upgrade to the data-store and we bumped the version to 1.
 145  144   */
 146  145  #define IPADM_DB_VERSION        1
 147  146  
 148      -/*
 149      - * A temporary file created in SMF volatile filesystem. This file captures the
 150      - * in-memory copy of list `aobjmap' on disk. This is done to recover from
 151      - * daemon reboot (using svcadm) or crashes.
 152      - */
 153      -#define IPADM_TMPFS_DIR         "/etc/svc/volatile/ipadm"
 154      -#define ADDROBJ_MAPPING_DB_FILE IPADM_TMPFS_DIR"/aobjmap.conf"
      147 +typedef enum ipadm_path {
      148 +        IPADM_PATH_TMPFS_DIR = 1,
      149 +        IPADM_PATH_ADDROBJ_MAP_DB,
      150 +        IPADM_PATH_DB,
      151 +        IPADM_PATH_VOL_DB
      152 +} ipadm_path_t;
 155  153  
 156      -/*
 157      - * A temporary copy of the ipadm configuration file might need
 158      - * to be created if write requests are encountered during boottime
 159      - * and the root filesystem is mounted read-only.
 160      - */
 161      -#define IPADM_VOL_DB_FILE       IPADM_TMPFS_DIR"/ipadm.conf"
 162      -
 163  154  /* SCF resources required to interact with svc.configd */
 164  155  typedef struct scf_resources {
 165  156          scf_handle_t            *sr_handle;
 166  157          scf_instance_t          *sr_inst;
 167  158          scf_propertygroup_t     *sr_pg;
 168  159          scf_property_t          *sr_prop;
 169  160          scf_value_t             *sr_val;
 170  161          scf_transaction_t       *sr_tx;
 171  162          scf_transaction_entry_t *sr_ent;
 172  163  } scf_resources_t;
↓ open down ↓ 8 lines elided ↑ open up ↑
 181  172  extern int              ipmgmt_persist_if(ipmgmt_if_arg_t *);
 182  173  extern void             ipmgmt_init_prop();
 183  174  extern boolean_t        ipmgmt_db_upgrade(void *, nvlist_t *, char *,
 184  175                              size_t, int *);
 185  176  extern int              ipmgmt_create_scf_resources(const char *,
 186  177                              scf_resources_t *);
 187  178  extern void             ipmgmt_release_scf_resources(scf_resources_t *);
 188  179  extern boolean_t        ipmgmt_needs_upgrade(scf_resources_t *);
 189  180  extern void             ipmgmt_update_dbver(scf_resources_t *);
 190  181  
      182 +extern void             ipmgmt_path(ipadm_path_t, char *, size_t);
      183 +
 191  184  #ifdef  __cplusplus
 192  185  }
 193  186  #endif
 194  187  
 195  188  #endif  /* _IPMGMT_IMPL_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX