Print this page
NEX-6864 cannot create functional link-based IPMP interface
NEX-7793 unable to add/remove interface with existing address to/from IPMP group
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
OS-161: Integrate IPMP changes

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libipadm/common/libipadm_impl.h
          +++ new/usr/src/lib/libipadm/common/libipadm_impl.h
↓ open down ↓ 10 lines elided ↑ open up ↑
  11   11   * and limitations under the License.
  12   12   *
  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   23   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23   24   * Copyright (c) 2013 by Delphix. All rights reserved.
       25 + * Copyright 2016 Nexenta Systems, Inc.
  24   26   * Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
  25   27   */
  26   28  
  27   29  #ifndef _LIBIPADM_IMPL_H
  28   30  #define _LIBIPADM_IMPL_H
  29   31  
  30   32  #ifdef  __cplusplus
  31   33  extern "C" {
  32   34  #endif
  33   35  
  34   36  #include <sys/socket.h>
       37 +#include <sys/list.h>
  35   38  #include <net/if.h>
  36   39  #include <libipadm.h>
  37   40  #include <libdladm.h>
  38   41  #include <ipadm_ipmgmt.h>
  39   42  #include <inet/tunables.h>
  40   43  #include <netinet/in.h>
  41   44  #include <pthread.h>
  42   45  #include <libinetutil.h>
  43   46  #include <libsocket_priv.h>
  44   47  
  45   48  #define IPADM_STRSIZE           256
  46   49  #define IPADM_ONSTR             "on"
  47   50  #define IPADM_OFFSTR            "off"
  48   51  #define ARP_MOD_NAME            "arp"
  49   52  #define IPADM_LOGICAL_SEP       ':'
  50   53  #define IPV6_MIN_MTU            1280    /* rfc2460 */
  51   54  
  52   55  /* mask for flags accepted by libipadm functions */
  53   56  #define IPADM_COMMON_OPT_MASK   (IPADM_OPT_ACTIVE | IPADM_OPT_PERSIST)
  54   57  
       58 +typedef enum {
       59 +    IPADM_ADD_IPMP,
       60 +    IPADM_REMOVE_IPMP
       61 +} ipadm_ipmp_op_t;
       62 +
  55   63  /* Opaque library handle */
  56   64  struct ipadm_handle {
  57   65          int             iph_sock;       /* socket to interface */
  58   66          int             iph_sock6;      /* socket to interface */
  59   67          int             iph_door_fd;    /* door descriptor to ipmgmtd */
  60   68          int             iph_rtsock;     /* routing socket */
  61   69          dladm_handle_t  iph_dlh;        /* handle to libdladm library */
  62   70          uint32_t        iph_flags;      /* internal flags */
  63   71          pthread_mutex_t iph_lock;       /* lock to set door_fd */
  64   72          zoneid_t        iph_zoneid;     /* zoneid where handle was opened */
↓ open down ↓ 82 lines elided ↑ open up ↑
 147  155  extern ipadm_status_t   i_ipadm_init_ifobj(ipadm_handle_t, const char *,
 148  156                              nvlist_t *);
 149  157  extern ipadm_status_t   i_ipadm_init_addrobj(ipadm_handle_t, nvlist_t *);
 150  158  extern ipadm_status_t   i_ipadm_addr_persist(ipadm_handle_t,
 151  159                              const ipadm_addrobj_t, boolean_t, uint32_t,
 152  160                              const char *);
 153  161  extern ipadm_status_t   i_ipadm_delete_addr(ipadm_handle_t, ipadm_addrobj_t);
 154  162  extern int              i_ipadm_strioctl(int, int, char *, int);
 155  163  extern boolean_t        i_ipadm_is_loopback(const char *);
 156  164  extern boolean_t        i_ipadm_is_vni(const char *);
 157      -extern boolean_t        i_ipadm_is_ipmp(ipadm_handle_t, const char *);
 158      -extern boolean_t        i_ipadm_is_under_ipmp(ipadm_handle_t, const char *);
 159  165  extern boolean_t        i_ipadm_is_6to4(ipadm_handle_t, char *);
 160  166  extern boolean_t        i_ipadm_validate_ifname(ipadm_handle_t, const char *);
 161  167  extern ipadm_status_t   ipadm_errno2status(int);
 162  168  extern int              ipadm_door_call(ipadm_handle_t, void *, size_t, void **,
 163  169                              size_t, boolean_t);
 164  170  extern boolean_t        ipadm_if_enabled(ipadm_handle_t, const char *,
 165  171                              sa_family_t);
      172 +extern ipadm_status_t i_ipadm_call_ipmgmtd(ipadm_handle_t, void *,
      173 +            size_t, nvlist_t **);
 166  174  
 167  175  /* ipadm_ndpd.c */
 168  176  extern  ipadm_status_t  i_ipadm_create_ipv6addrs(ipadm_handle_t,
 169  177                              ipadm_addrobj_t, uint32_t);
 170  178  extern ipadm_status_t   i_ipadm_delete_ipv6addrs(ipadm_handle_t,
 171  179                              ipadm_addrobj_t);
 172  180  extern ipadm_status_t   i_ipadm_disable_autoconf(const char *);
 173  181  extern ipadm_status_t   i_ipadm_enable_autoconf(const char *);
 174  182  
 175  183  /* ipadm_persist.c */
↓ open down ↓ 4 lines elided ↑ open up ↑
 180  188  
 181  189  /* ipadm_prop.c */
 182  190  extern ipadm_status_t   i_ipadm_persist_propval(ipadm_handle_t,
 183  191                              ipadm_prop_desc_t *, const char *, const void *,
 184  192                              uint_t);
 185  193  extern ipadm_status_t   i_ipadm_get_persist_propval(ipadm_handle_t,
 186  194                              ipadm_prop_desc_t *, char *, uint_t *,
 187  195                              const void *);
 188  196  
 189  197  /* ipadm_addr.c */
      198 +extern ipadm_status_t   i_ipadm_active_addr_info(ipadm_handle_t, const char *,
      199 +                            ipadm_addr_info_t **, uint32_t, int64_t);
 190  200  extern void             i_ipadm_init_addr(ipadm_addrobj_t, const char *,
 191  201                              const char *, ipadm_addr_type_t);
 192  202  extern ipadm_status_t   i_ipadm_merge_addrprops_from_nvl(nvlist_t *, nvlist_t *,
 193  203                              const char *);
 194  204  extern ipadm_status_t   i_ipadm_get_addrobj(ipadm_handle_t, ipadm_addrobj_t);
 195  205  extern ipadm_status_t   i_ipadm_enable_static(ipadm_handle_t, const char *,
 196  206                              nvlist_t *, sa_family_t);
 197  207  extern ipadm_status_t   i_ipadm_enable_dhcp(ipadm_handle_t, const char *,
 198  208                              nvlist_t *);
 199  209  extern ipadm_status_t   i_ipadm_enable_addrconf(ipadm_handle_t, const char *,
↓ open down ↓ 23 lines elided ↑ open up ↑
 223  233  extern ipadm_status_t   i_ipadm_plumb_if(ipadm_handle_t, char *, sa_family_t,
 224  234                              uint32_t);
 225  235  extern ipadm_status_t   i_ipadm_unplumb_if(ipadm_handle_t, const char *,
 226  236                              sa_family_t);
 227  237  extern ipadm_status_t   i_ipadm_if_pexists(ipadm_handle_t, const char *,
 228  238                              sa_family_t, boolean_t *);
 229  239  extern ipadm_status_t   i_ipadm_delete_ifobj(ipadm_handle_t, const char *,
 230  240                              sa_family_t, boolean_t);
 231  241  extern int              i_ipadm_get_lnum(const char *);
 232  242  
      243 +extern ipadm_status_t i_ipadm_set_groupname_active(ipadm_handle_t,
      244 +            const char *, const char *);
      245 +extern ipadm_status_t i_ipadm_get_groupname_active(ipadm_handle_t,
      246 +            const char *, char *, size_t);
      247 +extern boolean_t i_ipadm_is_under_ipmp(ipadm_handle_t, const char *);
      248 +extern boolean_t i_ipadm_is_ipmp(ipadm_handle_t, const char *);
 233  249  #ifdef  __cplusplus
 234  250  }
 235  251  #endif
 236  252  
 237  253  #endif  /* _LIBIPADM_IMPL_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX