xref: /titanic_41/usr/src/cmd/lms/plugin.h (revision 88447a05f537aabe9a1bc3d5313f22581ec992a7)
1 /*******************************************************************************
2  * Copyright (C) 2004-2008 Intel Corp. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  *  - Redistributions of source code must retain the above copyright notice,
8  *    this list of conditions and the following disclaimer.
9  *
10  *  - Redistributions in binary form must reproduce the above copyright notice,
11  *    this list of conditions and the following disclaimer in the documentation
12  *    and/or other materials provided with the distribution.
13  *
14  *  - Neither the name of Intel Corp. nor the names of its
15  *    contributors may be used to endorse or promote products derived from this
16  *    software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *******************************************************************************/
30 
31 #ifndef __LMS_PLUGIN_H__
32 #define __LMS_PLUGIN_H__
33 
34 #define LMS_OK		   0x0
35 #define LMS_ERROR	   0x1
36 
37 #define LMS_ACCEPTED  0x1
38 #define LMS_DROPPED   0x2
39 #define LMS_STOPPED   0x3
40 
41 
42 #ifdef __sun
43 #define LMS_PLUGIN_CONFIG_FILE   "/etc/lms_plugin.conf"
44 #else
45 #define LMS_PLUGIN_CONFIG_FILE   "@prefix@/etc/lms_plugin.conf"
46 #endif
47 
48 #define LMS_INIT_FUNC_NAME	"lms_init_func"
49 #define LMS_VERSION_FUNC_NAME   "lms_version_func"
50 #define LMS_PRE_FUNC_NAME	"lms_pre_func"
51 #define LMS_RETRY_FUNC_NAME	"lms_retry_func"
52 #define LMS_POST_FUNC_NAME	"lms_post_func"
53 #define LMS_DEINIT_FUNC_NAME	"lms_deinit_func"
54 
55 
56 typedef int (*lms_init_t)(void);
57 typedef void (*lms_version_t)(unsigned char version);
58 typedef int (*lms_pre_t)(unsigned char *buff, int len);
59 typedef int (*lms_retry_t)(unsigned char *buff, int len);
60 typedef int (*lms_post_t)(unsigned char *buff, int len, int status);
61 typedef void (*lms_deinit_t)(void);
62 
63 
64 #endif
65 
66