2003-12-05 19:53:59 +00:00
|
|
|
#include "ip6.h"
|
|
|
|
#include "str.h"
|
|
|
|
#include "fmt.h"
|
|
|
|
#include "socket.h"
|
|
|
|
|
2021-04-27 17:39:42 +00:00
|
|
|
size_t fmt_ip6if(char* dest,const char ip[16],uint32 scope_id) {
|
2014-03-14 19:42:54 +00:00
|
|
|
size_t i=fmt_ip6(dest,ip);
|
2003-12-05 19:53:59 +00:00
|
|
|
if (scope_id) {
|
|
|
|
if (dest) {
|
|
|
|
dest[i]='%'; ++i; dest+=i;
|
|
|
|
}
|
|
|
|
i+=fmt_str(dest,socket_getifname(scope_id));
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|