File: xsocket_type.c

package info (click to toggle)
dq 20250201-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,408 kB
  • sloc: ansic: 13,644; python: 651; makefile: 382; sh: 336
file content (13 lines) | stat: -rw-r--r-- 229 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "byte.h"
#include "xsocket.h"

int xsocket_type(const unsigned char *ip) {

    if (byte_isequal("\0\0\0\0\0\0\0\0\0\0\377\377", 12, ip)) {
        return XSOCKET_V4;
    }
    else {
        return XSOCKET_V6;
    }
}