| if ( !bs ) | if ( !bs ) | ||||
| return NULL; | return NULL; | ||||
| if ( bs->af == 4 ) { | |||||
| if ( bs->ip.af == 4 ) { | |||||
| str = malloc(INET_ADDRSTRLEN); | str = malloc(INET_ADDRSTRLEN); | ||||
| assert(str); | assert(str); | ||||
| memset(str, 0, INET_ADDRSTRLEN); | memset(str, 0, INET_ADDRSTRLEN); | ||||
| inet_ntop(AF_INET, &bs->addr.inet, str, INET_ADDRSTRLEN); | |||||
| inet_ntop(AF_INET, &bs->ip.addr.inet, str, INET_ADDRSTRLEN); | |||||
| } | } | ||||
| else if ( bs->af == 6 ) { | |||||
| else if ( bs->ip.af == 6 ) { | |||||
| str = malloc(INET6_ADDRSTRLEN); | str = malloc(INET6_ADDRSTRLEN); | ||||
| assert(str); | assert(str); | ||||
| memset(str, 0, INET6_ADDRSTRLEN); | memset(str, 0, INET6_ADDRSTRLEN); | ||||
| inet_ntop(AF_INET6, &bs->addr.inet6, str, INET6_ADDRSTRLEN); | |||||
| inet_ntop(AF_INET6, &bs->ip.addr.inet6, str, INET6_ADDRSTRLEN); | |||||
| } | } | ||||
| return str; | return str; | ||||
| } | } |