src/tcpkali_iface.c
void
fprint_addresses(FILE *fp, char *prefix, char *separator, char *suffix,
                 struct addresses addresses) {
    for(size_t n = 0; n < addresses.n_addrs; n++) {
        if(n == 0) {
            fprintf(fp, "%s", prefix);
        } else {
            fprintf(fp, "%s", separator);
        }
        char buf[INET6_ADDRSTRLEN + 64];
        fprintf(stderr, "%s",
                format_sockaddr(&addresses.addrs[n], buf, sizeof(buf)));
        if(n == addresses.n_addrs - 1) {
            fprintf(fp, "%s", suffix);
        }
    }
}
/*
 * Display destination addresses with a given prefix, separator and suffix.
 */
Display destination addresses with a given prefix, separator and suffix.
Display destination addresses with a given prefix separator and suffix .
void
fprint_addresses(FILE *fp, char *prefix, char *separator, char *suffix,
                 struct addresses addresses) {
    for(size_t n = 0; n < addresses.n_addrs; n++) {
        if(n == 0) {
            fprintf(fp, "%s", prefix);
        } else {
            fprintf(fp, "%s", separator);
        }
        char buf[INET6_ADDRSTRLEN + 64];
        fprintf(stderr, "%s",
                format_sockaddr(&addresses.addrs[n], buf, sizeof(buf)));
        if(n == addresses.n_addrs - 1) {
            fprintf(fp, "%s", suffix);
        }
    }
}
void fprint_addresses ( FILE * fp , char * prefix , char * separator , char * suffix , struct addresses addresses ) { for ( size_t n = 0 ; n < addresses . n_addrs ; n ++ ) { if ( n == 0 ) { fprintf ( fp , " " , prefix ) ; } else { fprintf ( fp , " " , separator ) ; } char buf [ INET6_ADDRSTRLEN + 64 ] ; fprintf ( stderr , " " , format_sockaddr ( & addresses . addrs [ n ] , buf , sizeof ( buf ) ) ) ; if ( n == addresses . n_addrs - 1 ) { fprintf ( fp , " " , suffix ) ; } } }
Display destination addresses with a given prefix, separator and suffix.
Display destination addresses with a given prefix separator and suffix .