summaryrefslogtreecommitdiff
path: root/src/libstddjb/ip46_scan.c
blob: 73045e68f3d029aaea3149043ec8260ffd0cc455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* ISC license. */

#include <sys/types.h>
#include <skalibs/fmtscan.h>
#include <skalibs/ip46.h>

size_t ip46full_scan (char const *s, ip46full_t *ip)
{
  size_t len = ip6_scan(s, ip->ip) ;
  if (len) ip->is6 = 1 ;
  else
  {
    len = ip4_scan(s, ip->ip) ;
    if (len) ip->is6 = 0 ;
  }
  return len ;
}