Print this page
Commit IPMP changes

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libipadm/common/ipadm_ipmgmt.h
          +++ new/usr/src/lib/libipadm/common/ipadm_ipmgmt.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  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   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  23   24   */
  24   25  
  25   26  #ifndef _IPADM_IPMGMT_H
  26   27  #define _IPADM_IPMGMT_H
  27   28  
  28   29  #ifdef  __cplusplus
  29   30  extern "C" {
  30   31  #endif
  31   32  #include <sys/types.h>
  32   33  #include <sys/stat.h>
↓ open down ↓ 16 lines elided ↑ open up ↑
  49   50   */
  50   51  /*
  51   52   * For more information on these definitions please refer to the top of
  52   53   * ipadm_persist.c. These are the name of the nvpairs which hold the
  53   54   * respective values. All nvpairs private to ipadm have names that begin
  54   55   * with "_". Note below that 'prefixlen' is an address property and therefore
  55   56   * not a private nvpair name.
  56   57   */
  57   58  #define IPADM_NVP_PROTONAME     "_protocol"     /* protocol name */
  58   59  #define IPADM_NVP_IFNAME        "_ifname"       /* interface name */
       60 +#define IPADM_NVP_IFCLASS   "_ifclass"  /* interface class */
       61 +#define IPADM_NVP_FAMILIES      "_families"     /* interface families */
       62 +#define IPADM_NVP_GIFNAME   "_gifname" /* IPMP group interface name */
       63 +#define IPADM_NVP_MIFNAMES  "_mifnames" /* IPMP group members */
  59   64  #define IPADM_NVP_AOBJNAME      "_aobjname"     /* addrobj name */
  60   65  #define IPADM_NVP_FAMILY        "_family"       /* address family */
  61   66  #define IPADM_NVP_IPV4ADDR      "_ipv4addr"     /* name of IPv4 addr nvlist */
  62   67  #define IPADM_NVP_IPNUMADDR     "_addr"         /* local address */
  63   68  #define IPADM_NVP_IPADDRHNAME   "_aname"        /* local hostname */
  64   69  #define IPADM_NVP_IPDADDRHNAME  "_dname"        /* remote hostname */
  65   70  #define IPADM_NVP_PREFIXLEN     "prefixlen"     /* prefixlen */
  66   71  #define IPADM_NVP_IPV6ADDR      "_ipv6addr"     /* name of IPv6 addr nvlist */
  67   72  #define IPADM_NVP_DHCP          "_dhcp"         /* name of DHCP nvlist */
  68   73  #define IPADM_NVP_WAIT          "_wait"         /* DHCP timeout value */
↓ open down ↓ 30 lines elided ↑ open up ↑
  99  104  } ipadm_dbwrite_cbarg_t;
 100  105  
 101  106  /*
 102  107   * door related function declarations and data structures.
 103  108   */
 104  109  
 105  110  /* The door file for the ipmgmt (ip-interface management) daemon */
 106  111  #define IPMGMT_DOOR             "/etc/svc/volatile/ipadm/ipmgmt_door"
 107  112  #define MAXPROTONAMELEN         32
 108  113  
      114 +/*
      115 + * ia_flags used inside the arguments for interface/address commands
      116 + *
      117 + *      - APPEND updates the multi-valued ipadm DB entry with a new value
      118 + *      - REMOVE updates the multi-valued ipadm DB entry by removing a value
      119 + *      - ACTIVE updates the running configuration
      120 + *      - PERSIST updates the permanent data store
      121 + *      - INIT  indicates that operation being performed is under init
      122 + *              context
      123 + *
      124 + * These two flags are used by ipmgmt_db_update_if function,
      125 + * because it can be used to update more that one DB line
      126 + * and we need to be sure that we finished all operations,
      127 + * after the operation has finished the related flag is cleared
      128 + *
      129 + *  - UPDATE_IF - used when we need to update IPADM_NVP_FAMILIES and
      130 + *                IPADM_NVP_MIFNAMES fields
      131 + *  - UPDATE_IPMP - used when we need to update IPADM_NVP_GIFNAME
      132 + */
      133 +#define IPMGMT_APPEND   0x00000001
      134 +#define IPMGMT_REMOVE   0x00000002
      135 +#define IPMGMT_ACTIVE   0x00000004
      136 +#define IPMGMT_PERSIST  0x00000008
      137 +#define IPMGMT_INIT     0x00000010
      138 +#define IPMGMT_UPDATE_IF    0x00000020
      139 +#define IPMGMT_UPDATE_IPMP  0x00000040
      140 +
      141 +
 109  142  /* door call command type */
 110  143  typedef enum {
 111  144          IPMGMT_CMD_SETPROP = 1,         /* persist property */
 112  145          IPMGMT_CMD_SETIF,               /* persist interface */
 113  146          IPMGMT_CMD_SETADDR,             /* persist address */
 114  147          IPMGMT_CMD_GETPROP,             /* retrieve persisted property value */
 115  148          IPMGMT_CMD_GETIF,               /* retrieve persisted interface conf. */
 116  149          IPMGMT_CMD_GETADDR,             /* retrieve persisted addresses */
 117  150          IPMGMT_CMD_RESETIF,             /* purge interface configuration */
 118  151          IPMGMT_CMD_RESETADDR,           /* purge address configuration */
 119  152          IPMGMT_CMD_RESETPROP,           /* purge property configuration */
 120  153          IPMGMT_CMD_INITIF,              /* retrieve interfaces to initialize */
 121  154          IPMGMT_CMD_ADDROBJ_LOOKUPADD,   /* addr. object lookup & add */
 122  155          IPMGMT_CMD_ADDROBJ_SETLIFNUM,   /* set lifnum on the addrobj */
 123  156          IPMGMT_CMD_ADDROBJ_ADD,         /* add addr. object to addrobj map */
 124  157          IPMGMT_CMD_LIF2ADDROBJ,         /* lifname to addrobj mapping */
 125      -        IPMGMT_CMD_AOBJNAME2ADDROBJ     /* aobjname to addrobj mapping */
      158 +        IPMGMT_CMD_AOBJNAME2ADDROBJ,    /* aobjname to addrobj mapping */
      159 +        IPMGMT_CMD_IPMP_UPDATE  /* update IPMP group members */
 126  160  } ipmgmt_door_cmd_type_t;
 127  161  
 128  162  /*
 129  163   * Note: We need to keep the size of the structure the same on amd64 and i386
 130  164   * for all door_call arguments and door_return structures.
 131  165   */
 132  166  /* door_call argument */
 133  167  typedef struct ipmgmt_arg {
 134  168          ipmgmt_door_cmd_type_t  ia_cmd;
 135  169  } ipmgmt_arg_t;
↓ open down ↓ 1 lines elided ↑ open up ↑
 137  171  /* IPMGMT_CMD_{SETPROP|GETPROP|RESETPROP} door_call argument */
 138  172  typedef struct ipmgmt_prop_arg_s {
 139  173          ipmgmt_door_cmd_type_t  ia_cmd;
 140  174          uint32_t                ia_flags;
 141  175          char                    ia_ifname[LIFNAMSIZ];
 142  176          char                    ia_aobjname[IPADM_AOBJSIZ];
 143  177          char                    ia_module[MAXPROTONAMELEN];
 144  178          char                    ia_pname[MAXPROPNAMELEN];
 145  179          char                    ia_pval[MAXPROPVALLEN];
 146  180  } ipmgmt_prop_arg_t;
 147      -/*
 148      - * ia_flags used in ipmgmt_prop_arg_t.
 149      - *      - APPEND updates the multi-valued property entry with a new value
 150      - *      - REDUCE updates the multi-valued property entry by removing a value
 151      - */
 152      -#define IPMGMT_APPEND   0x00000001
 153      -#define IPMGMT_REMOVE   0x00000002
 154  181  
 155  182  /* IPMGMT_CMD_GETIF door_call argument structure */
 156  183  typedef struct ipmgmt_getif_arg_s {
 157  184          ipmgmt_door_cmd_type_t  ia_cmd;
 158  185          uint32_t        ia_flags;
 159  186          char            ia_ifname[LIFNAMSIZ];
 160  187  } ipmgmt_getif_arg_t;
 161  188  
 162  189  /* IPMGMT_CMD_RESETIF, IPMGMT_CMD_SETIF door_call argument structure */
 163  190  typedef struct ipmgmt_if_arg_s {
 164  191          ipmgmt_door_cmd_type_t  ia_cmd;
 165  192          uint32_t                ia_flags;
 166  193          char                    ia_ifname[LIFNAMSIZ];
 167  194          sa_family_t             ia_family;
      195 +    ipadm_if_class_t    ia_ifclass;
 168  196  } ipmgmt_if_arg_t;
 169  197  
 170  198  /* IPMGMT_CMD_INITIF door_call argument structure */
 171  199  typedef struct ipmgmt_initif_arg_s {
 172  200          ipmgmt_door_cmd_type_t  ia_cmd;
 173  201          uint32_t        ia_flags;
 174  202          sa_family_t     ia_family;
 175  203          size_t          ia_nvlsize;
 176  204          /* packed nvl follows */
 177  205  } ipmgmt_initif_arg_t;
 178  206  
      207 +/* IPMGMT_CMD_IPMP_UPDATE door_call argument structure */
      208 +typedef struct ipmgmt_ipmp_update_arg_s {
      209 +        ipmgmt_door_cmd_type_t  ia_cmd;
      210 +        uint32_t        ia_flags;
      211 +        char            ia_gifname[LIFNAMSIZ]; /* group interface name */
      212 +        char    ia_mifname[LIFNAMSIZ]; /* group's member interface name */
      213 +} ipmgmt_ipmp_update_arg_t;
      214 +
 179  215  /* IPMGMT_CMD_SETADDR door_call argument */
 180  216  typedef struct ipmgmt_setaddr_arg_s {
 181  217          ipmgmt_door_cmd_type_t  ia_cmd;
 182  218          uint32_t                ia_flags;
 183  219          size_t                  ia_nvlsize;
 184  220          /* packed nvl follows */
 185  221  } ipmgmt_setaddr_arg_t;
 186  222  
 187  223  /* IPMGMT_CMD_GETADDR door_call argument */
 188  224  typedef struct ipmgmt_getaddr_arg_s {
↓ open down ↓ 19 lines elided ↑ open up ↑
 208  244  typedef struct ipmgmt_aobjop_arg_s {
 209  245          ipmgmt_door_cmd_type_t  ia_cmd;
 210  246          uint32_t                ia_flags;
 211  247          char                    ia_aobjname[IPADM_AOBJSIZ];
 212  248          char                    ia_ifname[LIFNAMSIZ];
 213  249          int32_t                 ia_lnum;
 214  250          sa_family_t             ia_family;
 215  251          ipadm_addr_type_t       ia_atype;
 216  252  } ipmgmt_aobjop_arg_t;
 217  253  
 218      -/*
 219      - * ia_flags used inside the arguments for interface/address commands
 220      - *      - ACTIVE updates the running configuration
 221      - *      - PERSIST updates the permanent data store
 222      - *      - INIT  indicates that operation being performed is under init
 223      - *                  context
 224      - */
 225      -#define IPMGMT_ACTIVE           0x00000001
 226      -#define IPMGMT_PERSIST          0x00000002
 227      -#define IPMGMT_INIT             0x00000004
 228      -
 229  254  /* door call return value */
 230  255  typedef struct ipmgmt_retval_s {
 231  256          int32_t ir_err;
 232  257  } ipmgmt_retval_t;
 233  258  
 234  259  /* IPMGMT_CMD_GETADDR door_return value */
 235  260  typedef struct ipmgmt_get_rval_s {
 236  261          int32_t         ir_err;
 237  262          size_t          ir_nvlsize;
 238  263          /* packed nvl follows */
↓ open down ↓ 48 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX