Revert "Add the appcmd protocol for product extended routine."
[sdk/target/sdbd.git] / src / sdb.h
index 0a8f352..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
@@ -47,8 +46,6 @@
 
 #define SDB_SERVER_VERSION 0        // Increment this when we want to force users to start a new sdb server
 
-#define SDBD_UMASK 0022        // default file creation mask of sdbd
-
 typedef struct amessage amessage;
 typedef struct apacket apacket;
 typedef struct asocket asocket;
@@ -242,9 +239,6 @@ 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
@@ -280,13 +274,6 @@ typedef struct platform_capabilities
 } 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);
@@ -389,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 */
@@ -404,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);
@@ -422,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
@@ -591,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);