Show status of paths
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
29
src/show.c
29
src/show.c
@@ -1,6 +1,7 @@
|
||||
#include "common.h"
|
||||
#include "ctl.h"
|
||||
#include "str.h"
|
||||
#include "ssutils.h"
|
||||
|
||||
#include "../argz/argz.h"
|
||||
|
||||
@@ -10,34 +11,6 @@
|
||||
#include <sys/un.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
static unsigned short
|
||||
gt_ss_port(struct sockaddr_storage *ss)
|
||||
{
|
||||
switch (ss->ss_family) {
|
||||
case AF_INET:
|
||||
return ntohs(((struct sockaddr_in *)ss)->sin_port);
|
||||
case AF_INET6:
|
||||
return ntohs(((struct sockaddr_in6 *)ss)->sin6_port);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
gt_ss_addr(char *str, size_t size, struct sockaddr_storage *ss)
|
||||
{
|
||||
switch (ss->ss_family) {
|
||||
case AF_INET:
|
||||
return -!inet_ntop(AF_INET,
|
||||
&((struct sockaddr_in *)ss)->sin_addr, str, size);
|
||||
case AF_INET6:
|
||||
return -!inet_ntop(AF_INET6,
|
||||
&((struct sockaddr_in6 *)ss)->sin6_addr, str, size);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
gt_show_dev_status(int fd, const char *dev)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user