Print this page
OS-428 add link zonename kstat


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.

  24  */
  25 
  26 #ifndef _SYS_DLS_IMPL_H
  27 #define _SYS_DLS_IMPL_H
  28 
  29 #include <sys/stream.h>
  30 #include <sys/dls.h>
  31 #include <sys/mac_provider.h>
  32 #include <sys/mac_client.h>
  33 #include <sys/mac_client_priv.h>
  34 #include <sys/modhash.h>
  35 #include <sys/kstat.h>
  36 #include <net/if.h>
  37 #include <sys/dlpi.h>
  38 
  39 #ifdef  __cplusplus
  40 extern "C" {
  41 #endif
  42 
  43 typedef struct dls_multicst_addr_s {


  79 extern int              dls_link_hold(const char *, dls_link_t **);
  80 extern int              dls_link_hold_create(const char *, dls_link_t **);
  81 extern int              dls_link_hold_by_dev(dev_t, dls_link_t **);
  82 extern void             dls_link_rele(dls_link_t *);
  83 extern int              dls_link_rele_by_name(const char *);
  84 extern void             dls_link_add(dls_link_t *, uint32_t, dld_str_t *);
  85 extern void             dls_link_remove(dls_link_t *, dld_str_t *);
  86 extern int              dls_link_getzid(const char *, zoneid_t *);
  87 extern int              dls_link_setzid(const char *, zoneid_t);
  88 extern dev_info_t       *dls_link_devinfo(dev_t);
  89 extern dev_t            dls_link_dev(dls_link_t *);
  90 
  91 extern void             i_dls_head_rele(dls_head_t *);
  92 extern int              dls_mac_active_set(dls_link_t *i);
  93 extern void             dls_mac_active_clear(dls_link_t *);
  94 
  95 extern void             dls_create_str_kstats(dld_str_t *);
  96 extern int              dls_stat_update(kstat_t *, dls_link_t *, int);
  97 extern int              dls_stat_create(const char *, int, const char *,
  98                             zoneid_t, int (*)(struct kstat *, int), void *,
  99                             kstat_t **);

 100 
 101 extern int              dls_devnet_open_by_dev(dev_t, dls_link_t **,
 102                             dls_dl_handle_t *);
 103 extern int              dls_devnet_hold_link(datalink_id_t, dls_dl_handle_t *,
 104                             dls_link_t **);
 105 extern void             dls_devnet_rele_link(dls_dl_handle_t, dls_link_t *);
 106 
 107 extern void             dls_init(void);
 108 extern int              dls_fini(void);
 109 extern void             dls_link_txloop(void *, mblk_t *);
 110 extern boolean_t        dls_accept(dld_str_t *, mac_header_info_t *,
 111                             dls_rx_t *, void **);
 112 extern boolean_t        dls_accept_loopback(dld_str_t *, mac_header_info_t *,
 113                             dls_rx_t *, void **);
 114 extern boolean_t        dls_accept_promisc(dld_str_t *, mac_header_info_t *,
 115                             dls_rx_t *, void **, boolean_t);
 116 extern void             i_dls_link_rx(void *, mac_resource_handle_t, mblk_t *,
 117                             boolean_t);
 118 extern void             dls_rx_promisc(void *, mac_resource_handle_t, mblk_t *,
 119                             boolean_t);


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  * Copyright 2011 Joyent, Inc.  All rights reserved.
  25  */
  26 
  27 #ifndef _SYS_DLS_IMPL_H
  28 #define _SYS_DLS_IMPL_H
  29 
  30 #include <sys/stream.h>
  31 #include <sys/dls.h>
  32 #include <sys/mac_provider.h>
  33 #include <sys/mac_client.h>
  34 #include <sys/mac_client_priv.h>
  35 #include <sys/modhash.h>
  36 #include <sys/kstat.h>
  37 #include <net/if.h>
  38 #include <sys/dlpi.h>
  39 
  40 #ifdef  __cplusplus
  41 extern "C" {
  42 #endif
  43 
  44 typedef struct dls_multicst_addr_s {


  80 extern int              dls_link_hold(const char *, dls_link_t **);
  81 extern int              dls_link_hold_create(const char *, dls_link_t **);
  82 extern int              dls_link_hold_by_dev(dev_t, dls_link_t **);
  83 extern void             dls_link_rele(dls_link_t *);
  84 extern int              dls_link_rele_by_name(const char *);
  85 extern void             dls_link_add(dls_link_t *, uint32_t, dld_str_t *);
  86 extern void             dls_link_remove(dls_link_t *, dld_str_t *);
  87 extern int              dls_link_getzid(const char *, zoneid_t *);
  88 extern int              dls_link_setzid(const char *, zoneid_t);
  89 extern dev_info_t       *dls_link_devinfo(dev_t);
  90 extern dev_t            dls_link_dev(dls_link_t *);
  91 
  92 extern void             i_dls_head_rele(dls_head_t *);
  93 extern int              dls_mac_active_set(dls_link_t *i);
  94 extern void             dls_mac_active_clear(dls_link_t *);
  95 
  96 extern void             dls_create_str_kstats(dld_str_t *);
  97 extern int              dls_stat_update(kstat_t *, dls_link_t *, int);
  98 extern int              dls_stat_create(const char *, int, const char *,
  99                             zoneid_t, int (*)(struct kstat *, int), void *,
 100                             kstat_t **, zoneid_t);
 101 extern void     dls_stat_delete(kstat_t *);
 102 
 103 extern int              dls_devnet_open_by_dev(dev_t, dls_link_t **,
 104                             dls_dl_handle_t *);
 105 extern int              dls_devnet_hold_link(datalink_id_t, dls_dl_handle_t *,
 106                             dls_link_t **);
 107 extern void             dls_devnet_rele_link(dls_dl_handle_t, dls_link_t *);
 108 
 109 extern void             dls_init(void);
 110 extern int              dls_fini(void);
 111 extern void             dls_link_txloop(void *, mblk_t *);
 112 extern boolean_t        dls_accept(dld_str_t *, mac_header_info_t *,
 113                             dls_rx_t *, void **);
 114 extern boolean_t        dls_accept_loopback(dld_str_t *, mac_header_info_t *,
 115                             dls_rx_t *, void **);
 116 extern boolean_t        dls_accept_promisc(dld_str_t *, mac_header_info_t *,
 117                             dls_rx_t *, void **, boolean_t);
 118 extern void             i_dls_link_rx(void *, mac_resource_handle_t, mblk_t *,
 119                             boolean_t);
 120 extern void             dls_rx_promisc(void *, mac_resource_handle_t, mblk_t *,
 121                             boolean_t);