Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
ssg
Commits
a1f37575
Commit
a1f37575
authored
Jul 02, 2018
by
Shane Snyder
Browse files
expose swim_member_state to SSG
also start removing ssg references from swim code
parent
be93f6db
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/ssg-internal.h
View file @
a1f37575
...
...
@@ -47,6 +47,7 @@ typedef struct ssg_member_state
ssg_member_id_t
id
;
char
*
addr_str
;
hg_addr_t
addr
;
swim_member_state_t
swim_state
;
struct
ssg_member_state
*
next
;
UT_hash_handle
hh
;
}
ssg_member_state_t
;
...
...
src/swim-fd/swim-fd-internal.h
View file @
a1f37575
...
...
@@ -6,8 +6,6 @@
#pragma once
#include
<ssg.h>
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -20,17 +18,8 @@ extern "C" {
#define SWIM_MAX_PIGGYBACK_ENTRIES 8
#define SWIM_MAX_PIGGYBACK_TX_COUNT 50
typedef
uint8_t
swim_member_status_t
;
typedef
uint32_t
swim_member_inc_nr_t
;
typedef
struct
swim_member_update
swim_member_update_t
;
enum
swim_member_status
{
SWIM_MEMBER_ALIVE
=
0
,
SWIM_MEMBER_SUSPECT
,
SWIM_MEMBER_DEAD
};
struct
swim_member_update
{
ssg_member_id_t
id
;
...
...
src/swim-fd/swim-fd.c
View file @
a1f37575
...
...
@@ -14,8 +14,6 @@
#include
<abt.h>
#include
<margo.h>
#include
"ssg.h"
#include
"ssg-internal.h"
#include
"swim-fd.h"
#include
"swim-fd-internal.h"
...
...
@@ -61,34 +59,24 @@ static int swim_get_rand_group_member_set(
******************************************************/
swim_context_t
*
swim_init
(
ssg_
group_
t
*
g
,
void
*
group_
data
,
int
active
)
{
swim_context_t
*
swim_ctx
;
int
i
,
ret
;
if
(
g
==
NULL
)
return
NULL
;
/* allocate structure for storing swim context */
swim_ctx
=
malloc
(
sizeof
(
*
swim_ctx
));
if
(
!
swim_ctx
)
return
NULL
;
memset
(
swim_ctx
,
0
,
sizeof
(
*
swim_ctx
));
#if 0
/* initialize SWIM context */
margo_get_handler_pool(ssg_inst->mid, &swim_ctx->prot_pool);
swim_ctx->ping_target = SSG_MEMBER_ID_INVALID;
for(i = 0; i < SWIM_MAX_SUBGROUP_SIZE; i++)
swim_ctx->subgroup_members[i] = SSG_MEMBER_ID_INVALID;
swim_ctx
->
member_inc_nrs
=
malloc
(
g
->
view
.
size
*
sizeof
(
*
(
swim_ctx
->
member_inc_nrs
)));
if
(
!
swim_ctx
->
member_inc_nrs
)
{
free
(
swim_ctx
);
return
NULL
;
}
memset
(
swim_ctx
->
member_inc_nrs
,
0
,
g
->
view
.
size
*
sizeof
(
*
(
swim_ctx
->
member_inc_nrs
)));
#endif
/* set protocol parameters */
swim_ctx
->
prot_period_len
=
SWIM_DEF_PROTOCOL_PERIOD_LEN
;
...
...
src/swim-fd/swim-fd.h
View file @
a1f37575
...
...
@@ -6,8 +6,8 @@
#pragma once
#include
"ssg
.h
"
#include
"ssg-internal
.h
"
#include
<stdint
.h
>
#include
<inttypes
.h
>
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -16,10 +16,27 @@ extern "C" {
/* opaque swim context type */
typedef
struct
swim_context
swim_context_t
;
/* swim member specific types */
typedef
uint32_t
swim_member_inc_nr_t
;
typedef
enum
swim_member_status
{
SWIM_MEMBER_ALIVE
=
0
,
SWIM_MEMBER_SUSPECT
,
SWIM_MEMBER_DEAD
}
swim_member_status_t
;
typedef
struct
swim_member_state
{
swim_member_inc_nr_t
inc_nr
;
swim_member_status_t
status
;
}
swim_member_state_t
;
/* Initialize SWIM */
swim_context_t
*
swim_init
(
ssg_
group_
t
*
g
,
void
*
group_
data
,
int
active
);
/* Finalize SWIM */
void
swim_finalize
(
swim_context_t
*
swim_ctx
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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