15 #include <netinet/in.h>
18 #include <arpa/inet.h>
20 #include <sys/socket.h>
27 #include <openssl/ssl.h>
28 #include <openssl/err.h>
32 #include <netinet/tcp.h>
37 #define MSG_DONTWAIT 0
46 #define RZ_INVALID_SOCKET INVALID_SOCKET
48 #define RZ_INVALID_SOCKET -1
87 #define RZ_SOCKET_PROTO_TCP IPPROTO_TCP
88 #define RZ_SOCKET_PROTO_UDP IPPROTO_UDP
89 #define RZ_SOCKET_PROTO_UNIX 0x1337
90 #define RZ_SOCKET_PROTO_NONE 0
91 #define RZ_SOCKET_PROTO_DEFAULT RZ_SOCKET_PROTO_TCP
99 #define rz_socket_connect_tcp(a, b, c, d) rz_socket_connect(a, b, c, RZ_SOCKET_PROTO_TCP, d)
100 #define rz_socket_connect_udp(a, b, c, d) rz_socket_connect(a, b, c, RZ_SOCKET_PROTO_UDP, d)
102 #define rz_socket_connect_unix(a, b) rz_socket_connect(a, b, b, RZ_SOCKET_PROTO_UNIX, 0)
104 #define rz_socket_connect_unix(a, b) (false)
167 typedef char *(*rap_server_cmd)(
void *user,
const char *
command);
211 #define RZ_RUN_PROFILE_NARGS 512
const lzma_allocator const uint8_t size_t uint8_t * out
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags cmd
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char pathname
static static fork const void static count static fd const char const char static newpath char char argv
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync const char const char static newpath const char static pathname pipe
RZ_API RzSocketProc * rz_socket_proc_open(char *const argv[])
RZ_API void rz_run_reset(RzRunProfile *p)
RZ_API bool rz_socket_rap_server_continue(RzSocketRapServer *rap_s)
RZ_API char * rz_socket_rap_client_command(RzSocket *s, const char *cmd, RzCoreBind *c)
RZ_API int rzpipe_close(RzPipe *rzpipe)
RZ_API int rz_socket_close(RzSocket *s)
RZ_API int rz_socket_puts(RzSocket *s, char *buf)
RZ_API bool rz_socket_rap_server_listen(RzSocketRapServer *rap_s, const char *certfile)
RZ_API RzPipe * rzpipe_open(const char *cmd)
RZ_API int rz_socket_read_block(RzSocket *s, unsigned char *buf, int len)
RZ_API RzSocketHTTPRequest * rz_socket_http_accept(RzSocket *s, RzSocketHTTPOptions *so)
RZ_API bool rz_socket_is_connected(RzSocket *)
RZ_API RzPipe * rzpipe_open_dl(const char *file)
RZ_API char * rzpipe_cmdf(RzPipe *rzpipe, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_LIB_VERSION_HEADER(rz_socket)
#define RZ_RUN_PROFILE_NARGS
RZ_API int rz_socket_proc_write(RzSocketProc *sp, void *buf, int len)
RZ_API RzSocket * rz_socket_rap_server_accept(RzSocketRapServer *rap_s)
RZ_API int rz_socket_close_fd(RzSocket *s)
RZ_API int rz_socket_rap_client_open(RzSocket *s, const char *file, int rw)
RZ_API RzPipe * rzpipe_open_corebind(RzCoreBind *coreb)
RZ_API int rz_socket_ready(RzSocket *s, int secs, int usecs)
RZ_API int rz_socket_port_by_name(const char *name)
RZ_API void rz_run_free(RzRunProfile *r)
char *(* rap_server_cmd)(void *user, const char *command)
RZ_API RzSocket * rz_socket_accept(RzSocket *s)
RZ_API bool rz_socket_spawn(RzSocket *s, const char *cmd, unsigned int timeout)
RZ_API RzSocketRapServer * rz_socket_rap_server_new(bool is_ssl, const char *port)
RZ_API void rz_socket_http_response(RzSocketHTTPRequest *rs, int code, const char *out, int x, const char *headers)
RZ_API int rz_socket_rap_client_write(RzSocket *s, const ut8 *buf, int count)
RZ_API char * rzpipe_read(RzPipe *rzpipe)
RZ_API RzRunProfile * rz_run_new(const char *str)
RZ_API void rz_socket_http_server_set_breaked(bool *b)
RZ_API char * rzpipe_cmd(RzPipe *rzpipe, const char *str)
int(* rap_server_seek)(void *user, ut64 offset, int whence)
RZ_API bool rz_socket_listen(RzSocket *s, const char *port, const char *certfile)
RZ_API void rz_socket_proc_printf(RzSocketProc *sp, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API int rz_socket_connect_serial(RzSocket *sock, const char *path, int speed, int parity)
RZ_API void RZ_API int rz_socket_proc_ready(RzSocketProc *sp, int secs, int usecs)
RZ_API int rz_socket_proc_read(RzSocketProc *sp, unsigned char *buf, int len)
struct rz_socket_http_options RzSocketHTTPOptions
RZ_API int rz_socket_proc_gets(RzSocketProc *sp, char *buf, int size)
RZ_API int rzpipe_write(RzPipe *rzpipe, const char *str)
int(* rap_server_write)(void *user, ut8 *buf, int len)
RZ_API const char * rz_run_help(void)
struct rz_socket_t RzSocket
RZ_API RzSocketRapServer * rz_socket_rap_server_create(const char *pathname)
RZ_API bool rz_run_parsefile(RzRunProfile *p, const char *b)
RZ_API int rz_socket_proc_close(RzSocketProc *sp)
struct rz_socket_rap_server_t RzSocketRapServer
RZ_API int rz_socket_flush(RzSocket *s)
RZ_API ut8 * rz_socket_http_handle_upload(const ut8 *str, int len, int *olen)
RZ_API bool rz_socket_block_time(RzSocket *s, bool block, int sec, int usec)
RZ_API char * rz_socket_to_string(RzSocket *s)
RZ_API int rz_socket_gets(RzSocket *s, char *buf, int size)
RZ_API void RZ_API int rz_socket_read(RzSocket *s, ut8 *read, int len)
int(* rap_server_read)(void *user, ut8 *buf, int len)
int(* rap_server_close)(void *user, int fd)
RZ_API void rz_socket_printf(RzSocket *s, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API bool rz_socket_connect(RzSocket *s, const char *host, const char *port, int proto, unsigned int timeout)
RZ_API RzSocket * rz_socket_accept_timeout(RzSocket *s, unsigned int timeout)
RZ_API char * rz_socket_http_get(const char *url, int *code, int *rlen)
RZ_API char * rz_socket_http_post(const char *url, const char *data, int *code, int *rlen)
RZ_API bool rz_run_parseline(RzRunProfile *p, const char *b)
RZ_API char * rz_run_get_environ_profile(char **env)
RZ_API int rz_run_start(RzRunProfile *p)
RZ_API int rz_socket_rap_client_read(RzSocket *s, ut8 *buf, int count)
RZ_API RzSocket * rz_socket_new(bool is_ssl)
RZ_API ut8 * rz_socket_slurp(RzSocket *s, int *len)
RZ_API void rz_socket_rap_server_free(RzSocketRapServer *rap_s)
RZ_API RzSocket * rz_socket_new_from_fd(int fd)
struct rz_run_profile_t RzRunProfile
RZ_API int rz_run_config_env(RzRunProfile *p)
RZ_API int rz_socket_free(RzSocket *s)
int(* rap_server_open)(void *user, const char *file, int flg, int mode)
RZ_API bool rz_run_parse(RzRunProfile *pf, const char *profile)
RZ_API int rz_socket_write(RzSocket *s, void *buf, int len)
RZ_API int rz_socket_rap_client_seek(RzSocket *s, ut64 offset, int whence)
struct rz_socket_http_request RzSocketHTTPRequest
struct rz_socket_proc_t RzSocketProc
RZ_API void rz_socket_http_close(RzSocketHTTPRequest *rs)
#define RZ_PRINTF_CHECK(fmt, dots)
char * _args[RZ_RUN_PROFILE_NARGS]
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)
int read(izstream &zs, T *x, Items items)