/* * 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 * or http://www.opensolaris.org/os/licensing. * 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 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _TRILL_IMPL_H #define _TRILL_IMPL_H #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #include #include #define TRILL_KSSOCK_NAMES "recv", "sent", "drops", "encap", "decap", "forward" /* kstats per TRILL socket */ typedef struct trill_kssock_s { kstat_named_t tks_recv; /* packets received */ kstat_named_t tks_sent; /* packets sent through */ kstat_named_t tks_drops; /* packets dropped */ kstat_named_t tks_encap; /* packets encapsulated */ kstat_named_t tks_decap; /* packets decapsulated */ kstat_named_t tks_forward; /* packets forwarded */ } trill_kssock_t; #define KSPINCR(stat) ++(tsock->ts_kstats.stat.value.ui64) #define TRILL_NO_TCI 0 /* No VLAN tag */ #define TRILL_VLANS_ARRSIZE ((1<<12)/NBBY) #define TRILL_VLANBIT(v) ((v) % NBBY) #define TRILL_VLANBYTE(v) ((v)/NBBY) #define TRILL_VLANISSET(l, v) ((l)[TRILL_VLANBYTE(v)] & (1<