strncpy() stops at the first null byte, which truncates the abstract
socket name "\0diag" to an empty string. This will result in a
"Diag response: Bad command" failure, fix this by using memcpy to
copy the full 5 bytes including the leading null that marks the
abstract namespace.
Signed-off-by: Sibi Sankar <sibi.sankar@oss.qualcomm.com>
Include needed headers to fix following errors
| router/dm.h:41:1: error: unknown type name 'ssize_t'; did you mean 'size_t'?
| ssize_t dm_send(struct diag_client *dm, const void *ptr, size_t len);
| ^~~~~~~
tools/send_data.c:55:9: error: variable 'tv' has initializer but
incomplete type
struct timeval tv = {5, 0};
^~~~~~~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
If the response is a "bad commad", print that rather than expecting the
user to know what command 19 is.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Move router code into "router" and move send_data into "tools", in order
to make things cleaner as the implementation gains further components.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>