inet.h

Include dependency graph for inet.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "9" [label="stdbool.h" tooltip="stdbool.h"]
    "6" [label="atom.h" tooltip="atom.h"]
    "12" [label="assert.h" tooltip="assert.h"]
    "20" [label="synclist.h" tooltip="synclist.h"]
    "5" [label="stdint.h" tooltip="stdint.h"]
    "7" [label="stdlib.h" tooltip="stdlib.h"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.h" fillcolor="#BFBFBF"]
    "3" [label="context.h" tooltip="context.h"]
    "17" [label="utils.h" tooltip="utils.h"]
    "8" [label="atom_table.h" tooltip="atom_table.h"]
    "11" [label="term_typedef.h" tooltip="term_typedef.h"]
    "18" [label="stddef.h" tooltip="stddef.h"]
    "13" [label="limits.h" tooltip="limits.h"]
    "25" [label="refc_binary.h" tooltip="refc_binary.h"]
    "23" [label="string.h" tooltip="string.h"]
    "16" [label="mailbox.h" tooltip="mailbox.h"]
    "22" [label="term.h" tooltip="term.h"]
    "10" [label="erl_nif.h" tooltip="erl_nif.h"]
    "2" [label="interop.h" tooltip="interop.h"]
    "26" [label="resources.h" tooltip="resources.h"]
    "19" [label="smp.h" tooltip="smp.h"]
    "4" [label="globalcontext.h" tooltip="globalcontext.h"]
    "24" [label="memory.h" tooltip="memory.h"]
    "21" [label="stdio.h" tooltip="stdio.h"]
    "27" [label="timer_list.h" tooltip="timer_list.h"]
    "15" [label="list.h" tooltip="list.h"]
    "14" [label="inttypes.h" tooltip="inttypes.h"]
    "6" -> "5" [dir=forward tooltip="include"]
    "6" -> "7" [dir=forward tooltip="include"]
    "20" -> "15" [dir=forward tooltip="include"]
    "20" -> "21" [dir=forward tooltip="include"]
    "20" -> "19" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "24" [dir=forward tooltip="include"]
    "3" -> "4" [dir=forward tooltip="include"]
    "3" -> "15" [dir=forward tooltip="include"]
    "3" -> "16" [dir=forward tooltip="include"]
    "3" -> "19" [dir=forward tooltip="include"]
    "3" -> "22" [dir=forward tooltip="include"]
    "3" -> "27" [dir=forward tooltip="include"]
    "17" -> "18" [dir=forward tooltip="include"]
    "8" -> "9" [dir=forward tooltip="include"]
    "8" -> "6" [dir=forward tooltip="include"]
    "11" -> "12" [dir=forward tooltip="include"]
    "11" -> "13" [dir=forward tooltip="include"]
    "11" -> "14" [dir=forward tooltip="include"]
    "11" -> "5" [dir=forward tooltip="include"]
    "25" -> "9" [dir=forward tooltip="include"]
    "25" -> "7" [dir=forward tooltip="include"]
    "25" -> "15" [dir=forward tooltip="include"]
    "25" -> "26" [dir=forward tooltip="include"]
    "16" -> "9" [dir=forward tooltip="include"]
    "16" -> "15" [dir=forward tooltip="include"]
    "16" -> "11" [dir=forward tooltip="include"]
    "16" -> "17" [dir=forward tooltip="include"]
    "22" -> "9" [dir=forward tooltip="include"]
    "22" -> "5" [dir=forward tooltip="include"]
    "22" -> "21" [dir=forward tooltip="include"]
    "22" -> "7" [dir=forward tooltip="include"]
    "22" -> "23" [dir=forward tooltip="include"]
    "22" -> "24" [dir=forward tooltip="include"]
    "22" -> "25" [dir=forward tooltip="include"]
    "22" -> "17" [dir=forward tooltip="include"]
    "22" -> "11" [dir=forward tooltip="include"]
    "10" -> "11" [dir=forward tooltip="include"]
    "2" -> "3" [dir=forward tooltip="include"]
    "2" -> "22" [dir=forward tooltip="include"]
    "26" -> "7" [dir=forward tooltip="include"]
    "26" -> "10" [dir=forward tooltip="include"]
    "26" -> "15" [dir=forward tooltip="include"]
    "26" -> "24" [dir=forward tooltip="include"]
    "19" -> "9" [dir=forward tooltip="include"]
    "4" -> "5" [dir=forward tooltip="include"]
    "4" -> "6" [dir=forward tooltip="include"]
    "4" -> "8" [dir=forward tooltip="include"]
    "4" -> "10" [dir=forward tooltip="include"]
    "4" -> "15" [dir=forward tooltip="include"]
    "4" -> "16" [dir=forward tooltip="include"]
    "4" -> "19" [dir=forward tooltip="include"]
    "4" -> "20" [dir=forward tooltip="include"]
    "4" -> "22" [dir=forward tooltip="include"]
    "4" -> "27" [dir=forward tooltip="include"]
    "24" -> "10" [dir=forward tooltip="include"]
    "24" -> "11" [dir=forward tooltip="include"]
    "24" -> "17" [dir=forward tooltip="include"]
    "24" -> "5" [dir=forward tooltip="include"]
    "24" -> "7" [dir=forward tooltip="include"]
    "27" -> "9" [dir=forward tooltip="include"]
    "27" -> "5" [dir=forward tooltip="include"]
    "27" -> "15" [dir=forward tooltip="include"]
}

This graph shows which files directly or indirectly include inet.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.c"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.h" fillcolor="#BFBFBF"]
    "5" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_ssl.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_ssl.c"]
    "3" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.c"]
    "4" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.c"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "3" [dir=back tooltip="include"]
    "1" -> "4" [dir=back tooltip="include"]
    "1" -> "5" [dir=back tooltip="include"]
}

Defines

INET_ADDR4_TUPLE_SIZE TUPLE_SIZE(4)

Enums

enum inet_domain

Values:

enumerator InetInvalidDomain = 0
enumerator InetDomain
enum inet_type

Values:

enumerator InetInvalidType = 0
enumerator InetStreamType
enumerator InetDgramType
enum inet_protocol

Values:

enumerator InetInvalidProtocol = 0
enumerator InetIpProtocol
enumerator InetTcpProtocol
enumerator InetUdpProtocol

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