Add mud_is_up()

This commit is contained in:
angt
2016-03-24 14:38:43 +00:00
parent 20c07fb6d9
commit 1b58401095
2 changed files with 13 additions and 0 deletions

12
mud.c
View File

@@ -649,6 +649,18 @@ int mud_can_pull (struct mud *mud)
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)
{
unsigned char ctrl[1024];

1
mud.h
View File

@@ -14,6 +14,7 @@ int mud_bind (struct mud *, const char *);
int mud_peer (struct mud *, const char *, const char *);
int mud_can_pull (struct mud *);
int mud_is_up (struct mud *);
int mud_pull (struct mud *);
int mud_push (struct mud *);