Print this page
Commit IPMP changes

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libipadm/common/libipadm.h
          +++ new/usr/src/lib/libipadm/common/libipadm.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  #ifndef _LIBIPADM_H
  25   26  #define _LIBIPADM_H
  26   27  
  27   28  #ifdef  __cplusplus
  28   29  extern "C" {
  29   30  #endif
  30   31  
  31   32  #include <sys/types.h>
  32   33  #include <sys/socket.h>
  33   34  #include <net/if.h>
  34   35  #include <netdb.h>
  35   36  #include <ifaddrs.h>
  36   37  #include <libnvpair.h>
  37   38  #include <netinet/tcp.h>
  38   39  #include <sys/stropts.h>
       40 +#include <sys/list.h>
       41 +#include <stddef.h>
  39   42  
  40   43  #define IPADM_AOBJ_USTRSIZ      32
  41   44  #define IPADM_AOBJSIZ           (LIFNAMSIZ + IPADM_AOBJ_USTRSIZ)
  42   45  #define MAXPROPVALLEN           512
  43   46  #define LOOPBACK_IF             "lo0"
  44   47  
  45   48  /* special timeout values for dhcp operations */
  46   49  #define IPADM_DHCP_WAIT_DEFAULT (-1)
  47   50  #define IPADM_DHCP_WAIT_FOREVER (-2)
  48   51  
↓ open down ↓ 135 lines elided ↑ open up ↑
 184  187  
 185  188  /* ipadm_if_info_t states */
 186  189  typedef enum {
 187  190          IFIS_OK,                /* Interface is usable */
 188  191          IFIS_DOWN,              /* Interface has no UP addresses */
 189  192          IFIS_FAILED,            /* Interface has failed. */
 190  193          IFIS_OFFLINE,           /* Interface has been offlined */
 191  194          IFIS_DISABLED           /* Interface has been disabled. */
 192  195  } ipadm_if_state_t;
 193  196  
      197 +typedef list_t ipadm_ipmp_members_t;
      198 +
      199 +typedef struct {
      200 +    list_node_t node;
      201 +    char if_name[LIFNAMSIZ];
      202 +} ipadm_ipmp_member_t;
      203 +
      204 +typedef enum {
      205 +    IPADM_IF_CLASS_REGULAR,
      206 +    IPADM_IF_CLASS_IPMP,
      207 +    IPADM_IF_CLASS_VIRTUAL,
      208 +    IPADM_IF_CLASS_UNKNOWN
      209 +} ipadm_if_class_t;
      210 +
 194  211  typedef struct ipadm_if_info_s {
 195  212          struct ipadm_if_info_s  *ifi_next;
 196  213          char                    ifi_name[LIFNAMSIZ];    /* interface name */
      214 +        ipadm_if_class_t ifi_class; /* interface class */
 197  215          ipadm_if_state_t        ifi_state;              /* see above */
 198  216          uint_t                  ifi_cflags;             /* current flags */
 199  217          uint_t                  ifi_pflags;             /* persistent flags */
      218 +        ipadm_ipmp_members_t    ifi_ipmp_cmembers; /* current IPMP group members */
      219 +        ipadm_ipmp_members_t    ifi_ipmp_pmembers; /* persistent IPMP grp members */
 200  220  } ipadm_if_info_t;
 201  221  
 202  222  /* ipadm_if_info_t flags */
 203  223  #define IFIF_BROADCAST          0x00000001
 204  224  #define IFIF_MULTICAST          0x00000002
 205  225  #define IFIF_POINTOPOINT        0x00000004
 206  226  #define IFIF_VIRTUAL            0x00000008
 207  227  #define IFIF_IPMP               0x00000010
 208  228  #define IFIF_STANDBY            0x00000020
 209  229  #define IFIF_INACTIVE           0x00000040
↓ open down ↓ 53 lines elided ↑ open up ↑
 263  283                              uint32_t);
 264  284  extern ipadm_status_t   ipadm_disable_if(ipadm_handle_t, const char *,
 265  285                              uint32_t);
 266  286  extern ipadm_status_t   ipadm_enable_if(ipadm_handle_t, const char *, uint32_t);
 267  287  extern ipadm_status_t   ipadm_if_info(ipadm_handle_t, const char *,
 268  288                              ipadm_if_info_t **, uint32_t, int64_t);
 269  289  extern void             ipadm_free_if_info(ipadm_if_info_t *);
 270  290  extern ipadm_status_t   ipadm_delete_if(ipadm_handle_t, const char *,
 271  291                              sa_family_t, uint32_t);
 272  292  extern void             ipadm_if_move(ipadm_handle_t, const char *);
      293 +extern ipadm_status_t ipadm_add_ipmp_member(ipadm_handle_t, const char *,
      294 +            const char *, uint32_t);
      295 +extern ipadm_status_t ipadm_remove_ipmp_member(ipadm_handle_t, const char *,
      296 +            const char *, uint32_t);
 273  297  
 274  298  /*
 275  299   * Address management functions
 276  300   */
 277  301  extern ipadm_status_t   ipadm_create_addr(ipadm_handle_t, ipadm_addrobj_t,
 278  302                              uint32_t);
 279  303  extern ipadm_status_t   ipadm_disable_addr(ipadm_handle_t, const char *,
 280  304                              uint32_t);
 281  305  extern ipadm_status_t   ipadm_enable_addr(ipadm_handle_t, const char *,
 282  306                              uint32_t);
↓ open down ↓ 83 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX