5088N/A/*
5088N/A * CDDL HEADER START
5088N/A *
5088N/A * The contents of this file are subject to the terms of the
5088N/A * Common Development and Distribution License (the "License").
5088N/A * You may not use this file except in compliance with the License.
5088N/A *
5088N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5088N/A * or http://www.opensolaris.org/os/licensing.
5088N/A * See the License for the specific language governing permissions
5088N/A * and limitations under the License.
5088N/A *
5088N/A * When distributing Covered Code, include this CDDL HEADER in each
5088N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5088N/A * If applicable, add the following below this CDDL HEADER, with the
5088N/A * fields enclosed by brackets "[]" replaced with your own identifying
5088N/A * information: Portions Copyright [yyyy] [name of copyright owner]
5088N/A *
5088N/A * CDDL HEADER END
5088N/A */
5088N/A
5088N/A/*
5916N/A * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
5088N/A */
5088N/A
5088N/A#ifndef UTIL_SOLARIS_H
5088N/A#define UTIL_SOLARIS_H
5088N/A
5088N/A#include <libdladm.h>
5088N/A#include <linux/openvswitch.h>
5088N/A#include <lib/packets.h>
5088N/A#include <sys/types.h>
5088N/A#include <kstat2.h>
5088N/A#include "odp-util.h"
5088N/A
5088N/Aextern kstat2_handle_t khandle;
5088N/A
5088N/A/*
5088N/A * These functions are Solaris specific, so they should be used directly
5088N/A * only by Solaris-specific code.
5088N/A */
5088N/A
5088N/Astruct action_output {
5088N/A int nofports;
5088N/A uint32_t ofports[MAC_OF_MAXPORT];
5088N/A};
5088N/A
5088N/Astruct action_set {
5088N/A uint_t flags;
5088N/A uint_t priority;
5088N/A};
5088N/A
5088N/A#define FLOW_SET_PRIORITY 0x1
5088N/A#define MAX_FLOW_ACTIONS 64
5088N/A
5088N/Astruct flow;
5088N/Astruct nlattr;
5088N/A
5088N/Aint solaris_dladm_status2error(dladm_status_t);
5088N/Aint solaris_if_enabled(int, const char *, uint64_t *);
5088N/Aint solaris_init_rad(void);
5088N/Aint solaris_get_dlclass(const char *, char *, size_t);
5088N/Aint solaris_get_devname(const char *, char *, size_t);
5088N/Aint solaris_get_dllower(const char *, char *, size_t);
5088N/Aint solaris_get_dlprop(const char *, const char *, const char *, char *,
5088N/A size_t);
6016N/Aint solaris_set_dlprop_ulong(const char *, const char *, void *, boolean_t);
6016N/Aint solaris_set_dlprop_boolean(const char *, const char *, void *, boolean_t);
6016N/Aint solaris_set_dlprop_string(const char *, const char *, void *, boolean_t);
5088N/Aint solaris_plumb_if(int, const char *, sa_family_t);
5088N/Aint solaris_unplumb_if(int, const char *, sa_family_t);
5088N/Aboolean_t dlparse_drvppa(const char *, char *, uint_t, uint_t *);
5088N/A
5088N/Aint solaris_create_vnic(const char *, const char *);
5088N/Aint solaris_delete_vnic(const char *);
5088N/Aint solaris_modify_vnic(const char *, const char *);
5088N/Aint solaris_create_etherstub(const char *);
5088N/Aint solaris_delete_etherstub(const char *);
5088N/Aboolean_t solaris_etherstub_exists(const char *);
5088N/A
5088N/A/* void * since struct dpif causes conflict with the list implementation */
5088N/Aint solaris_add_flow(void *, const char *, const char *, struct flow *,
5088N/A struct flow *, const struct nlattr *, size_t);
5088N/Aint solaris_modify_flow(void *, const char *, const struct nlattr *, size_t);
5088N/Aint solaris_remove_flow(const char *, const char *);
5088N/Aint solaris_get_flowattr(const char *, struct flow *, struct flow *);
5088N/Aint solaris_get_flowaction(const char *, struct ofpbuf *);
5088N/Avoid slowpath_to_actions(enum slow_path_reason, struct ofpbuf *);
5088N/Aint solaris_get_flowstats(const char *, uint64_t *, uint64_t *, uint64_t *);
5088N/A
5088N/Aboolean_t kstat_handle_init(kstat2_handle_t *);
5088N/Aboolean_t kstat_handle_update(kstat2_handle_t);
5088N/Avoid kstat_handle_close(kstat2_handle_t *);
5088N/Auint64_t get_nvvt_int(kstat2_map_t, char *);
5088N/A
5088N/Avoid solaris_port_walk(void *, void (*)(void *, const char *, char *,
5088N/A odp_port_t));
7235N/Avoid solaris_flow_walk(void *, struct ofpbuf *,
7235N/A void (*)(void *, const char *, struct flow *, struct flow *,
5088N/A struct ofpbuf *, uint64_t, uint64_t, uint64_t));
5088N/A
5088N/Aboolean_t solaris_is_uplink_class(const char *);
5088N/Aboolean_t solaris_dlparse_zonelinkname(const char *, char *, zoneid_t *);
5088N/A
6016N/Avoid solaris_parse_cpuinfo(long int *);
5088N/A
5088N/A#define SOLARIS_MAX_BUFSIZE 1024
5088N/A#endif /* UTIL_SOLARIS_H */