File: scan_ip6_flat.c

package info (click to toggle)
libowfat 0.28-6
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 4,068 kB
  • sloc: ansic: 12,863; makefile: 16
file content (16 lines) | stat: -rw-r--r-- 283 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "scan.h"

unsigned int scan_ip6_flat(const char *s,char ip[16])
{
  int i;
  for (i=0; i<16; i++) {
    int tmp;
    tmp=scan_fromhex(*s++);
    if (tmp<0) return 0;
    ip[i]=tmp << 4;
    tmp=scan_fromhex(*s++);
    if (tmp<0) return 0;
    ip[i]+=tmp;
  }
  return 32;
}