inet.c
Include dependency graph for inet.c:
Functions
-
enum inet_domain inet_atom_to_domain(term domain, GlobalContext *global)
Parse an inet domain atom.
- Parameters:
domain – the inet domain atom
global – the global context
- Returns:
InetDomain or InetInvalidDomain
-
enum inet_type inet_atom_to_type(term type, GlobalContext *global)
Parse an inet type.
- Parameters:
type – the inet type atom
global – the global context
- Returns:
the parsed type
-
enum inet_protocol inet_atom_to_protocol(term protocol, GlobalContext *global)
Parse an inet protocol.
- Parameters:
protocol – the inet protocol atom
global – the global context
- Returns:
the parsed protocol
-
uint32_t inet_addr4_to_uint32(term addr_tuple)
Parse an inet IPv4 address tuple.
- Parameters:
addr_tuple – the tuple to parse
- Returns:
the address as a uint32_t, in host order
-
term inet_make_addr4(uint32_t addr, Heap *heap)
Make an inet IPv4 address tuple.
this function requires that at least INET_ADDR4_TUPLE_SIZE terms are free on the heap.
- Parameters:
addr – the address to make as a tuple, as a uint32_t in host order
heap – the heap to build the tuple in
- Returns:
the tuple
Variables
- static const AtomStringIntPair inet_domain_table [] = {{ATOM_STR("\x4", "inet"), InetDomain },}
- static const AtomStringIntPair inet_type_table [] = {{ATOM_STR("\x6", "stream"), InetStreamType },{ATOM_STR("\x5", "dgram"), InetDgramType },}
- static const AtomStringIntPair inet_protocol_table [] = {{ATOM_STR("\x2", "ip"), InetIpProtocol },{ATOM_STR("\x3", "tcp"), InetTcpProtocol },{ATOM_STR("\x3", "udp"), InetUdpProtocol },}