Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/include/EGL/../libipadm.h
Real path: /usr/include/libipadm.h
Zurück
/* * Copyright (c) 2010, 2023, Oracle and/or its affiliates. */ #ifndef _LIBIPADM_H #define _LIBIPADM_H #ifdef __cplusplus extern "C" { #endif #include <stddef.h> #include <sys/types.h> #include <sys/socket.h> #include <net/if.h> #include <netdb.h> #include <ifaddrs.h> #include <libnvpair.h> #include <libdladm.h> #include <limits.h> #include <netinet/tcp.h> #include <sys/stropts.h> #include <sys/list.h> /* * WARNING * * The interfaces defined in this file are private to the implementation * of Solaris and are subject to change at any time without notice. * Applications using these interfaces may fail to run on future releases. */ /* * Version history: * v0 - Initial integration (PSARC 2010/080) * v1 - All the private protocol properties modified to begin with '_', * instead of leading protocol name. * v2 - Integration of ipmp support (PSARC/2010/341): some subcommands * removed, data-store modified. Interface class property added. * v3 - '_max_buf' tcp/sctp/udp/rawip property elevated to public status. * (PSARC/2011/053) * v4 - Update file format to be more generic for ipadm/dladm/nwam alignment. * Highlander (PSARC/2011/153) * v5 - '_ipsec_override_persocket_policy' and _*accept_clear_messages * changed and elevated to public status (PSARC/2013/058) * v6 - '_send_redirects', '_ndp_unsolicit_count', '_ndp_unsolicit_interval' * '_arp_publish_count' and '_arp_publish_interval' changed and * elevated to public status * v7 - Removal of NWAM profiles and one ipadm.conf file (PSARC/2014/269) * v8 - Public property names use '-' instead of '_' (PSARC/2014/404) * v9 - DB version changed to use bitmap * ipmgmtd/datastore_version is '511' (0x1FF) * v10 - Persistent configuration in SMF (PSARC/2015/248) * ipmgmtd/datastore_version is '1023' (0x3FF) * v11 - '_cwnd_max' elevated to public status (PSARC/2016/357) * ipmgmtd/datastore_version is '2047' (0x7FF) */ /* * IPADM_DB_HIGHLANDER_VERSION is 0x0000000F to include the fact that previous * upgrades have already been done. */ #define IPADM_DB_HIGHLANDER_VERSION 0x0000000FULL #define IPADM_DB_IPSEC_PERSOCK_VERSION 0x00000010ULL #define IPADM_DB_L3VRRP_VERSION 0x00000020ULL #define IPADM_DB_NO_NWAM_VERSION 0x00000040ULL #define IPADM_DB_UNIFORM_PROPNAME_VERSION 0x00000080ULL #define IPADM_DB_BITMAP_VERSION 0x00000100ULL #define IPADM_DB_SMF_VERSION 0x00000200ULL #define IPADM_DB_CWND_MAX_VERSION 0x00000400ULL #define IPADM_DB_VERSION (IPADM_DB_HIGHLANDER_VERSION | \ IPADM_DB_IPSEC_PERSOCK_VERSION | \ IPADM_DB_L3VRRP_VERSION | \ IPADM_DB_NO_NWAM_VERSION | \ IPADM_DB_UNIFORM_PROPNAME_VERSION | \ IPADM_DB_BITMAP_VERSION | \ IPADM_DB_SMF_VERSION | \ IPADM_DB_CWND_MAX_VERSION) /* The last version number before the conversion to bitmap */ #define IPADM_DB_OLD_MAX_VERSION 8 #define IPADM_STRSIZE 1024 #define IPADM_AOBJ_USTRSIZ 32 #define IPADM_AOBJSIZ (LIFNAMSIZ + IPADM_AOBJ_USTRSIZ) #define IPADM_OWNERSIZ 16 #define MAXPROPVALLEN 512 #define IPADM_MAXINDEX INT_MAX #define IPADM_NOINDEX -1 #define LOOPBACK_IF "lo0" #define IPADM_ONSTR "on" #define IPADM_OFFSTR "off" #define IPADM_YESSTR "yes" #define IPADM_NOSTR "no" /* special timeout values for dhcp operations */ #define IPADM_DHCP_WAIT_DEFAULT (-1) #define IPADM_DHCP_WAIT_FOREVER (-2) /* * Specifies that the string passed to ipadm_str2nvlist() is a string of comma * separated names and that each name does not have values associated with it. */ #define IPADM_NORVAL 0x00000001 /* error codes */ typedef enum { IPADM_SUCCESS, /* No error occurred */ IPADM_FAILURE, /* Generic failure */ IPADM_INSUFF_AUTH, /* Insufficient user authorizations */ IPADM_PERM_DENIED, /* Permission denied */ IPADM_NO_BUFS, /* No Buffer space available */ IPADM_NO_MEMORY, /* Insufficient memory */ IPADM_BAD_ADDR, /* Invalid address */ IPADM_INVALID_IFID, /* Invalid interface id */ IPADM_BAD_PROTOCOL, /* Wrong protocol family for operation */ IPADM_DAD_FOUND, /* Duplicate address detected */ IPADM_OBJ_EXISTS, /* Object already exists */ IPADM_IF_EXISTS, /* Interface already exists */ IPADM_ADDROBJ_EXISTS, /* Address object already exists */ IPADM_ADDRCONF_EXISTS, /* Addrconf already in progress */ IPADM_NOSUCH_IF, /* Interface does not exist */ IPADM_GRP_NOTEMPTY, /* IPMP group non-empty on unplumb */ IPADM_INVALID_ARG, /* Invalid argument */ IPADM_INVALID_IFNAME, /* Invalid interface name */ IPADM_DLPI_FAILURE, /* Could not open DLPI link */ IPADM_DLPI_NOLINK, /* Datalink does not exist */ IPADM_DLADM_FAILURE, /* DLADM error encountered */ IPADM_PROP_UNKNOWN, /* Unknown property */ IPADM_VAL_OUT_OF_RANGE, /* Value is outside the allowed range */ IPADM_VAL_NOTEXISTS, /* Value does not exist */ IPADM_VAL_OVERFLOW, /* Value(s) exceed the allowed limit */ IPADM_VAL_SOMEFAIL, /* Failed requested change for some values */ IPADM_OBJ_NOTFOUND, /* Object not found */ IPADM_IF_INUSE, /* Interface already in use */ IPADM_ADDR_INUSE, /* Address already in use */ IPADM_HOSTNAME_TO_MULTADDR, /* hostname maps to multiple IP addresses */ IPADM_CANNOT_ASSIGN_ADDR, /* Can't assign requested address */ IPADM_NDPD_NOT_RUNNING, /* in.ndpd not running */ IPADM_NDPD_IPC_TIMEOUT, /* Communication with in.ndpd timed out */ IPADM_NDPD_IO_FAILURE, /* I/O error with in.ndpd */ IPADM_CANNOT_START_DHCP, /* Cannot start dhcpagent */ IPADM_DHCP_IPC_FAILURE, /* Communication with dhcpagent failed */ IPADM_DHCP_INVALID_IF, /* DHCP client could not run on the interface */ IPADM_DHCP_IPC_TIMEOUT, /* Communication with dhcpagent timed out */ IPADM_TEMPORARY_OBJ, /* Permanent operation on temporary object */ IPADM_DAEMON_IPC_FAILURE, /* Cannot communicate with daemon */ IPADM_OP_DISABLE_OBJ, /* Operation on disable object */ IPADM_OP_NOTSUP, /* Operation not supported */ IPADM_INVALID_EXCH, /* Invalid data exchange with ipmgmtd */ IPADM_NOT_IPMPIF, /* Not an IPMP interface */ IPADM_NOSUCH_IPMPIF, /* No such IPMP interface exists */ IPADM_ALREADY_IN_GRP, /* Already in an IPMP group */ IPADM_NOSUCH_UNDERIF, /* No such underlying interface exists */ IPADM_NOT_IN_GROUP, /* Interface not in given IPMP group */ IPADM_IPMPIF_NOT_ENABLED, /* IPMP interface is not enabled */ IPADM_IPMPIF_DHCP_NOT_ENABLED, /* DHCP data address is not enabled */ IPADM_IF_NOT_FULLY_ENABLED, /* Interface could not be fully enabled */ /* * IPADM_OP_NOTSUP_TYPE: Operation not supported for object of this type */ IPADM_OP_NOTSUP_TYPE, /* * IPADM_PERSIST_OP_NOTSUP_TYPE: Persistent operation not supported * for object of this type */ IPADM_PERSIST_OP_NOTSUP_TYPE, /* * IPADM_TEMPORARY_OP_NOTSUP_TYPE: Temporary operation not supported * for this property */ IPADM_TEMPORARY_OP_NOTSUP, /* * IPADM_UNDERIF_APP_ADDRS: Underlying interface has addresses managed * by external applications */ IPADM_UNDERIF_APP_ADDRS, /* * IPADM_UNDERIF_DHCP_MANAGED: Underlying interface has addresses * managed by dhcpagent(8) */ IPADM_UNDERIF_DHCP_MANAGED, /* * IPADM_UNDERIF_NDPD_MANAGED: Underlying interface has addresses * managed by in.ndpd(8) */ IPADM_UNDERIF_NDPD_MANAGED, /* * IPADM_UNDERIF_UP_ADDRS: Underlying interface has addresses marked up */ IPADM_UNDERIF_UP_ADDRS, /* * IPADM_IPMPIF_MISSING_AF: IPMP interface missing address families * configured on underlying interface */ IPADM_IPMPIF_MISSING_AF, /* * IPADM_ADDROBJ_NOT_CREATED : For one or more of the migrated data * addresses in the legacy case, an address object could not be created. */ IPADM_ADDROBJ_NOT_CREATED, IPADM_ROUTE_NOTFOUND, /* Route not found */ IPADM_ROUTE_EXISTS, /* Route already exists */ IPADM_ROUTE_FAILURE, /* Failed to modify or delete a route */ IPADM_FROMGZ_ROUTE_FAILURE, /* Cannot create fromgz route */ IPADM_VRRP_INVALID_VRNAME, /* Invalid VRRP router name */ IPADM_VRRP_INVALID_AF, /* Invalid VRRP router address family */ IPADM_ALREADY_GRP_MEMBER, /* Already belongs to IPMP group */ /* * IPADM_NOSUCH_SRC_IF: Cannot set 'usesrc' property value to * interface that does not exist */ IPADM_NOSUCH_SRC_IF, IPADM_WRITE_OP_NOTSUP /* Write operation not supported */ } ipadm_status_t; /* * option flags taken by the libipadm functions * * - IPADM_OPT_PERSIST: * For all the create/delete/up/down/set/get functions, * requests to persist the configuration so that it can be * re-enabled or reapplied on boot. * * - IPADM_OPT_ACTIVE: * Requests to apply configuration without persisting it and * used by show-* subcommands to retrieve current values. * * - IPADM_OPT_DEFAULT: * retrieves the default value for a given property * * - IPADM_OPT_PERM * retrieves the permission for a given property * * - IPADM_OPT_POSSIBLE * retrieves the range of values for a given property * * - IPADM_OPT_APPEND * for multi-valued properties, appends a new value. * * - IPADM_OPT_REMOVE * for multi-valued properties, removes the specified value * * - IPADM_OPT_GENPPA * Used in ipadm_create_ipmp() to generate a ppa for the given IPMP * interface. * * - IPADM_OPT_ZEROADDR * return :: or INADDR_ANY * * - IPADM_OPT_RELEASE * Used to release the lease on a dhcp address object * * - IPADM_OPT_INFORM * Used to perform DHCP_INFORM on a specified static address object * * - IPADM_OPT_UP * Used to bring up a static address on creation * * - IPADM_OPT_FORCE * Used in ipadm_delete_ipmp() to forcefully delete an IPMP interface * even when it has underlying interfaces. * * - IPADM_OPT_MODIFY * Used to modify only the active configuration even when the * configuration is persistent. Used to update an addrconf interface id. * * - IPADM_OPT_CREATEONLY * Used to only create the interface. * * - IPADM_OPT_DONTCREATE * Used to skip creation of the interface. * * - IPADM_OPT_NOVRNAME * Used to skip the vrrp router name information for the active addr_info. * This option is only used by vrrpd, to avoid querying into itself. * * - IPADM_OPT_ENABLEDEP * Used when enabling an interface to signify whether or not any * dependency interfaces should be enabled. * * - IPADM_OPT_NOWAIT * Used to specify that the wait time should be set to 0 for DHCP * operations, (potentially) overriding the persistent wait value given * for the addrobj. * * - IPADM_OPT_DESCRIPTION * retrieves the description of the property * * - IPADM_OPT_VALDESCRIPTION * retrieves the descriptions of the possible values of a given property * * - IPADM_OPT_INTERACTIVE * Indicates library functions may issue warnings that are only appropriate * in the context of an interactive command. * * - IPADM_OPT_IPV6_ZONEID * Used to tell library functions which generate address strings to * include the IPv6 zone suffix on link local addresses. * * - IPADM_OPT_NUMERIC_ADDR * Used to tell library functions which generate address strings to * only return the numeric form of the address. */ #define IPADM_OPT_PERSIST 0x00000001 #define IPADM_OPT_ACTIVE 0x00000002 #define IPADM_OPT_DEFAULT 0x00000004 #define IPADM_OPT_PERM 0x00000008 #define IPADM_OPT_POSSIBLE 0x00000010 #define IPADM_OPT_APPEND 0x00000020 #define IPADM_OPT_REMOVE 0x00000040 #define IPADM_OPT_GENPPA 0x00000080 #define IPADM_OPT_ZEROADDR 0x00000100 #define IPADM_OPT_RELEASE 0x00000200 #define IPADM_OPT_INFORM 0x00000400 #define IPADM_OPT_UP 0x00000800 #define IPADM_OPT_FORCE 0x00001000 #define IPADM_OPT_MODIFY 0x00002000 #define IPADM_OPT_CREATEONLY 0x00004000 #define IPADM_OPT_DONTCREATE 0x00008000 #define IPADM_OPT_NOVRNAME 0x00010000 #define IPADM_OPT_ENABLEDEP 0x00020000 #define IPADM_OPT_NOWAIT 0x00040000 #define IPADM_OPT_DESCRIPTION 0x00080000 #define IPADM_OPT_VALDESCRIPTION 0x00100000 #define IPADM_OPT_INTERACTIVE 0x00200000 #define IPADM_OPT_IPV6_ZONEID 0x00400000 #define IPADM_OPT_NUMERIC_ADDR 0x00800000 /* IPADM property class */ #define IPADMPROP_CLASS_MODULE 0x00000001 /* on 'protocol' only */ #define IPADMPROP_CLASS_IF 0x00000002 /* on 'IP interface' only */ #define IPADMPROP_CLASS_ADDR 0x00000004 /* on 'IP address' only */ /* protocol property that can be applied on interface too */ #define IPADMPROP_CLASS_MODIF (IPADMPROP_CLASS_MODULE | IPADMPROP_CLASS_IF) /* opaque ipadm handle to libipadm functions */ struct ipadm_handle; typedef struct ipadm_handle *ipadm_handle_t; /* ipadm_handle flags */ #define IH_VRRP 0x00000001 /* Caller is VRRP */ #define IH_LEGACY 0x00000002 /* Caller is legacy app */ /* * Indicates that the operation being invoked is in 'init' context. This is * a library private flag. */ #define IH_INIT 0x10000000 #define IPADM_LIFC_DEFAULT (LIFC_NOXMIT | LIFC_TEMPORARY | LIFC_ALLZONES |\ LIFC_UNDER_IPMP) /* * Interface classes. These constants are committed to disk, as part of storing * the persistent configuration. These should not be changed without upgrading * the persistent configuration to match the enum values. */ typedef enum { IPADMIF_CLASS_NONE = -1, IPADMIF_CLASS_IP, IPADMIF_CLASS_IPMP, IPADMIF_CLASS_LOOPBACK, IPADMIF_CLASS_VNI } ipadm_if_class_t; #define IPADMIF_CLASS_IP_STR "ip" #define IPADMIF_CLASS_IPMP_STR "ipmp" #define IPADMIF_CLASS_LOOPBACK_STR "loopback" #define IPADMIF_CLASS_VNI_STR "vni" #define IPADMIF_CLASS2FLAG(c) (1 << c) #define IPADMIF_CLASS_IP_FLAG IPADMIF_CLASS2FLAG(IPADMIF_CLASS_IP) #define IPADMIF_CLASS_IPMP_FLAG IPADMIF_CLASS2FLAG(IPADMIF_CLASS_IPMP) #define IPADMIF_CLASS_LOOPBACK_FLAG \ IPADMIF_CLASS2FLAG(IPADMIF_CLASS_LOOPBACK) #define IPADMIF_CLASS_VNI_FLAG \ IPADMIF_CLASS2FLAG(IPADMIF_CLASS_VNI) #define IPADMIF_CLASS_ALL_FLAG \ (IPADMIF_CLASS_IP_FLAG | IPADMIF_CLASS_IPMP_FLAG | \ IPADMIF_CLASS_LOOPBACK_FLAG | IPADMIF_CLASS_VNI_FLAG) #define IPADMIF_CLASS_NONVNI_FLAG \ (IPADMIF_CLASS_ALL_FLAG & ~IPADMIF_CLASS_VNI_FLAG) #define IPADMIF_FAMILY_IPV4_STR "ipv4" #define IPADMIF_FAMILY_IPV6_STR "ipv6" /* opaque address object structure */ typedef struct ipadm_addrobj_s *ipadm_addrobj_t; /* ipadm_if_info_t states */ typedef enum { IPADM_IFS_DOWN, /* Interface has no UP addresses */ IPADM_IFS_OK, /* Interface is usable */ IPADM_IFS_FAILED, /* Interface has failed. */ IPADM_IFS_OFFLINE, /* Interface has been offlined */ IPADM_IFS_DISABLED /* Interface has been disabled. */ } ipadm_if_state_t; typedef struct ipadm_iflist_s { list_node_t ifn_link; char ifn_name[LIFNAMSIZ]; } ipadm_ifname_t; typedef struct ipadm_if_info_s { list_node_t ifi_link; char ifi_name[LIFNAMSIZ]; /* interface name */ ipadm_if_class_t ifi_class; /* interface class */ boolean_t ifi_active; /* active or not */ ipadm_if_state_t ifi_state; /* see above */ uint_t ifi_cflags; /* current flags */ uint_t ifi_pflags; /* persistent flags */ /* * ifi_unders: list of underlying interfaces in the * running configuration for the IPMP interface, * each of type `ipadm_ifname_t'. */ list_t ifi_unders; /* * ifi_punders: list of underlying interfaces in the * persistent configuration for the IPMP interface, * each of type `ipadm_ifname_t'. */ list_t ifi_punders; } ipadm_if_info_t; /* ipadm_if_info_t flags */ #define IPADM_IFF_BROADCAST 0x00000001 #define IPADM_IFF_MULTICAST 0x00000002 #define IPADM_IFF_POINTOPOINT 0x00000004 #define IPADM_IFF_VIRTUAL 0x00000008 #define IPADM_IFF_STANDBY 0x00000010 #define IPADM_IFF_INACTIVE 0x00000020 #define IPADM_IFF_VRRP 0x00000040 #define IPADM_IFF_NOACCEPT 0x00000080 #define IPADM_IFF_IPV4 0x00000100 #define IPADM_IFF_IPV6 0x00000200 #define IPADM_IFF_L3PROTECT 0x00000400 #define IPADM_IFF_UNDERIF 0x00000800 /* ipadm_addr_info_t state */ typedef enum { IPADM_ADDRS_DISABLED, /* Address not in active configuration. */ IPADM_ADDRS_DUPLICATE, /* DAD failed. */ IPADM_ADDRS_DOWN, /* Address is not IFF_UP */ IPADM_ADDRS_TENTATIVE, /* DAD verification initiated */ IPADM_ADDRS_OK, /* Address is usable */ IPADM_ADDRS_INACCESSIBLE /* Interface has failed */ } ipadm_addr_state_t; /* possible address types */ typedef enum { IPADM_ADDR_NONE, IPADM_ADDR_STATIC, IPADM_ADDR_IPV6_ADDRCONF, IPADM_ADDR_DHCP, IPADM_ADDR_VRRP } ipadm_addr_type_t; #define IPADM_ADDR_STATIC_STR "static" #define IPADM_ADDR_IPV6_ADDRCONF_STR "addrconf" #define IPADM_ADDR_DHCP_STR "dhcp" #define IPADM_ADDR_VRRP_STR "vrrp" #define IPADM_ADDRTYPE2FLAG(a) (1 << a) #define IPADM_ADDR_STATIC_FLAG IPADM_ADDRTYPE2FLAG(IPADM_ADDR_STATIC) #define IPADM_ADDR_IPV6_ADDRCONF_FLAG \ IPADM_ADDRTYPE2FLAG(IPADM_ADDR_IPV6_ADDRCONF) #define IPADM_ADDR_DHCP_FLAG IPADM_ADDRTYPE2FLAG(IPADM_ADDR_DHCP) #define IPADM_ADDR_VRRP_FLAG IPADM_ADDRTYPE2FLAG(IPADM_ADDR_VRRP) #define IPADM_ADDR_ALL_FLAG \ (IPADM_ADDR_STATIC_FLAG | IPADM_ADDR_IPV6_ADDRCONF_FLAG | \ IPADM_ADDR_DHCP_FLAG | IPADM_ADDR_VRRP_FLAG) #define IPADM_ADDR_NOT_ADDRCONF_FLAG \ (IPADM_ADDR_ALL_FLAG & ~IPADM_ADDR_IPV6_ADDRCONF_FLAG) /* possible Client ID types */ typedef enum { IPADM_CID_DEFAULT = -1, IPADM_CID_OTHER, IPADM_CID_DUID_LLT, IPADM_CID_DUID_LL, IPADM_CID_DUID_EN } ipadm_cid_type_t; typedef struct ipadm_addr_info_s { struct ifaddrs ia_ifa; /* list of addresses */ char ia_sname[NI_MAXHOST]; /* local hostname */ char ia_dname[NI_MAXHOST]; /* remote hostname */ char ia_aobjname[IPADM_AOBJSIZ]; char ia_vrname[VRRP_NAME_MAX]; uint_t ia_cflags; /* active flags */ uint_t ia_pflags; /* persistent flags */ ipadm_addr_type_t ia_atype; /* see above */ ipadm_addr_state_t ia_state; /* see above */ uint64_t ia_lease_begin; uint64_t ia_lease_expire; uint64_t ia_lease_renew; ipadm_cid_type_t ia_clientid_type; char *ia_clientid; } ipadm_addr_info_t; #define IA_NEXT(ia) ((ipadm_addr_info_t *)(ia->ia_ifa.ifa_next)) /* ipadm_addr_info_t flags */ #define IPADM_ADDRF_UP 0x00000001 #define IPADM_ADDRF_UNNUMBERED 0x00000002 #define IPADM_ADDRF_PRIVATE 0x00000004 #define IPADM_ADDRF_TEMPORARY 0x00000008 #define IPADM_ADDRF_DEPRECATED 0x00000010 #define IPADM_ADDRF_DHCP 0x00000020 #define IPADM_ADDRF_STATELESS 0x00000040 #define IPADM_ADDRF_WAITFOR 0x00000080 #define IPADM_ADDRF_STATEFUL 0x00000100 #define IPADM_ADDRF_ACTIVE 0x00000200 /* * These dhcpagent and in.ndpd related properties are defined here so that it * can be shared with ipadm.c. The other properties are defined in * ipadm_ipmgmt.h. */ #define IPADM_NVP_STATELESS "stateless" #define IPADM_NVP_STATEFUL "stateful" #define IPADM_NVP_REQHOST DHCP_PARAM_REQHOST #define IPADM_NVP_VERIFIED_LEASE DHCP_PARAM_VERIFIED_LEASE #define IPADM_NVP_OFFER_WAIT DHCP_PARAM_OFFER_WAIT #define IPADM_NVP_CLIENT_ID DHCP_PARAM_CLIENT_ID #define IPADM_NVP_PARAM_REQUEST DHCP_PARAM_PARAM_REQUEST_LIST #define IPADM_NVP_PARAM_IGNORE DHCP_PARAM_PARAM_IGNORE_LIST #define IPADM_NVP_PACKET_BURST_LIMIT DHCP_PARAM_PACKET_BURST_LIMIT #define MAXBOOLSTRLEN 16 #define MAXCLIENTIDLEN 256 #define MAXPARAMLISTLEN 1024 /* open/close libipadm handle */ extern ipadm_status_t ipadm_open(ipadm_handle_t *, uint32_t, const char *); extern void ipadm_close(ipadm_handle_t); /* Check authorization for network configuration */ extern boolean_t ipadm_check_auth(void); /* * Interface mangement functions */ extern ipadm_status_t ipadm_create_ip(ipadm_handle_t, const char *, sa_family_t, uint32_t); extern ipadm_status_t ipadm_delete_ip(ipadm_handle_t, const char *, sa_family_t, uint32_t); extern ipadm_status_t ipadm_create_vni(ipadm_handle_t, const char *, sa_family_t, uint32_t); extern ipadm_status_t ipadm_delete_vni(ipadm_handle_t, const char *, sa_family_t, uint32_t); extern ipadm_status_t ipadm_create_loopback(ipadm_handle_t, const char *, sa_family_t, uint32_t); extern ipadm_status_t ipadm_delete_loopback(ipadm_handle_t, const char *, sa_family_t, uint32_t); extern ipadm_status_t ipadm_create_ipmp(ipadm_handle_t, char *, sa_family_t, uint32_t); extern ipadm_status_t ipadm_delete_ipmp(ipadm_handle_t, const char *, sa_family_t, uint32_t); extern ipadm_status_t ipadm_add_ipmp(ipadm_handle_t, const char *, const char *, uint32_t); extern ipadm_status_t ipadm_remove_ipmp(ipadm_handle_t, const char *, const char *, uint32_t); extern ipadm_status_t ipadm_disable_if(ipadm_handle_t, const char *, uint32_t); extern ipadm_status_t ipadm_enable_if(ipadm_handle_t, const char *, uint32_t); extern ipadm_status_t ipadm_ngz_persist_ifs(ipadm_handle_t); extern ipadm_status_t ipadm_init_fromgz_ifs(ipadm_handle_t); extern ipadm_status_t ipadm_if_info(ipadm_handle_t, const char *, list_t *, uint32_t, int64_t); extern void ipadm_free_if_info(list_t *); /* * Helper functions */ extern ipadm_status_t ipadm_create_ipmp_implicit(ipadm_handle_t, const char *); extern ipadm_status_t ipadm_mark_testaddrs(ipadm_handle_t, const char *); extern ipadm_status_t ipadm_clear_testaddrs(ipadm_handle_t, const char *); extern ipadm_status_t ipadm_up_addrs(ipadm_handle_t, ipadm_addr_info_t *); extern ipadm_status_t ipadm_down_addrs(ipadm_handle_t, const char *, ipadm_addr_info_t **); extern ipadm_status_t ipadm_wait_app_addrs(ipadm_handle_t, const char *); extern ipadm_status_t ipadm_migrate_dataaddrs(ipadm_handle_t, const char *, ipadm_addr_info_t *); /* * Address management functions */ extern ipadm_status_t ipadm_create_addr(ipadm_handle_t, ipadm_addrobj_t, uint32_t); extern ipadm_status_t ipadm_delete_addr(ipadm_handle_t, const char *, uint32_t); extern ipadm_status_t ipadm_disable_addr(ipadm_handle_t, const char *, uint32_t); extern ipadm_status_t ipadm_enable_addr(ipadm_handle_t, const char *, uint32_t); extern ipadm_status_t ipadm_up_addr(ipadm_handle_t, const char *, uint32_t); extern ipadm_status_t ipadm_down_addr(ipadm_handle_t, const char *, uint32_t); extern ipadm_status_t ipadm_refresh_addr(ipadm_handle_t, const char *, uint32_t); extern ipadm_status_t ipadm_addr_info(ipadm_handle_t, const char *, ipadm_addr_info_t **, uint32_t, int64_t); extern void ipadm_free_addr_info(ipadm_addr_info_t *); /* Functions related to creating/deleting/modifying opaque address object */ extern ipadm_status_t ipadm_create_addrobj(ipadm_addr_type_t, const char *, ipadm_addrobj_t *); extern void ipadm_destroy_addrobj(ipadm_addrobj_t); extern ipadm_status_t ipadm_get_aobjname(ipadm_addrobj_t, char *, size_t); extern ipadm_status_t ipadm_get_interface_id(ipadm_handle_t, const char *, struct sockaddr_in6 *, int *, uint32_t); extern ipadm_status_t ipadm_update_interface_id(ipadm_handle_t, ipadm_addrobj_t, uint32_t); /* Functions to set fields in addrobj for static addresses */ extern ipadm_status_t ipadm_set_addrval(ipadm_addrobj_t, struct sockaddr *, uint32_t); extern ipadm_status_t ipadm_set_addr(ipadm_addrobj_t, const char *, sa_family_t); extern ipadm_status_t ipadm_set_dst_addr(ipadm_addrobj_t, const char *, sa_family_t); extern ipadm_status_t ipadm_get_addr(const ipadm_addrobj_t, struct sockaddr_storage *); extern dladm_status_t ipadm_get_addrinfo(in6_addr_t *, in6_addr_t *, uint_t, uint32_t *, datalink_id_t *, boolean_t, sa_family_t); extern ipadm_status_t ipadm_update_addr(ipadm_handle_t, ipadm_addrobj_t, uint32_t); /* Functions to set fields in addrobj for IPv6 addrconf */ extern ipadm_status_t ipadm_set_interface_id(ipadm_addrobj_t, const char *); extern ipadm_status_t ipadm_set_dst_interface_id(ipadm_addrobj_t, const char *); extern ipadm_status_t ipadm_set_stateless(ipadm_addrobj_t, boolean_t); extern ipadm_status_t ipadm_set_stateful(ipadm_addrobj_t, boolean_t); /* Functions to set fields in addrobj for DHCP */ extern ipadm_status_t ipadm_set_primary(ipadm_addrobj_t, boolean_t); extern ipadm_status_t ipadm_set_wait_time(ipadm_addrobj_t, int64_t); extern ipadm_status_t ipadm_set_reqhost(ipadm_addrobj_t, const char *); /* Functions to set fields in addrobj for DHCP and IPv6 addrconf */ extern ipadm_status_t ipadm_set_verified_lease(ipadm_addrobj_t, const char *); extern ipadm_status_t ipadm_set_offer_wait(ipadm_addrobj_t, uint32_t); extern ipadm_status_t ipadm_set_client_id(ipadm_addrobj_t, const char *); extern ipadm_status_t ipadm_set_param_request_list(ipadm_addrobj_t, const char *); extern ipadm_status_t ipadm_set_param_ignore_list(ipadm_addrobj_t, const char *); /* Functions to set fields in addrobj for VRRP */ extern ipadm_status_t ipadm_set_vrname(ipadm_addrobj_t, const char *); /* * Property management functions */ /* call back function for the property walker */ typedef boolean_t ipadm_prop_wfunc_t(void *, const char *, uint_t); extern ipadm_status_t ipadm_walk_proptbl(uint_t, uint_t, uint_t, ipadm_prop_wfunc_t *, void *); extern ipadm_status_t ipadm_walk_prop(const char *, uint_t, uint_t, uint_t, ipadm_prop_wfunc_t *, void *); /* Interface property management - set, reset and get */ extern ipadm_status_t ipadm_set_ifprop(ipadm_handle_t, const char *, const char *, const char *, uint_t, uint_t); extern ipadm_status_t ipadm_get_ifprop(ipadm_handle_t, const char *, const char *, char *, uint_t *, uint_t, uint_t); /* Address property management - set, reset and get */ extern ipadm_status_t ipadm_set_addrprop(ipadm_handle_t, const char *, const char *, const char *, uint_t); extern ipadm_status_t ipadm_get_addrprop(ipadm_handle_t, const char *, char *, uint_t *, const char *, uint_t); /* Protocol property management - set, reset and get */ extern ipadm_status_t ipadm_set_prop(ipadm_handle_t, const char *, const char *, uint_t, uint_t); extern ipadm_status_t ipadm_get_prop(ipadm_handle_t, const char *, char *, uint_t *, uint_t, uint_t); /* * miscellaneous helper functions. */ extern const char *ipadm_status2str(ipadm_status_t); extern const char *ipadm_class2str(ipadm_if_class_t); extern ipadm_if_class_t ipadm_str2class(const char *); extern const char *ipadm_family2str(sa_family_t); extern sa_family_t ipadm_str2family(const char *); extern const char *ipadm_addrtype2str(ipadm_addr_type_t); extern ipadm_addr_type_t ipadm_str2addrtype(const char *); extern int ipadm_propstr2nvlist(ipadm_handle_t, const char *, nvlist_t **, nvlist_t **, uint_t); extern int ipadm_str2nvlist(const char *, nvlist_t **, uint_t); extern char *ipadm_proto2str(uint_t); extern uint_t ipadm_str2proto(const char *); extern ipadm_status_t ipadm_valid_propname(const char *, uint_t); extern ipadm_status_t ipadm_open_arp_on_udp(const char *, int *); extern int ipadm_legacy2new_propname(const char *, char *, uint_t, uint_t *); extern int ipadm_old2new_propname(const char *, char *, uint_t, uint_t *); extern int ipadm_new2legacy_propname(const char *, char *, uint_t, uint_t); extern boolean_t ipadm_if_pexists(ipadm_handle_t, const char *, const ipadm_if_class_t *, sa_family_t); extern boolean_t ipadm_is_vni(ipadm_handle_t, const char *); extern boolean_t ipadm_vni_pexists(ipadm_handle_t, const char *); extern boolean_t ipadm_is_loopback(const char *); extern boolean_t ipadm_is_ip(ipadm_handle_t, const char *); extern ipadm_status_t ipadm_is_valid_ipmp_underif(ipadm_handle_t, const char *); extern boolean_t ipadm_is_ipmp(ipadm_handle_t, const char *); extern boolean_t ipadm_is_under_ipmp(ipadm_handle_t, const char *); extern boolean_t ipadm_ipmp_pexists(ipadm_handle_t, const char *); extern int ipadm_addrtype_from_nvl(nvlist_t *, ipadm_addr_type_t *, sa_family_t *); extern void ipadm_sockaddr2str(const struct sockaddr_storage *, char *, uint_t, int); /* * Congestion control */ typedef boolean_t cong_db_func_t(void *, nvlist_t *, const char *, const char *, const char *); extern ipadm_status_t ipadm_cong_get_persist_propval(const char *, const char *, char *, uint_t *, const char *); extern ipadm_status_t ipadm_cong_persist_propval(const char *, const char *, const char *, const char *, uint_t); extern ipadm_status_t ipadm_cong_walk_db(ipadm_handle_t, nvlist_t *, cong_db_func_t *); #ifdef __cplusplus } #endif #endif /* _LIBIPADM_H */