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 _IPADM_IPMGMT_H
#define _IPADM_IPMGMT_H
@@ -54,10 +55,14 @@
* with "_". Note below that 'prefixlen' is an address property and therefore
* not a private nvpair name.
*/
#define IPADM_NVP_PROTONAME "_protocol" /* protocol name */
#define IPADM_NVP_IFNAME "_ifname" /* interface name */
+#define IPADM_NVP_IFCLASS "_ifclass" /* interface class */
+#define IPADM_NVP_FAMILIES "_families" /* interface families */
+#define IPADM_NVP_GIFNAME "_gifname" /* IPMP group interface name */
+#define IPADM_NVP_MIFNAMES "_mifnames" /* IPMP group members */
#define IPADM_NVP_AOBJNAME "_aobjname" /* addrobj name */
#define IPADM_NVP_FAMILY "_family" /* address family */
#define IPADM_NVP_IPV4ADDR "_ipv4addr" /* name of IPv4 addr nvlist */
#define IPADM_NVP_IPNUMADDR "_addr" /* local address */
#define IPADM_NVP_IPADDRHNAME "_aname" /* local hostname */
@@ -104,10 +109,38 @@
/* The door file for the ipmgmt (ip-interface management) daemon */
#define IPMGMT_DOOR "/etc/svc/volatile/ipadm/ipmgmt_door"
#define MAXPROTONAMELEN 32
+/*
+ * ia_flags used inside the arguments for interface/address commands
+ *
+ * - APPEND updates the multi-valued ipadm DB entry with a new value
+ * - REMOVE updates the multi-valued ipadm DB entry by removing a value
+ * - ACTIVE updates the running configuration
+ * - PERSIST updates the permanent data store
+ * - INIT indicates that operation being performed is under init
+ * context
+ *
+ * These two flags are used by ipmgmt_db_update_if function,
+ * because it can be used to update more that one DB line
+ * and we need to be sure that we finished all operations,
+ * after the operation has finished the related flag is cleared
+ *
+ * - UPDATE_IF - used when we need to update IPADM_NVP_FAMILIES and
+ * IPADM_NVP_MIFNAMES fields
+ * - UPDATE_IPMP - used when we need to update IPADM_NVP_GIFNAME
+ */
+#define IPMGMT_APPEND 0x00000001
+#define IPMGMT_REMOVE 0x00000002
+#define IPMGMT_ACTIVE 0x00000004
+#define IPMGMT_PERSIST 0x00000008
+#define IPMGMT_INIT 0x00000010
+#define IPMGMT_UPDATE_IF 0x00000020
+#define IPMGMT_UPDATE_IPMP 0x00000040
+
+
/* door call command type */
typedef enum {
IPMGMT_CMD_SETPROP = 1, /* persist property */
IPMGMT_CMD_SETIF, /* persist interface */
IPMGMT_CMD_SETADDR, /* persist address */
@@ -120,11 +153,12 @@
IPMGMT_CMD_INITIF, /* retrieve interfaces to initialize */
IPMGMT_CMD_ADDROBJ_LOOKUPADD, /* addr. object lookup & add */
IPMGMT_CMD_ADDROBJ_SETLIFNUM, /* set lifnum on the addrobj */
IPMGMT_CMD_ADDROBJ_ADD, /* add addr. object to addrobj map */
IPMGMT_CMD_LIF2ADDROBJ, /* lifname to addrobj mapping */
- IPMGMT_CMD_AOBJNAME2ADDROBJ /* aobjname to addrobj mapping */
+ IPMGMT_CMD_AOBJNAME2ADDROBJ, /* aobjname to addrobj mapping */
+ IPMGMT_CMD_IPMP_UPDATE /* update IPMP group members */
} ipmgmt_door_cmd_type_t;
/*
* Note: We need to keep the size of the structure the same on amd64 and i386
* for all door_call arguments and door_return structures.
@@ -142,17 +176,10 @@
char ia_aobjname[IPADM_AOBJSIZ];
char ia_module[MAXPROTONAMELEN];
char ia_pname[MAXPROPNAMELEN];
char ia_pval[MAXPROPVALLEN];
} ipmgmt_prop_arg_t;
-/*
- * ia_flags used in ipmgmt_prop_arg_t.
- * - APPEND updates the multi-valued property entry with a new value
- * - REDUCE updates the multi-valued property entry by removing a value
- */
-#define IPMGMT_APPEND 0x00000001
-#define IPMGMT_REMOVE 0x00000002
/* IPMGMT_CMD_GETIF door_call argument structure */
typedef struct ipmgmt_getif_arg_s {
ipmgmt_door_cmd_type_t ia_cmd;
uint32_t ia_flags;
@@ -163,10 +190,11 @@
typedef struct ipmgmt_if_arg_s {
ipmgmt_door_cmd_type_t ia_cmd;
uint32_t ia_flags;
char ia_ifname[LIFNAMSIZ];
sa_family_t ia_family;
+ ipadm_if_class_t ia_ifclass;
} ipmgmt_if_arg_t;
/* IPMGMT_CMD_INITIF door_call argument structure */
typedef struct ipmgmt_initif_arg_s {
ipmgmt_door_cmd_type_t ia_cmd;
@@ -174,10 +202,18 @@
sa_family_t ia_family;
size_t ia_nvlsize;
/* packed nvl follows */
} ipmgmt_initif_arg_t;
+/* IPMGMT_CMD_IPMP_UPDATE door_call argument structure */
+typedef struct ipmgmt_ipmp_update_arg_s {
+ ipmgmt_door_cmd_type_t ia_cmd;
+ uint32_t ia_flags;
+ char ia_gifname[LIFNAMSIZ]; /* group interface name */
+ char ia_mifname[LIFNAMSIZ]; /* group's member interface name */
+} ipmgmt_ipmp_update_arg_t;
+
/* IPMGMT_CMD_SETADDR door_call argument */
typedef struct ipmgmt_setaddr_arg_s {
ipmgmt_door_cmd_type_t ia_cmd;
uint32_t ia_flags;
size_t ia_nvlsize;
@@ -213,21 +249,10 @@
int32_t ia_lnum;
sa_family_t ia_family;
ipadm_addr_type_t ia_atype;
} ipmgmt_aobjop_arg_t;
-/*
- * ia_flags used inside the arguments for interface/address commands
- * - ACTIVE updates the running configuration
- * - PERSIST updates the permanent data store
- * - INIT indicates that operation being performed is under init
- * context
- */
-#define IPMGMT_ACTIVE 0x00000001
-#define IPMGMT_PERSIST 0x00000002
-#define IPMGMT_INIT 0x00000004
-
/* door call return value */
typedef struct ipmgmt_retval_s {
int32_t ir_err;
} ipmgmt_retval_t;