projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git]
/
src
/
client-agent
/
sendmsg.c
diff --git
a/src/client-agent/sendmsg.c
b/src/client-agent/sendmsg.c
old mode 100755
(executable)
new mode 100644
(file)
index
438e848
..
454c2e7
--- a/
src/client-agent/sendmsg.c
+++ b/
src/client-agent/sendmsg.c
@@
-1,5
+1,3
@@
-/* @(#) $Id$ */
-
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
@@
-9,34
+7,30
@@
* Foundation
*/
* Foundation
*/
-
#include "shared.h"
#include "agentd.h"
#include "shared.h"
#include "agentd.h"
-
#include "os_net/os_net.h"
#include "os_net/os_net.h"
-
-/* Sends a message to the server */
-int send_msg(int agentid, char *msg)
+
+/* Send a message to the server */
+int send_msg(int agentid, const char *msg)
{
{
- int msg_size;
- char crypt_msg[OS_MAXSTR +1];
+ size_t msg_size;
+ char crypt_msg[OS_MAXSTR + 1];
msg_size = CreateSecMSG(&keys, msg, crypt_msg, agentid);
msg_size = CreateSecMSG(&keys, msg, crypt_msg, agentid);
- if(msg_size == 0)
- {
- merror(SEC_ERROR,ARGV0);
- return(-1);
+ if (msg_size == 0) {
+ merror(SEC_ERROR, ARGV0);
+ return (-1);
}
/* Send msg_size of crypt_msg */
}
/* Send msg_size of crypt_msg */
- if(OS_SendUDPbySize(logr->sock, msg_size, crypt_msg) < 0)
- {
- merror(SEND_ERROR,ARGV0, "server");
+ if (OS_SendUDPbySize(agt->sock, msg_size, crypt_msg) < 0) {
+ merror(SEND_ERROR, ARGV0, "server");
sleep(1);
sleep(1);
- return(-1);
+ return (-1);
}
}
- return(0);
+ return (0);
}
}