/*
* 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
*/
/*
*/
#ifndef _LIBLLDP_H
#define _LIBLLDP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <libdladm.h>
#include <libnvpair.h>
#include <lldp.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.
*/
typedef enum lldp_propclass_e {
#define LLDP_PROPCLASS_AGENT_TLVS \
#define LLDP_PROPCLASS_GLOBAL_TLVS \
/*
* one per LLDP agent and it records the count of significant events
* in the transmit and recieve state machines.
*/
typedef struct lldp_stats_s {
} lldp_stats_t;
/*
* remote systems table. This stats table is shared by all
* lldp agents running on the system.
*/
typedef struct lldp_remtable_stats_s {
/* Unknown LLDP TLV */
typedef struct lldp_unknowntlv_s {
/* Unrecognized Organization specific TLV */
typedef struct lldp_unrec_orginfo_s {
typedef struct lldp_desc_s {
} lldp_desc_t;
typedef enum {
LLDP_STATUS_OK = 0,
/*
* following are the link properties that determine the TLV's
* that a lldp agent can advertise.
*/
/* numerical equivalent of above groups */
/* various possible values in 'basic-tlv' group */
/* numerical equivalent of the above 'basic-tlv' values */
/* following are the tlv's we support */
#define LLDP_BASIC_ALL_TLV \
/* various possible values in 'dot1-tlv' group */
/* numerical equivalent of the above '8021-tlv' values */
/* following are the tlv's we support */
/* various possible values in 'dot3-tlv' group */
/* numerical equivalent of the above '8023-tlv' values */
/* following are the tlv's we support */
/* various possible values in 'virt-tlv' group */
/* numerical equivalent of the above 'virt-tlv' values */
/*
* System capability properties.
*
* We do not have LLDP_ALLSTR because it's an invalid value. A system that has
* 'station' capability cannot have any other capability at the same time.
*
* We do not have LLDP_NONESTR because a system should support atleast one of
* capability below.
*/
/*
* option flags passed to liblldp functions
*
* - LLDP_OPT_ACTIVE:
* indicates the current value of a property
*
* - LLDP_OPT_DEFAULT:
* indicatest the default value of a property
*
* - LLDP_OPT_PERM
* indicates the permission of a property
*
* - LLDP_OPT_POSSIBLE
* indicates range of values for a given property
*
* - LLDP_OPT_APPEND
* for multi-valued properties, append a new value.
*
* - LLDP_OPT_REMOVE
* for multi-valued properties, remove the specified value
*/
#define DCBX_MIN_PFC_TCS 0
#define DCBX_MIN_MAP 0
#define DCBX_MIN_APPLN_PRI 0
extern const char *lldp_status2str(lldp_status_t, char *);
extern lldp_status_t lldp_errno2status(int);
/*
* Property management functions
*/
nvlist_t **);
lldp_pfc_t *);
uint32_t);
extern lldp_status_t lldp_get_agentprop(const char *, const char *, char *,
extern lldp_status_t lldp_get_agent_tlvprop(const char *, const char *,
extern lldp_status_t lldp_get_global_tlvprop(const char *, const char *,
extern lldp_status_t lldp_set_agentprop(const char *, const char *, char *,
uint_t);
extern lldp_status_t lldp_set_global_tlvprop(const char *, const char *,
char *, uint_t);
extern lldp_status_t lldp_set_agent_tlvprop(const char *, const char *,
const char *, char *, uint_t);
extern char *lldp_port_subtype2str(uint8_t);
extern char *lldp_maddr_subtype2str(uint8_t);
extern char *lldp_maddr_ifsubtype2str(uint8_t);
extern char *lldp_chassis_subtype2str(uint8_t);
extern const char *lldp_mode2str(lldp_admin_status_t);
extern boolean_t lldp_is_enabled(const char *);
extern int lldp_nvlist2sysname(nvlist_t *, char **);
extern int lldp_nvlist2sysdescr(nvlist_t *, char **);
extern int lldp_nvlist2portdescr(nvlist_t *, char **);
extern int lldp_nvlist2mgmtaddr(nvlist_t *, const char *,
lldp_mgmtaddr_t **, int *);
int *);
int *);
uint_t *);
lldp_appln_t *);
extern int lldp_nvlist2unknowntlv(nvlist_t *, int,
lldp_unknowntlv_t **, uint_t *);
extern int lldp_nvlist2unrec_orginfo(nvlist_t *, const char *,
lldp_unrec_orginfo_t **, uint_t *);
lldp_tlv_t *);
extern int lldp_tlv2portdescr(lldp_tlv_t *, char *);
extern int lldp_tlv2sysname(lldp_tlv_t *, char *);
extern int lldp_tlv2sysdescr(lldp_tlv_t *, char *);
uint_t *);
size_t *);
size_t *);
size_t *);
size_t *);
size_t *);
size_t *);
extern char *dcbx_appln_sel2str(int);
extern uint_t lldp_tlvname2pclass(const char *);
extern char *lldp_pclass2tlvname(lldp_propclass_t);
extern char *lldp_evb_rrstat2str(uint8_t);
extern lldp_status_t lldp_set_evb_state(const char *);
extern lldp_status_t lldp_unset_evb_state(const char *);
#ifdef __cplusplus
}
#endif
#endif /* _LIBLLDP_H */