mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fixed some message format related things
git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@202 8ec27952-4edc-4aab-86aa-e87bb2611832
This commit is contained in:
parent
9727c3c4a5
commit
184893aade
2 changed files with 5 additions and 4 deletions
|
@ -15,7 +15,7 @@
|
|||
#define VERSION __GIT_TAG__ "-" __GIT_REV__
|
||||
|
||||
/** Maximum number of double values in a struct msg */
|
||||
#define MAX_VALUES 6
|
||||
#define MAX_VALUES 16
|
||||
|
||||
/** Maximum number of registrable hook functions per path */
|
||||
#define MAX_HOOKS 5
|
||||
|
|
|
@ -68,7 +68,7 @@ void msg_random(struct msg *m)
|
|||
int msg_send(struct msg *m, struct node *n)
|
||||
{
|
||||
/* Convert headers to network byte order */
|
||||
m->sequence = ntohs(m->sequence);
|
||||
m->sequence = htons(m->sequence);
|
||||
|
||||
if (sendto(n->sd, m, MSG_LEN(m->length), 0,
|
||||
(struct sockaddr *) &n->remote,
|
||||
|
@ -89,13 +89,14 @@ int msg_recv(struct msg *m, struct node *n)
|
|||
perror("Failed recv");
|
||||
|
||||
/* Convert headers to host byte order */
|
||||
m->sequence = htons(m->sequence);
|
||||
m->sequence = ntohs(m->sequence);
|
||||
|
||||
/* Convert message to host endianess */
|
||||
if (m->endian != MSG_ENDIAN_HOST)
|
||||
msg_swap(m);
|
||||
|
||||
debug(10, "Message received from node '%s'", n->name);
|
||||
debug(10, "Message received from node '%s': version=%u, type=%u, endian=%u, length=%u, sequence=%u",
|
||||
n->name, m->version, m->type, m->endian, m->length, m->sequence);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue