Loading lib/communication.c +5 −5 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ static int recv_message(int conn, norns_msgbuffer_t* buffer); static ssize_t recv_data(int conn, void* data, size_t size); static ssize_t send_data(int conn, const void* data, size_t size); static void print_hex(void* buffer, size_t bytes) __attribute__((unused)); static norns_error_t send_request(norns_rpc_type_t type, norns_response_t* resp, ...); static norns_error_t send_request(norns_msgtype_t type, norns_response_t* resp, ...); norns_error_t send_submit_request(norns_iotask_t* task) { Loading Loading @@ -147,7 +147,7 @@ send_ping_request() { } norns_error_t send_job_request(norns_rpc_type_t type, uint32_t jobid, nornsctl_job_t* job) { send_job_request(norns_msgtype_t type, uint32_t jobid, nornsctl_job_t* job) { int res; norns_response_t resp; Loading @@ -166,7 +166,7 @@ send_job_request(norns_rpc_type_t type, uint32_t jobid, nornsctl_job_t* job) { norns_error_t send_process_request(norns_rpc_type_t type, uint32_t jobid, send_process_request(norns_msgtype_t type, uint32_t jobid, uid_t uid, gid_t gid, pid_t pid) { int res; Loading @@ -185,7 +185,7 @@ send_process_request(norns_rpc_type_t type, uint32_t jobid, } norns_error_t send_namespace_request(norns_rpc_type_t type, const char* nsid, send_namespace_request(norns_msgtype_t type, const char* nsid, nornsctl_backend_t* ns) { int res; Loading @@ -204,7 +204,7 @@ send_namespace_request(norns_rpc_type_t type, const char* nsid, } static int send_request(norns_rpc_type_t type, norns_response_t* resp, ...) { send_request(norns_msgtype_t type, norns_response_t* resp, ...) { int res; int conn = -1; Loading lib/communication.h +3 −3 Original line number Diff line number Diff line Loading @@ -34,11 +34,11 @@ norns_error_t send_submit_request(norns_iotask_t* task); norns_error_t send_status_request(norns_iotask_t* task, norns_stat_t* stats); norns_error_t send_job_request(norns_rpc_type_t type, uint32_t jobid, norns_error_t send_job_request(norns_msgtype_t type, uint32_t jobid, nornsctl_job_t* job); norns_error_t send_process_request(norns_rpc_type_t type, uint32_t jobid, norns_error_t send_process_request(norns_msgtype_t type, uint32_t jobid, uid_t uid, gid_t gid, pid_t pid); norns_error_t send_namespace_request(norns_rpc_type_t type, const char* nsid, norns_error_t send_namespace_request(norns_msgtype_t type, const char* nsid, nornsctl_backend_t* backend); norns_error_t send_control_status_request(nornsctl_stat_t* stats); norns_error_t send_ping_request() __attribute__((deprecated)); Loading lib/requests.c +6 −6 Original line number Diff line number Diff line Loading @@ -78,12 +78,12 @@ static void free_path_msg(Norns__Rpc__Request__Task__PosixPath* msg); static int encode_request_type(norns_rpc_type_t type); static norns_rpc_type_t encode_request_type(norns_msgtype_t type); static norns_msgtype_t decode_response_type(int type); static int encode_request_type(norns_rpc_type_t type) { encode_request_type(norns_msgtype_t type) { switch(type) { case NORNS_IOTASK_SUBMIT: return NORNS__RPC__REQUEST__TYPE__IOTASK_SUBMIT; Loading Loading @@ -114,7 +114,7 @@ encode_request_type(norns_rpc_type_t type) { } } static norns_rpc_type_t static norns_msgtype_t decode_response_type(int norns_rpc_type) { switch(norns_rpc_type) { case NORNS__RPC__RESPONSE__TYPE__IOTASK_SUBMIT: Loading Loading @@ -149,7 +149,7 @@ decode_response_type(int norns_rpc_type) { } Norns__Rpc__Request* build_request_msg(norns_rpc_type_t type, va_list ap) { build_request_msg(norns_msgtype_t type, va_list ap) { Norns__Rpc__Request* req_msg = NULL; Loading Loading @@ -705,7 +705,7 @@ free_task_msg(Norns__Rpc__Request__Task* msg) { } int pack_to_buffer(norns_rpc_type_t type, norns_msgbuffer_t* buf, ...) { pack_to_buffer(norns_msgtype_t type, norns_msgbuffer_t* buf, ...) { Norns__Rpc__Request* req_msg = NULL; void* req_buf = NULL; Loading lib/requests.h +3 −3 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ typedef enum { NORNS_NAMESPACE_UNREGISTER, /* other */ NORNS_BAD_RPC } norns_rpc_type_t; } norns_msgtype_t; typedef struct { void* b_data; Loading @@ -68,7 +68,7 @@ typedef struct { } typedef struct { norns_rpc_type_t r_type; norns_msgtype_t r_type; int r_error_code; union { size_t r_taskid; Loading @@ -85,7 +85,7 @@ typedef struct { }; } norns_response_t; int pack_to_buffer(norns_rpc_type_t type, norns_msgbuffer_t* buf, ...); int pack_to_buffer(norns_msgtype_t type, norns_msgbuffer_t* buf, ...); int unpack_from_buffer(norns_msgbuffer_t* buf, norns_response_t* response); #pragma GCC visibility pop Loading Loading
lib/communication.c +5 −5 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ static int recv_message(int conn, norns_msgbuffer_t* buffer); static ssize_t recv_data(int conn, void* data, size_t size); static ssize_t send_data(int conn, const void* data, size_t size); static void print_hex(void* buffer, size_t bytes) __attribute__((unused)); static norns_error_t send_request(norns_rpc_type_t type, norns_response_t* resp, ...); static norns_error_t send_request(norns_msgtype_t type, norns_response_t* resp, ...); norns_error_t send_submit_request(norns_iotask_t* task) { Loading Loading @@ -147,7 +147,7 @@ send_ping_request() { } norns_error_t send_job_request(norns_rpc_type_t type, uint32_t jobid, nornsctl_job_t* job) { send_job_request(norns_msgtype_t type, uint32_t jobid, nornsctl_job_t* job) { int res; norns_response_t resp; Loading @@ -166,7 +166,7 @@ send_job_request(norns_rpc_type_t type, uint32_t jobid, nornsctl_job_t* job) { norns_error_t send_process_request(norns_rpc_type_t type, uint32_t jobid, send_process_request(norns_msgtype_t type, uint32_t jobid, uid_t uid, gid_t gid, pid_t pid) { int res; Loading @@ -185,7 +185,7 @@ send_process_request(norns_rpc_type_t type, uint32_t jobid, } norns_error_t send_namespace_request(norns_rpc_type_t type, const char* nsid, send_namespace_request(norns_msgtype_t type, const char* nsid, nornsctl_backend_t* ns) { int res; Loading @@ -204,7 +204,7 @@ send_namespace_request(norns_rpc_type_t type, const char* nsid, } static int send_request(norns_rpc_type_t type, norns_response_t* resp, ...) { send_request(norns_msgtype_t type, norns_response_t* resp, ...) { int res; int conn = -1; Loading
lib/communication.h +3 −3 Original line number Diff line number Diff line Loading @@ -34,11 +34,11 @@ norns_error_t send_submit_request(norns_iotask_t* task); norns_error_t send_status_request(norns_iotask_t* task, norns_stat_t* stats); norns_error_t send_job_request(norns_rpc_type_t type, uint32_t jobid, norns_error_t send_job_request(norns_msgtype_t type, uint32_t jobid, nornsctl_job_t* job); norns_error_t send_process_request(norns_rpc_type_t type, uint32_t jobid, norns_error_t send_process_request(norns_msgtype_t type, uint32_t jobid, uid_t uid, gid_t gid, pid_t pid); norns_error_t send_namespace_request(norns_rpc_type_t type, const char* nsid, norns_error_t send_namespace_request(norns_msgtype_t type, const char* nsid, nornsctl_backend_t* backend); norns_error_t send_control_status_request(nornsctl_stat_t* stats); norns_error_t send_ping_request() __attribute__((deprecated)); Loading
lib/requests.c +6 −6 Original line number Diff line number Diff line Loading @@ -78,12 +78,12 @@ static void free_path_msg(Norns__Rpc__Request__Task__PosixPath* msg); static int encode_request_type(norns_rpc_type_t type); static norns_rpc_type_t encode_request_type(norns_msgtype_t type); static norns_msgtype_t decode_response_type(int type); static int encode_request_type(norns_rpc_type_t type) { encode_request_type(norns_msgtype_t type) { switch(type) { case NORNS_IOTASK_SUBMIT: return NORNS__RPC__REQUEST__TYPE__IOTASK_SUBMIT; Loading Loading @@ -114,7 +114,7 @@ encode_request_type(norns_rpc_type_t type) { } } static norns_rpc_type_t static norns_msgtype_t decode_response_type(int norns_rpc_type) { switch(norns_rpc_type) { case NORNS__RPC__RESPONSE__TYPE__IOTASK_SUBMIT: Loading Loading @@ -149,7 +149,7 @@ decode_response_type(int norns_rpc_type) { } Norns__Rpc__Request* build_request_msg(norns_rpc_type_t type, va_list ap) { build_request_msg(norns_msgtype_t type, va_list ap) { Norns__Rpc__Request* req_msg = NULL; Loading Loading @@ -705,7 +705,7 @@ free_task_msg(Norns__Rpc__Request__Task* msg) { } int pack_to_buffer(norns_rpc_type_t type, norns_msgbuffer_t* buf, ...) { pack_to_buffer(norns_msgtype_t type, norns_msgbuffer_t* buf, ...) { Norns__Rpc__Request* req_msg = NULL; void* req_buf = NULL; Loading
lib/requests.h +3 −3 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ typedef enum { NORNS_NAMESPACE_UNREGISTER, /* other */ NORNS_BAD_RPC } norns_rpc_type_t; } norns_msgtype_t; typedef struct { void* b_data; Loading @@ -68,7 +68,7 @@ typedef struct { } typedef struct { norns_rpc_type_t r_type; norns_msgtype_t r_type; int r_error_code; union { size_t r_taskid; Loading @@ -85,7 +85,7 @@ typedef struct { }; } norns_response_t; int pack_to_buffer(norns_rpc_type_t type, norns_msgbuffer_t* buf, ...); int pack_to_buffer(norns_msgtype_t type, norns_msgbuffer_t* buf, ...); int unpack_from_buffer(norns_msgbuffer_t* buf, norns_response_t* response); #pragma GCC visibility pop Loading