Add mud_is_up()
This commit is contained in:
12
mud.c
12
mud.c
@@ -649,6 +649,18 @@ int mud_can_pull (struct mud *mud)
|
|||||||
return (mud->rx.start != MUD_PACKET_NEXT(mud->rx.end));
|
return (mud->rx.start != MUD_PACKET_NEXT(mud->rx.end));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mud_is_up (struct mud *mud)
|
||||||
|
{
|
||||||
|
struct path *path;
|
||||||
|
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
|
for (path = mud->path; path; path = path->next)
|
||||||
|
ret += path->up;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int mud_pull (struct mud *mud)
|
int mud_pull (struct mud *mud)
|
||||||
{
|
{
|
||||||
unsigned char ctrl[1024];
|
unsigned char ctrl[1024];
|
||||||
|
|||||||
1
mud.h
1
mud.h
@@ -14,6 +14,7 @@ int mud_bind (struct mud *, const char *);
|
|||||||
int mud_peer (struct mud *, const char *, const char *);
|
int mud_peer (struct mud *, const char *, const char *);
|
||||||
|
|
||||||
int mud_can_pull (struct mud *);
|
int mud_can_pull (struct mud *);
|
||||||
|
int mud_is_up (struct mud *);
|
||||||
|
|
||||||
int mud_pull (struct mud *);
|
int mud_pull (struct mud *);
|
||||||
int mud_push (struct mud *);
|
int mud_push (struct mud *);
|
||||||
|
|||||||
Reference in New Issue
Block a user