static int sockaddr_to_str(char *dest, int max_len,

                           struct sockaddr_storage *ss, socklen_t ss_len,

                           struct sockaddr_storage *ps, socklen_t ps_len,

                           bool is_listen, bool is_telnet)

{

    char shost[NI_MAXHOST], sserv[NI_MAXSERV];

    char phost[NI_MAXHOST], pserv[NI_MAXSERV];

    const char *left = "", *right = "";



    switch (ss->ss_family) {

#ifndef _WIN32

    case AF_UNIX:

        return snprintf(dest, max_len, "unix:%s%s",

                        ((struct sockaddr_un *)(ss))->sun_path,

                        is_listen ? ",server" : "");

#endif

    case AF_INET6:

        left  = "[";

        right = "]";

        /* fall through */

    case AF_INET:

        getnameinfo((struct sockaddr *) ss, ss_len, shost, sizeof(shost),

                    sserv, sizeof(sserv), NI_NUMERICHOST | NI_NUMERICSERV);

        getnameinfo((struct sockaddr *) ps, ps_len, phost, sizeof(phost),

                    pserv, sizeof(pserv), NI_NUMERICHOST | NI_NUMERICSERV);

        return snprintf(dest, max_len, "%s:%s%s%s:%s%s <-> %s%s%s:%s",

                        is_telnet ? "telnet" : "tcp",

                        left, shost, right, sserv,

                        is_listen ? ",server" : "",

                        left, phost, right, pserv);



    default:

        return snprintf(dest, max_len, "unknown");

    }

}

static int sockaddr_to_str(char *dest, int max_len,

                           struct sockaddr_storage *ss, socklen_t ss_len,

                           struct sockaddr_storage *ps, socklen_t ps_len,

                           bool is_listen, bool is_telnet)

{

    char shost[NI_MAXHOST], sserv[NI_MAXSERV];

    char phost[NI_MAXHOST], pserv[NI_MAXSERV];

    const char *left = "", *right = "";



    switch (ss->ss_family) {

#ifndef _WIN32

    case AF_UNIX:

        return snprintf(dest, max_len, "unix:%s%s",

                        ((struct sockaddr_un *)(ss))->sun_path,

                        is_listen ? ",server" : "");

#endif

    case AF_INET6:

        left  = "[";

        right = "]";

        

    case AF_INET:

        getnameinfo((struct sockaddr *) ss, ss_len, shost, sizeof(shost),

                    sserv, sizeof(sserv), NI_NUMERICHOST | NI_NUMERICSERV);

        getnameinfo((struct sockaddr *) ps, ps_len, phost, sizeof(phost),

                    pserv, sizeof(pserv), NI_NUMERICHOST | NI_NUMERICSERV);

        return snprintf(dest, max_len, "%s:%s%s%s:%s%s <-> %s%s%s:%s",

                        is_telnet ? "telnet" : "tcp",

                        left, shost, right, sserv,

                        is_listen ? ",server" : "",

                        left, phost, right, pserv);



    default:

        return snprintf(dest, max_len, "unknown");

    }

}

static int FUNC_0(char *VAR_0, int VAR_1,

                           struct sockaddr_storage *VAR_2, socklen_t VAR_3,

                           struct sockaddr_storage *VAR_4, socklen_t VAR_5,

                           bool VAR_6, bool VAR_7)

{

    char VAR_8[NI_MAXHOST], sserv[NI_MAXSERV];

    char VAR_9[NI_MAXHOST], pserv[NI_MAXSERV];

    const char *VAR_10 = "", *VAR_11 = "";



    switch (VAR_2->ss_family) {

#ifndef _WIN32

    case AF_UNIX:

        return snprintf(VAR_0, VAR_1, "unix:%s%s",

                        ((struct sockaddr_un *)(VAR_2))->sun_path,

                        VAR_6 ? ",server" : "");

#endif

    case AF_INET6:

        VAR_10  = "[";

        VAR_11 = "]";

        

    case AF_INET:

        getnameinfo((struct sockaddr *) VAR_2, VAR_3, VAR_8, sizeof(VAR_8),

                    sserv, sizeof(sserv), NI_NUMERICHOST | NI_NUMERICSERV);

        getnameinfo((struct sockaddr *) VAR_4, VAR_5, VAR_9, sizeof(VAR_9),

                    pserv, sizeof(pserv), NI_NUMERICHOST | NI_NUMERICSERV);

        return snprintf(VAR_0, VAR_1, "%s:%s%s%s:%s%s <-> %s%s%s:%s",

                        VAR_7 ? "telnet" : "tcp",

                        VAR_10, VAR_8, VAR_11, sserv,

                        VAR_6 ? ",server" : "",

                        VAR_10, VAR_9, VAR_11, pserv);



    default:

        return snprintf(VAR_0, VAR_1, "unknown");

    }

}

static int FUNC_0(char *VAR_0, int VAR_1,
struct sockaddr_storage *VAR_2, socklen_t VAR_3,
struct sockaddr_storage *VAR_4, socklen_t VAR_5,
bool VAR_6, bool VAR_7)
{ char VAR_8[NI_MAXHOST], sserv[NI_MAXSERV]; char VAR_9[NI_MAXHOST], pserv[NI_MAXSERV]; const char *VAR_10 = "", *VAR_11 = ""; switch (VAR_2->ss_family) { #ifndef _WIN32
case AF_UNIX:
return snprintf(VAR_0, VAR_1, "unix:%s%s",
((struct sockaddr_un *)(VAR_2))->sun_path,
VAR_6 ? ",server" : ""); #endif
case AF_INET6:
VAR_10  = "["; VAR_11 = "]"; case AF_INET:
getnameinfo((struct sockaddr *) VAR_2, VAR_3, VAR_8, sizeof(VAR_8),
sserv, sizeof(sserv), NI_NUMERICHOST | NI_NUMERICSERV); getnameinfo((struct sockaddr *) VAR_4, VAR_5, VAR_9, sizeof(VAR_9),
pserv, sizeof(pserv), NI_NUMERICHOST | NI_NUMERICSERV); return snprintf(VAR_0, VAR_1, "%s:%s%s%s:%s%s <-> %s%s%s:%s",
VAR_7 ? "telnet" : "tcp",
VAR_10, VAR_8, VAR_11, sserv,
VAR_6 ? ",server" : "",
VAR_10, VAR_9, VAR_11, pserv); default:
return snprintf(VAR_0, VAR_1, "unknown"); } }