File: fmt_ip6if.c

package info (click to toggle)
libowfat 0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,288 kB
  • sloc: ansic: 20,181; makefile: 16
file content (15 lines) | stat: -rw-r--r-- 306 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "ip6.h"
#include "str.h"
#include "fmt.h"
#include "socket.h"

size_t fmt_ip6if(char* dest,const char ip[16],uint32 scope_id) {
  size_t 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;
}