1 /* Copyright (C) 2006-2010 The Android Open Source Project
3 ** This software is licensed under the terms of the GNU General Public
4 ** License version 2, as published by the Free Software Foundation, and
5 ** may be copied, distributed, and modified under those terms.
7 ** This program is distributed in the hope that it will be useful,
8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 ** GNU General Public License for more details.
13 #include "maru_common.h"
17 #define SDB_HOST_PORT 26099
27 # define EWOULDBLOCK EAGAIN
30 # define EINPROGRESS 10036
33 # define EALREADY 10037
36 # define EDESTADDRREQ 10039
39 # define EMSGSIZE 10040
42 # define EPROTOTYPE 10041
45 # define ENOPROTOOPT 10042
48 # define EAFNOSUPPORT 10047
51 # define EADDRINUSE 10048
53 # ifndef EADDRNOTAVAIL
54 # define EADDRNOTAVAIL 10049
57 # define ENETDOWN 10050
60 # define ENETUNREACH 10051
63 # define ENETRESET 10052
66 # define ECONNABORTED 10053
69 # define ECONNRESET 10054
72 # define ENOBUFS 10055
75 # define EISCONN 10056
78 # define ENOTCONN 10057
81 # define ESHUTDOWN 10058
84 # define ETOOMANYREFS 10059
87 # define ETIMEDOUT 10060
90 # define ECONNREFUSED 10061
96 # define EHOSTDOWN 10064
99 # define EHOSTUNREACH 10065
103 #define SDB_TCP_EMULD_INDEX 3 /* emulator daemon port */
104 #define SDB_TCP_OPENGL_INDEX 4 /* opengl server port */
105 #define SDB_UDP_SENSOR_INDEX 3 /* sensor server port */
107 extern int tizen_base_port;
109 void sdb_setup(void);
110 int get_sdb_base_port(void);
111 int inet_strtoip(const char* str, uint32_t *ip);
112 int socket_send(int fd, const void* buf, int buflen);
113 void socket_close(int fd);
114 void notify_sdb_daemon_start(void);
115 int check_port_bind_listen(uint32_t port);
116 int sdb_loopback_client(int port, int type);