Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
e0f6a2e7
Commit
e0f6a2e7
authored
Jul 12, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue_msg functions: SEND_AND_RET macro, msg_issue_wrsig implemented
parent
9aefe902
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
20 deletions
+31
-20
common-fun.h
proto-ext-whiterabbit/common-fun.h
+17
-0
msg.c
proto-ext-whiterabbit/msg.c
+4
-19
wr-msg.c
proto-ext-whiterabbit/wr-msg.c
+10
-1
No files found.
proto-ext-whiterabbit/common-fun.h
View file @
e0f6a2e7
...
...
@@ -7,6 +7,23 @@
/* Contains all functions common to more than one state */
/* The following macros are used both by msg.c and by wr-msg.c */
#define MSG_SEND_AND_RET_VARLEN(x,y,z,w)\
if (pp_send_packet(ppi, ppi->buf_out, w,\
&ppi->last_snt_time, PP_NP_##y , z) < w) {\
PP_PRINTF("%s(%d) Message can't be sent -> FAULTY state!\n",\
pp_msg_names[PPM_##x], PPM_##x);\
return -1;\
}\
PP_PRINTF("SENT %02d %d.%d %s \n", w,\
ppi->last_snt_time.seconds,\
ppi->last_snt_time.nanoseconds,pp_msg_names[PPM_##x]);\
ppi->sent_seq_id[PPM_## x]++;\
return 0;
#define MSG_SEND_AND_RET(x,y,z)\
MSG_SEND_AND_RET_VARLEN(x,y,z,PP_## x ##_LENGTH)
/* returns -1 in case of error, see below */
int
st_com_execute_slave
(
struct
pp_instance
*
ppi
,
int
check_delayreq
);
...
...
proto-ext-whiterabbit/msg.c
View file @
e0f6a2e7
...
...
@@ -6,6 +6,7 @@
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
#include "wr-api.h"
#include "common-fun.h"
static
inline
void
Integer64_display
(
const
char
*
label
,
Integer64
*
bigint
)
{
...
...
@@ -597,28 +598,12 @@ const char const * pp_msg_names[] = {
"management"
};
#define MSG_SEND_AND_RET_VARLEN(x,y,z,w)\
if (pp_send_packet(ppi, ppi->buf_out, w,\
&ppi->last_snt_time, PP_NP_##y , z) < PP_## x ##_LENGTH) {\
PP_PRINTF("%s(%d) Message can't be sent -> FAULTY state!\n",\
pp_msg_names[PPM_##x], PPM_##x);\
return -1;\
}\
PP_PRINTF("SENT %02d %d.%d %s \n", PP_## x ##_LENGTH,\
ppi->last_snt_time.seconds,\
ppi->last_snt_time.nanoseconds,pp_msg_names[PPM_##x]);\
ppi->sent_seq_id[PPM_## x]++;\
return 0;
#define MSG_SEND_AND_RET(x,y,z)\
MSG_SEND_AND_RET_VARLEN(x,y,z,PP_## x ##_LENGTH)
/* Pack and send on general multicast ip adress an Announce message */
int
msg_issue_announce
(
struct
pp_instance
*
ppi
)
{
MSG_SEND_AND_RET_VARLEN
(
ANNOUNCE
,
GEN
,
0
,
msg_pack_announce
(
ppi
));
int
len
;
len
=
msg_pack_announce
(
ppi
);
MSG_SEND_AND_RET_VARLEN
(
ANNOUNCE
,
GEN
,
0
,
len
);
}
/* Pack and send on event multicast ip adress a Sync message */
...
...
proto-ext-whiterabbit/wr-msg.c
View file @
e0f6a2e7
...
...
@@ -5,7 +5,8 @@
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
#include "wr-constants.h"
#include "wr-api.h"
#include "common-fun.h"
/*
* WR way to handle little/big endianess
...
...
@@ -254,3 +255,11 @@ void msg_unpack_wrsig(struct pp_instance *ppi, void *buf,
}
/* FIXME diagnostic */
}
/* Pack and send a White Rabbit signalling message */
int
msg_issue_wrsig
(
struct
pp_instance
*
ppi
,
Enumeration16
wr_msg_id
)
{
int
len
;
len
=
msg_pack_wrsig
(
ppi
,
wr_msg_id
);
MSG_SEND_AND_RET_VARLEN
(
SIGNALING
,
GEN
,
0
,
len
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment