libipadm_impl.h revision 299625c6492013aa7bd163862f0d181854f69b3c
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2013 by Delphix. All rights reserved.
*/
#ifndef _LIBIPADM_IMPL_H
#define _LIBIPADM_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <libipadm.h>
#include <libdladm.h>
#include <ipadm_ipmgmt.h>
#include <inet/tunables.h>
#include <pthread.h>
#include <libinetutil.h>
#include <libsocket_priv.h>
#define IPADM_STRSIZE 256
#define IPADM_ONSTR "on"
#define IPADM_OFFSTR "off"
#define ARP_MOD_NAME "arp"
#define IPADM_LOGICAL_SEP ':'
/* mask for flags accepted by libipadm functions */
/* Opaque library handle */
struct ipadm_handle {
int iph_sock; /* socket to interface */
int iph_sock6; /* socket to interface */
int iph_door_fd; /* door descriptor to ipmgmtd */
int iph_rtsock; /* routing socket */
};
struct ipadm_addrobj_s {
char ipadm_ifname[LIFNAMSIZ];
char ipadm_aobjname[IPADM_AOBJSIZ];
union {
struct {
char ipadm_ahname[MAXNAMELEN];
struct sockaddr_storage ipadm_addr;
char ipadm_dhname[MAXNAMELEN];
struct sockaddr_storage ipadm_dstaddr;
struct {
struct sockaddr_in6 ipadm_intfid;
struct {
} ipadm_dhcp_s;
} ipadm_addr_u;
};
/*
* Data structures and callback functions related to property management
*/
struct ipadm_prop_desc;
typedef struct ipadm_prop_desc ipadm_prop_desc_t;
/* property set() callback */
/* property get() callback */
struct ipadm_prop_desc {
char *ipd_name; /* property name */
char *ipd_old_name; /* for backward compatibility */
};
/* ipd_flags values */
extern ipadm_prop_desc_t ipadm_addrprop_table[];
extern ipadm_pd_getf_t i_ipadm_get_onoff;
/* libipadm.c */
sa_family_t, uint64_t *);
nvlist_t **);
nvlist_t *);
extern int i_ipadm_strioctl(int, int, char *, int);
extern boolean_t i_ipadm_is_loopback(const char *);
extern boolean_t i_ipadm_is_vni(const char *);
extern ipadm_status_t ipadm_errno2status(int);
/* ipadm_ndpd.c */
extern ipadm_status_t i_ipadm_disable_autoconf(const char *);
extern ipadm_status_t i_ipadm_enable_autoconf(const char *);
/* ipadm_persist.c */
/* ipadm_prop.c */
ipadm_prop_desc_t *, const char *, const void *,
uint_t);
ipadm_prop_desc_t *, char *, uint_t *,
const void *);
/* ipadm_addr.c */
extern void i_ipadm_init_addr(ipadm_addrobj_t, const char *,
const char *, ipadm_addr_type_t);
const char *);
nvlist_t *, sa_family_t);
nvlist_t *);
nvlist_t *);
extern void i_ipadm_addrobj2lifname(ipadm_addrobj_t, char *, int);
in6_addr_t *);
const ipadm_addrobj_t, uint32_t);
struct sockaddr_storage *);
/* ipadm_if.c */
uint32_t);
uint32_t);
sa_family_t, boolean_t *);
extern int i_ipadm_get_lnum(const char *);
#ifdef __cplusplus
}
#endif
#endif /* _LIBIPADM_IMPL_H */