Ip

Definitions for the internet protocol

Note, "ip" here refers to IPv4.

isolate ip = {

    type addr
    type port
    type protocol = {udp,tcp}
    type interface = {lo, ivy}

    object endpoint = {
        type this = struct {
            protocol : ip.protocol,
            addr : ip.addr,
            port : ip.port,
            interface : ip.interface
        }
    }

    implementation {

        interpret addr -> bv[32]
        interpret port -> bv[16]

    }

}