1 /*
   2  * CDDL HEADER START
   3  *
   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 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #ifndef _NCALL_MODULE_H
  27 #define _NCALL_MODULE_H
  28 
  29 #ifdef __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #ifdef _KERNEL
  34 
  35 #define NCALL_MODULE_VER        4
  36 
  37 typedef struct ncall_module_s {
  38         int ncall_version;
  39         char *ncall_name;
  40 
  41         int (*ncall_stop)(void);
  42 
  43         void (*ncall_register_svc)(int, void (*)(ncall_t *, int *));
  44         void (*ncall_unregister_svc)(int);
  45 
  46         int  (*ncall_nodeid)(char *);
  47         char *(*ncall_nodename)(int);
  48         int  (*ncall_mirror)(int);
  49         int  (*ncall_self)(void);
  50 
  51         int  (*ncall_alloc)(int, int, int, ncall_t **);
  52         int  (*ncall_timedsend)(ncall_t *, int, int, struct timeval *,
  53             va_list);
  54         int  (*ncall_timedsendnotify)(ncall_t *, int, int, struct timeval *,
  55             void (*)(ncall_t *, void *), void *, va_list);
  56         int  (*ncall_broadcast)(ncall_t *, int, int, struct timeval *,
  57             va_list);
  58         int  (*ncall_read_reply)(ncall_t *, int, va_list);
  59         void (*ncall_reset)(ncall_t *);
  60         void (*ncall_free)(ncall_t *);
  61 
  62         int  (*ncall_put_data)(ncall_t *, void *, int);
  63         int  (*ncall_get_data)(ncall_t *, void *, int);
  64 
  65         int  (*ncall_sender)(ncall_t *);
  66         void (*ncall_reply)(ncall_t *, va_list);
  67         void (*ncall_pend)(ncall_t *);
  68         void (*ncall_done)(ncall_t *);
  69 
  70         int  (*ncall_ping)(char *, int *);
  71         int  (*ncall_maxnodes)(void);
  72         int  (*ncall_nextnode)(void **);
  73         int  (*ncall_errcode)(ncall_t *, int *);
  74 } ncall_module_t;
  75 
  76 extern int ncall_register_module(ncall_module_t *, ncall_node_t *);
  77 extern int ncall_unregister_module(ncall_module_t *);
  78 
  79 #endif /* _KERNEL */
  80 
  81 #ifdef __cplusplus
  82 }
  83 #endif
  84 
  85 #endif  /* _NCALL_MODULE_H */