2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "sdbd_plugin.h"
22 #define PLUGIN_PATH "/usr/lib/libsdbd_plugin.so"
23 #define PLUGIN_XML_PATH "/etc/sdbd/commands.xml"
27 int default_plugin_init ( eventfunc event_cb, registerfunc register_func );
28 int default_plugin_sync_proc ( int cmd, parameters* in, parameters* out );
29 int default_plugin_async_proc ( int cmd, parameters* in, int out_fd );
31 void load_sdbd_plugin();
32 void unload_sdbd_plugin();
34 int request_sync_cmd ( int cmd, parameters* in, parameters* out );
36 // return 1 if plugin support given command
37 // return 0 if plugin does not support given command
38 int is_supported_by_plugin ( int cmd );
40 // return 1 if succeed to get capability from plugin
42 int request_capability_to_plugin ( int cap, char* out_buf, unsigned int out_len );
44 // return 1 if allowed by plugin (valid)
45 // return 0 if disallowed by plugin (invalid)
46 int request_validity_to_plugin ( int cmd, const char* in_buf );
48 // return 1 if allowed by plugin (valid)
49 // return 0 if disallowed by plugin (invalid)
50 int request_extcmd_validity_to_plugin ( int cmd, const char* in_buf);
52 // return 1 if succeed to convert
54 int request_conversion_to_plugin ( int cmd, const char* in_buf, char* out_buf, unsigned int out_len );
56 // return 1 if succeed to convert
58 int request_extcmd_conversion_to_plugin ( int cmd, const char* in_buf, char* out_buf, unsigned int out_len );
61 // return 0 if unlocked
62 // return -1 if request failed
63 int request_lock_state_to_plugin ( int lock_type );
65 // return 1 if shell command handled by plugin (handle)
66 // return 0 if shell command not handled by plugin (not handle)
67 int request_handlecmd_to_plugin ( int cmd, const char* in_buf );
69 // return nonnegative integer that is a socket descriptor for communication
70 // with async proc thread if success to create async proc thread
71 // return -1 if failed to create async proc thread
72 int request_shellcmd_to_plugin ( const char* in_buf );
74 // return nonnegative integer that is a socket descriptor for communication
75 // with async proc thread if success to create async proc thread
76 // return -1 if failed to create async proc thread
77 int request_appcmd_to_plugin ( const char* in_buf );
79 // return 1 if succeed to get capability from plugin
81 int request_extra_capability_to_plugin (char* out_buf, unsigned int out_len );