libowfat/socket/fmt_ip6if.c
leitner 0f60bacb89 add routines to scan and output ipv6 addresses with %eth0 notation.
also add compat formatting routines that will output v4-mapped addresses
  as ipv4 addresses
2003-12-05 19:53:59 +00:00

16 lines
306 B
C

#include "ip6.h"
#include "str.h"
#include "fmt.h"
#include "socket.h"
unsigned int fmt_ip6if(char* dest,const char* ip,uint32 scope_id) {
int i=fmt_ip6(dest,ip);
if (scope_id) {
if (dest) {
dest[i]='%'; ++i; dest+=i;
}
i+=fmt_str(dest,socket_getifname(scope_id));
}
return i;
}