Add feature to take extra capabilities from plugin
[sdk/target/sdbd.git] / src / plugin.h
old mode 100644 (file)
new mode 100755 (executable)
index a553e95..72345c6
 
 #include "sdbd_plugin.h"
 
-#define PLUGIN_PATH    "/usr/lib/libsdbd_plugin.so"
+#define PLUGIN_PATH        "/usr/lib/libsdbd_plugin.so"
+#define PLUGIN_XML_PATH    "/etc/sdbd/commands.xml"
+
+extern char* extcmd;
 
 int default_plugin_init ( eventfunc event_cb, registerfunc register_func );
 int default_plugin_sync_proc ( int cmd, parameters* in, parameters* out );
@@ -28,6 +31,8 @@ int default_plugin_async_proc ( int cmd, parameters* in, int out_fd );
 void load_sdbd_plugin();
 void unload_sdbd_plugin();
 
+int request_sync_cmd ( int cmd, parameters* in, parameters* out );
+
 // return 1 if plugin support given command
 // return 0 if plugin does not support given command
 int is_supported_by_plugin ( int cmd );
@@ -40,13 +45,39 @@ int request_capability_to_plugin ( int cap, char* out_buf, unsigned int out_len
 // return 0 if disallowed by plugin (invalid)
 int request_validity_to_plugin ( int cmd, const char* in_buf );
 
+// return 1 if allowed by plugin (valid)
+// return 0 if disallowed by plugin (invalid)
+int request_extcmd_validity_to_plugin ( int cmd, const char* in_buf);
+
 // return 1 if succeed to convert
 // return 0 otherwise
 int request_conversion_to_plugin ( int cmd, const char* in_buf, char* out_buf, unsigned int out_len );
 
+// return 1 if succeed to convert
+// return 0 otherwise
+int request_extcmd_conversion_to_plugin ( int cmd, const char* in_buf, char* out_buf, unsigned int out_len );
+
 // return 1 if locked
 // return 0 if unlocked
 // return -1 if request failed
 int request_lock_state_to_plugin ( int lock_type );
 
+// return 1 if shell command handled by plugin (handle)
+// return 0 if shell command not handled by plugin (not handle)
+int request_handlecmd_to_plugin ( int cmd, const char* in_buf );
+
+// return nonnegative integer that is a socket descriptor for communication
+//        with async proc thread if success to create async proc thread
+// return -1 if failed to create async proc thread
+int request_shellcmd_to_plugin ( const char* in_buf );
+
+// return nonnegative integer that is a socket descriptor for communication
+//        with async proc thread if success to create async proc thread
+// return -1 if failed to create async proc thread
+int request_appcmd_to_plugin ( const char* in_buf );
+
+// return 1 if succeed to get capability from plugin
+// return 0 otherwise
+int request_extra_capability_to_plugin (char* out_buf, unsigned int out_len );
+
 #endif //__PLUGIN_H