Revert "Add the appcmd protocol for product extended routine."
[sdk/target/sdbd.git] / src / sdb.h
index a521466..5d7bd94 100644 (file)
--- a/src/sdb.h
+++ b/src/sdb.h
@@ -23,7 +23,6 @@
 
 #include "transport.h"  /* readx(), writex() */
 #include "fdevent.h"
-#include "sdbd_plugin.h"
 #if !SDB_HOST
 #include "commandline_sdbd.h"
 #endif
@@ -240,12 +239,12 @@ typedef struct platform_info {
 
 #define ENABLED "enabled"
 #define DISABLED "disabled"
-#define CPUARCH_ARMV6 "armv6"
-#define CPUARCH_ARMV7 "armv7"
-#define CPUARCH_X86 "x86"
 #define CAPBUF_SIZE 4096
 #define CAPBUF_ITEMSIZE 32
 #define CAPBUF_L_ITEMSIZE 256
+#define CAPBUF_LL_ITEMSIZE PATH_MAX
+#define SDBD_CAP_VERSION_MAJOR 1
+#define SDBD_CAP_VERSION_MINOR 0
 typedef struct platform_capabilities
 {
     char secure_protocol[CAPBUF_ITEMSIZE];      // enabled or disabled
@@ -258,25 +257,23 @@ typedef struct platform_capabilities
     char usbproto_support[CAPBUF_ITEMSIZE];     // enabled or disabled
     char sockproto_support[CAPBUF_ITEMSIZE];    // enabled or disabled
 
+    char log_enable[CAPBUF_ITEMSIZE];    // enabled or disabled
+    char log_path[CAPBUF_LL_ITEMSIZE];    // path of sdbd log
+
     char cpu_arch[CAPBUF_ITEMSIZE];             // cpu architecture (ex. x86)
     char profile_name[CAPBUF_ITEMSIZE];         // profile name (ex. mobile)
     char vendor_name[CAPBUF_ITEMSIZE];          // vendor name (ex. Tizen)
     char sdk_toolpath[CAPBUF_L_ITEMSIZE];       // sdk tool path
+    char can_launch[CAPBUF_L_ITEMSIZE];         // target name
 
     char platform_version[CAPBUF_ITEMSIZE];     // platform version (ex. 2.3.0)
     char product_version[CAPBUF_ITEMSIZE];      // product version (ex. 1.0)
     char sdbd_version[CAPBUF_ITEMSIZE];         // sdbd version
     char sdbd_plugin_version[CAPBUF_ITEMSIZE];  // sdbd plugin version
+    char sdbd_cap_version[CAPBUF_ITEMSIZE];     // capability version
 } pcap;
 extern pcap g_capabilities;
 
-#define SDBD_PLUGIN_PATH    "/usr/lib/libsdbd_plugin.so"
-#define SDBD_PLUGIN_INTF    "sdbd_plugin_cmd_proc"
-typedef int (*SDBD_PLUGIN_CMD_PROC_PTR)(const char*, const char*, sdbd_plugin_param);
-extern SDBD_PLUGIN_CMD_PROC_PTR sdbd_plugin_cmd_proc;
-int request_plugin_cmd(const char* cmd, const char* in_buf, char *out_buf, unsigned int out_len);
-int request_plugin_verification(const char* cmd, const char* in_buf);
-
 void print_packet(const char *label, apacket *p);
 
 asocket *find_local_socket(unsigned id);
@@ -379,6 +376,9 @@ char * get_log_file_path(const char * log_name);
 extern int rootshell_mode; // 0: sdk user, 1: root
 extern int booting_done; // 0: platform booting is in progess 1: platform booting is done
 
+// 1 if locked, 0 if unlocked
+extern int is_pwlocked;
+
 // This is the users and groups config for the platform
 
 #define SID_ROOT        0    /* traditional unix root user */
@@ -394,10 +394,10 @@ extern char* g_sdk_home_dir;
 extern char* g_sdk_home_dir_env;
 #endif
 
-int is_pwlocked(void);
 int should_drop_privileges(void);
 int set_sdk_user_privileges();
 void set_root_privileges();
+void send_device_status();
 
 int get_emulator_forward_port(void);
 int get_emulator_name(char str[], int str_size);
@@ -412,86 +412,6 @@ void put_apacket(apacket *p);
 int check_header(apacket *p);
 int check_data(apacket *p);
 
-/* define SDB_TRACE to 1 to enable tracing support, or 0 to disable it */
-
-#define  SDB_TRACE    1
-
-/* IMPORTANT: if you change the following list, don't
- * forget to update the corresponding 'tags' table in
- * the sdb_trace_init() function implemented in sdb.c
- */
-typedef enum {
-    TRACE_SDB = 0,
-    TRACE_SOCKETS,
-    TRACE_PACKETS,
-    TRACE_TRANSPORT,
-    TRACE_RWX,
-    TRACE_USB,
-    TRACE_SYNC,
-    TRACE_SYSDEPS,
-    TRACE_JDWP,
-    TRACE_SERVICES,
-    TRACE_PROPERTIES,
-    TRACE_SDKTOOLS
-} SdbTrace;
-
-#if SDB_TRACE
-
-#if !SDB_HOST
-/*
- * When running inside the emulator, guest's sdbd can connect to 'sdb-debug'
- * qemud service that can display sdb trace messages (on condition that emulator
- * has been started with '-debug sdb' option).
- */
-
-/* Delivers a trace message to the emulator via QEMU pipe. */
-void sdb_qemu_trace(const char* fmt, ...);
-/* Macro to use to send SDB trace messages to the emulator. */
-#define DQ(...)    sdb_qemu_trace(__VA_ARGS__)
-#else
-#define DQ(...) ((void)0)
-#endif  /* !SDB_HOST */
-
-  extern int     sdb_trace_mask;
-  extern unsigned char    sdb_trace_output_count;
-  void    sdb_trace_init(void);
-
-#  define SDB_TRACING  ((sdb_trace_mask & (1 << TRACE_TAG)) != 0)
-
-  /* you must define TRACE_TAG before using this macro */
-#  define  D(...)                                      \
-        do {                                           \
-            if (SDB_TRACING) {                         \
-                int save_errno = errno;                \
-                sdb_mutex_lock(&D_lock);               \
-                fprintf(stderr, "%s::%s():",           \
-                        __FILE__, __FUNCTION__);       \
-                errno = save_errno;                    \
-                fprintf(stderr, __VA_ARGS__ );         \
-                fflush(stderr);                        \
-                sdb_mutex_unlock(&D_lock);             \
-                errno = save_errno;                    \
-           }                                           \
-        } while (0)
-#  define  DR(...)                                     \
-        do {                                           \
-            if (SDB_TRACING) {                         \
-                int save_errno = errno;                \
-                sdb_mutex_lock(&D_lock);               \
-                errno = save_errno;                    \
-                fprintf(stderr, __VA_ARGS__ );         \
-                fflush(stderr);                        \
-                sdb_mutex_unlock(&D_lock);             \
-                errno = save_errno;                    \
-           }                                           \
-        } while (0)
-#else
-#  define  D(...)          ((void)0)
-#  define  DR(...)         ((void)0)
-#  define  SDB_TRACING     0
-#endif
-
-
 #if !TRACE_PACKETS
 #define print_packet(tag,p) do {} while (0)
 #endif
@@ -581,6 +501,7 @@ extern SdbdCommandlineArgs sdbd_commandline_args;
 #endif
 
 #define CHUNK_SIZE (64*1024)
+#define SDBD_SHELL_CMD_MAX 4096
 
 int sendfailmsg(int fd, const char *reason);
 int handle_host_request(char *service, transport_type ttype, char* serial, int reply_fd, asocket *s);