util-solaris.h revision 6016
/*
* 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 UTIL_SOLARIS_H
#define UTIL_SOLARIS_H
/*
* While we make changes to kstat2_open, we must manually define the functions.
* This can be stripped out once the changes in ON appear on the build machines.
*/
#ifndef _KSTAT2_H
#define _KSTAT2_H
#include <stdio.h>
#include <sys/kstat2_common.h>
typedef enum kstat2_status {
KSTAT2_S_OK = 0, /**< Request was successful */
KSTAT2_S_NO_PERM, /**< Insufficient permissions for request */
KSTAT2_S_NO_MEM, /**< Insufficient memory available */
KSTAT2_S_NO_SPACE, /**< No space available for operation */
KSTAT2_S_INVAL_ARG, /**< Invalid argument supplied */
KSTAT2_S_INVAL_STATE, /**< Invalid state for this request */
KSTAT2_S_INVAL_TYPE, /**< Invalid data type found */
KSTAT2_S_NOT_FOUND, /**< Resource not found */
KSTAT2_S_CONC_MOD, /**< Concurrent modification of map detected */
KSTAT2_S_DEL_MAP, /**< Referenced map has been deleted */
KSTAT2_S_SYS_FAIL /**< System call has failed, see errno */
typedef const struct __kstat2_handle *kstat2_handle_t;
typedef const struct __kstat2_map *kstat2_map_t;
typedef struct kstat2_nv {
const char *const name; /**< Name of the pair */
union { /**< Data value */
const struct __kstat2_map *const map;
struct {
} integers;
const char *const string;
struct {
const char *const *const array;
} strings;
} data;
} *kstat2_nv_t;
kstat2_nv_t *nv);
#endif /* _KSTAT2_H */
#include <libdladm.h>
#include <linux/openvswitch.h>
#include <kstat2.h>
#include "odp-util.h"
extern kstat2_handle_t khandle;
/*
* These functions are Solaris specific, so they should be used directly
* only by Solaris-specific code.
*/
struct action_output {
int nofports;
};
struct action_set {
};
#define FLOW_SET_PRIORITY 0x1
#define MAX_FLOW_ACTIONS 64
struct flow;
struct nlattr;
int solaris_if_enabled(int, const char *, uint64_t *);
int solaris_init_rad(void);
int solaris_get_dlclass(const char *, char *, size_t);
int solaris_get_devname(const char *, char *, size_t);
int solaris_get_dllower(const char *, char *, size_t);
int solaris_get_dlprop(const char *, const char *, const char *, char *,
size_t);
int solaris_set_dlprop_ulong(const char *, const char *, void *, boolean_t);
int solaris_set_dlprop_boolean(const char *, const char *, void *, boolean_t);
int solaris_set_dlprop_string(const char *, const char *, void *, boolean_t);
int solaris_plumb_if(int, const char *, sa_family_t);
int solaris_unplumb_if(int, const char *, sa_family_t);
int solaris_create_vnic(const char *, const char *);
int solaris_delete_vnic(const char *);
int solaris_modify_vnic(const char *, const char *);
int solaris_create_etherstub(const char *);
int solaris_delete_etherstub(const char *);
boolean_t solaris_etherstub_exists(const char *);
/* void * since struct dpif causes conflict with the list implementation */
int solaris_add_flow(void *, const char *, const char *, struct flow *,
int solaris_remove_flow(const char *, const char *);
int solaris_get_flowaction(const char *, struct ofpbuf *);
void kstat_handle_close(kstat2_handle_t *);
void solaris_port_walk(void *, void (*)(void *, const char *, char *,
odp_port_t));
boolean_t solaris_is_uplink_class(const char *);
void solaris_parse_cpuinfo(long int *);
#define SOLARIS_MAX_BUFSIZE 1024
#endif /* UTIL_SOLARIS_H */