Print this page
Commit IPMP changes
@@ -18,10 +18,11 @@
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _LIBIPADM_H
#define _LIBIPADM_H
#ifdef __cplusplus
@@ -34,10 +35,12 @@
#include <netdb.h>
#include <ifaddrs.h>
#include <libnvpair.h>
#include <netinet/tcp.h>
#include <sys/stropts.h>
+#include <sys/list.h>
+#include <stddef.h>
#define IPADM_AOBJ_USTRSIZ 32
#define IPADM_AOBJSIZ (LIFNAMSIZ + IPADM_AOBJ_USTRSIZ)
#define MAXPROPVALLEN 512
#define LOOPBACK_IF "lo0"
@@ -189,16 +192,33 @@
IFIS_FAILED, /* Interface has failed. */
IFIS_OFFLINE, /* Interface has been offlined */
IFIS_DISABLED /* Interface has been disabled. */
} ipadm_if_state_t;
+typedef list_t ipadm_ipmp_members_t;
+
+typedef struct {
+ list_node_t node;
+ char if_name[LIFNAMSIZ];
+} ipadm_ipmp_member_t;
+
+typedef enum {
+ IPADM_IF_CLASS_REGULAR,
+ IPADM_IF_CLASS_IPMP,
+ IPADM_IF_CLASS_VIRTUAL,
+ IPADM_IF_CLASS_UNKNOWN
+} ipadm_if_class_t;
+
typedef struct ipadm_if_info_s {
struct ipadm_if_info_s *ifi_next;
char ifi_name[LIFNAMSIZ]; /* interface name */
+ ipadm_if_class_t ifi_class; /* interface class */
ipadm_if_state_t ifi_state; /* see above */
uint_t ifi_cflags; /* current flags */
uint_t ifi_pflags; /* persistent flags */
+ ipadm_ipmp_members_t ifi_ipmp_cmembers; /* current IPMP group members */
+ ipadm_ipmp_members_t ifi_ipmp_pmembers; /* persistent IPMP grp members */
} ipadm_if_info_t;
/* ipadm_if_info_t flags */
#define IFIF_BROADCAST 0x00000001
#define IFIF_MULTICAST 0x00000002
@@ -268,10 +288,14 @@
ipadm_if_info_t **, uint32_t, int64_t);
extern void ipadm_free_if_info(ipadm_if_info_t *);
extern ipadm_status_t ipadm_delete_if(ipadm_handle_t, const char *,
sa_family_t, uint32_t);
extern void ipadm_if_move(ipadm_handle_t, const char *);
+extern ipadm_status_t ipadm_add_ipmp_member(ipadm_handle_t, const char *,
+ const char *, uint32_t);
+extern ipadm_status_t ipadm_remove_ipmp_member(ipadm_handle_t, const char *,
+ const char *, uint32_t);
/*
* Address management functions
*/
extern ipadm_status_t ipadm_create_addr(ipadm_handle_t, ipadm_addrobj_t,