%{#
#include "libc/arpa/CATS/inet.cats"
%}
staload IN = "libc/netinet/SATS/in.sats"
typedef in_port_nbo_t = $IN.in_port_nbo_t
typedef in_addr_hbo_t = $IN.in_addr_hbo_t
typedef in_addr_nbo_t = $IN.in_addr_nbo_t
typedef in_addr_struct = $IN.in_addr_struct
abst@ype uint16_t0ype_netbyteord = uint16_t0ype
typedef uint16_nbo = uint16_t0ype_netbyteord
fun htons (i: uint16_t0ype): uint16_t0ype_netbyteord = "atslib_htons"
fun ntohs (i: uint16_t0ype_netbyteord): uint16_t0ype = "atslib_ntohs"
abst@ype uint32_t0ype_netbyteord = uint32_t0ype
typedef uint32_nbo = uint32_t0ype_netbyteord
fun htonl (i: uint32_t0ype): uint32_t0ype_netbyteord = "atslib_htonl"
fun ntohl (i: uint32_t0ype_netbyteord): uint32_t0ype = "atslib_ntohl"
castfn in_port_of_uint16_nbo (x: uint16_nbo): in_port_nbo_t
castfn uint16_of_in_port_nbo (x: in_port_nbo_t): uint16_nbo
fun inet_aton_err (
cp: string
, inp: &in_addr_struct? >> opt (in_addr_struct, b)
) : #[b:bool] bool b = "atslib_inet_aton_err"
fun inet_aton_exn (
cp: string, inp: &in_addr_struct? >> in_addr_struct
) :<!exn> void = "atslib_inet_aton_exn"
fun inet_addr
(cp: string): in_addr_nbo_t = "#atslib_inet_addr"
fun inet_network
(cp: string): in_addr_hbo_t = "#atslib_inet_network"
fun inet_makeaddr
(net: int, host: int): in_addr_struct = "#atslib_inet_makeaddr"
fun inet_ntoa
(inp: in_addr_struct)
:<!ref> [l:agz] (strptr l -<lin,prf> void | strptr l)
= "#atslib_inet_ntoa"
fun inet_lnaof
(addr: in_addr_struct): in_addr_hbo_t = "#atslib_inet_lnaof"
fun inet_netof
(addr: in_addr_struct): in_addr_hbo_t = "#atslib_inet_netof"
fun inet4_pton (
cp: string , inp: &in_addr_struct? >> opt (in_addr_struct, i > 0)
) : #[i:int] int (i) = "#atslib_inet4_pton"
fun inet6_pton (
cp: string , inp: &in_addr_struct? >> opt (in_addr_struct, i > 0)
) : #[i:int] int (i) = "#atslib_inet6_pton"