package vendor:ENet
⌘K
Ctrl+K
or
/
Index
Types (45)
- Acknowledgment
- Address
- Buffer
- Callbacks
- Channel
- ChecksumCallback
- Compressor
- Event
- EventType
- Host
- IncomingCommand
- InterceptCallback
- List
- ListNode
- OutgoingCommand
- Packet
- PacketFlag
- PacketFlags
- PacketFreeCallback
- Peer
- PeerFlag
- PeerState
- Protocol
- ProtocolAcknowledge
- ProtocolBandwidthLimit
- ProtocolCommand
- ProtocolCommandHeader
- ProtocolConnect
- ProtocolDisconnect
- ProtocolFlag
- ProtocolHeader
- ProtocolPing
- ProtocolSendFragment
- ProtocolSendReliable
- ProtocolSendUnreliable
- ProtocolSendUnsequenced
- ProtocolThrottleConfigure
- ProtocolVerifyConnect
- Socket
- SocketOption
- SocketSet
- SocketShutdown
- SocketType
- SocketWait
- Version
Constants (45)
- BUFFER_MAXIMUM
- HOST_ANY
- HOST_BANDWIDTH_THROTTLE_INTERVAL
- HOST_BROADCAST
- HOST_DEFAULT_MAXIMUM_PACKET_SIZE
- HOST_DEFAULT_MAXIMUM_WAITING_DATA
- HOST_DEFAULT_MTU
- HOST_RECEIVE_BUFFER_SIZE
- HOST_SEND_BUFFER_SIZE
- PEER_DEFAULT_PACKET_THROTTLE
- PEER_DEFAULT_ROUND_TRIP_TIME
- PEER_FREE_RELIABLE_WINDOWS
- PEER_FREE_UNSEQUENCED_WINDOWS
- PEER_PACKET_LOSS_INTERVAL
- PEER_PACKET_LOSS_SCALE
- PEER_PACKET_THROTTLE_ACCELERATION
- PEER_PACKET_THROTTLE_COUNTER
- PEER_PACKET_THROTTLE_DECELERATION
- PEER_PACKET_THROTTLE_INTERVAL
- PEER_PACKET_THROTTLE_SCALE
- PEER_PING_INTERVAL
- PEER_RELIABLE_WINDOWS
- PEER_RELIABLE_WINDOW_SIZE
- PEER_TIMEOUT_LIMIT
- PEER_TIMEOUT_MAXIMUM
- PEER_TIMEOUT_MINIMUM
- PEER_UNSEQUENCED_WINDOWS
- PEER_UNSEQUENCED_WINDOW_SIZE
- PEER_WINDOW_SIZE_SCALE
- PORT_ANY
- PROTOCOL_MAXIMUM_CHANNEL_COUNT
- PROTOCOL_MAXIMUM_FRAGMENT_COUNT
- PROTOCOL_MAXIMUM_MTU
- PROTOCOL_MAXIMUM_PACKET_COMMANDS
- PROTOCOL_MAXIMUM_PEER_ID
- PROTOCOL_MAXIMUM_WINDOW_SIZE
- PROTOCOL_MINIMUM_CHANNEL_COUNT
- PROTOCOL_MINIMUM_MTU
- PROTOCOL_MINIMUM_WINDOW_SIZE
- SOCKET_NULL
- TIME_OVERFLOW
- VERSION
- VERSION_MAJOR
- VERSION_MINOR
- VERSION_PATCH
Variables (0)
This section is empty.
Procedures (70)
- HOST_TO_NET_16
- HOST_TO_NET_32
- NET_TO_HOST_16
- NET_TO_HOST_32
- SOCKETSET_ADD
- SOCKETSET_EMPTY
- SOCKETSET_REMOVE
- SOCKSET_CHECK
- TIME_DIFFERENCE
- TIME_GREATER
- TIME_GREATER_EQUAL
- TIME_LESS
- TIME_LESS_EQUAL
- VERSION_CREATE
- VERSION_GET_MAJOR
- VERSION_GET_MINOR
- VERSION_GET_PATCH
- address_get_host
- address_get_host_ip
- address_set_host
- address_set_host_ip
- crc32
- deinitialize
- host_bandwidth_limit
- host_broadcast
- host_channel_limit
- host_check_events
- host_compress
- host_compress_with_range_coder
- host_connect
- host_create
- host_destroy
- host_flush
- host_service
- initialize
- initialize_with_callbacks
- linked_version
- packet_create
- packet_destroy
- packet_resize
- peer_disconnect
- peer_disconnect_later
- peer_disconnect_now
- peer_ping
- peer_ping_interval
- peer_receive
- peer_reset
- peer_send
- peer_throttle_configure
- peer_timeout
- range_coder_compress
- range_coder_create
- range_coder_decompress
- range_coder_destroy
- socket_accept
- socket_bind
- socket_connect
- socket_create
- socket_destroy
- socket_get_address
- socket_get_option
- socket_listen
- socket_receive
- socket_send
- socket_set_option
- socket_shutdown
- socket_wait
- socketset_select
- time_get
- time_set
Procedure Groups (0)
This section is empty.
Types
Address ¶
Related Procedures With Parameters
Buffer ¶
Related Procedures With Parameters
Callbacks ¶
Callbacks :: struct { malloc: proc "c" (size: uint) -> rawptr, free: proc "c" (memory: rawptr), no_memory: proc "c" (), }
Related Procedures With Parameters
Compressor ¶
Compressor :: struct { context_: rawptr, compress: proc "c" (context_: rawptr, inBuffers: [^]Buffer, inBufferCount: uint, inLimit: uint, outData: [^]u8, outLimit: uint) -> uint, decompress: proc "c" (context_: rawptr, inData: [^]u8, inLimit: uint, outData: [^]u8, outLimit: uint) -> uint, destroy: proc "c" (context_: rawptr), }
Related Procedures With Parameters
Event ¶
Related Procedures With Parameters
EventType ¶
EventType :: enum i32 { NONE = 0, CONNECT = 1, DISCONNECT = 2, RECEIVE = 3, }
Host ¶
Host :: struct { socket: Socket, address: Address, incomingBandwidth: u32, outgoingBandwidth: u32, bandwidthThrottleEpoch: u32, mtu: u32, randomSeed: u32, recalculateBandwidthLimits: i32, peers: [^]Peer `fmt:"v,peerCount"`, peerCount: uint, channelLimit: uint, serviceTime: u32, dispatchQueue: List, continueSending: i32, packetSize: uint, headerFlags: u16, commands: [32]Protocol, commandCount: uint, buffers: [65]Buffer, bufferCount: uint, checksum: ChecksumCallback, compressor: Compressor, packetData: [2][4096]u8, receivedAddress: Address, receivedData: [^]u8 `fmt:"v,receivedDataLength"`, receivedDataLength: uint, totalSentData: u32, totalSentPackets: u32, totalReceivedData: u32, totalReceivedPackets: u32, intercept: InterceptCallback, connectedPeers: uint, bandwidthLimitedPeers: uint, duplicatePeers: uint, maximumPacketSize: uint, maximumWaitingData: uint, }
Related Procedures With Parameters
- host_bandwidth_limit
- host_broadcast
- host_channel_limit
- host_check_events
- host_compress
- host_compress_with_range_coder
- host_connect
- host_destroy
- host_flush
- host_service
Related Procedures With Returns
Packet ¶
Packet :: struct { referenceCount: uint, flags: u32, data: [^]u8 `fmt:"v,dataLength"`, dataLength: uint, freeCallback: PacketFreeCallback, userData: rawptr, }
Related Procedures With Parameters
Related Procedures With Returns
PacketFlag ¶
PacketFlag :: enum i32 { RELIABLE = 0, UNSEQUENCED = 1, NO_ALLOCATE = 2, UNRELIABLE_FRAGMENT = 3, FLAG_SENT = 8, }
PacketFlags ¶
PacketFlags :: bit_set[PacketFlag; i32]
PacketFreeCallback ¶
PacketFreeCallback :: proc "c" (packet: ^Packet)
Peer ¶
Peer :: struct { dispatchList: ListNode, host: ^Host, outgoingPeerID: u16, incomingPeerID: u16, connectID: u32, outgoingSessionID: u8, incomingSessionID: u8, address: Address, data: rawptr, state: PeerState, channels: [^]Channel `fmt:"v,channelCount"`, channelCount: uint, incomingBandwidth: u32, outgoingBandwidth: u32, incomingBandwidthThrottleEpoch: u32, outgoingBandwidthThrottleEpoch: u32, incomingDataTotal: u32, outgoingDataTotal: u32, lastSendTime: u32, lastReceiveTime: u32, nextTimeout: u32, earliestTimeout: u32, packetLossEpoch: u32, packetsSent: u32, packetsLost: u32, packetLoss: u32, packetLossVariance: u32, packetThrottle: u32, packetThrottleLimit: u32, packetThrottleCounter: u32, packetThrottleEpoch: u32, packetThrottleAcceleration: u32, packetThrottleDeceleration: u32, packetThrottleInterval: u32, pingInterval: u32, timeoutLimit: u32, timeoutMinimum: u32, timeoutMaximum: u32, lastRoundTripTime: u32, lowestRoundTripTime: u32, lastRoundTripTimeVariance: u32, highestRoundTripTimeVariance: u32, roundTripTime: u32, roundTripTimeVariance: u32, mtu: u32, windowSize: u32, reliableDataInTransit: u32, outgoingReliableSequenceNumber: u16, acknowledgements: List, sentReliableCommands: List, sentUnreliableCommands: List, outgoingCommands: List, dispatchedCommands: List, flags: u16, reserved: u16, incomingUnsequencedGroup: u16, outgoingUnsequencedGroup: u16, unsequencedWindow: [32]u32, eventData: u32, totalWaitingData: uint, }
Related Procedures With Parameters
- peer_disconnect
- peer_disconnect_later
- peer_disconnect_now
- peer_ping
- peer_ping_interval
- peer_receive
- peer_reset
- peer_send
- peer_throttle_configure
- peer_timeout
Related Procedures With Returns
PeerFlag ¶
PeerFlag :: enum i32 { NEEDS_DISPATCH, }
PeerState ¶
PeerState :: enum i32 { DISCONNECTED, CONNECTING, ACKNOWLEDGING_CONNECT, CONNECTION_PENDING, CONNECTION_SUCCEEDED, CONNECTED, DISCONNECT_LATER, DISCONNECTING, ACKNOWLEDGING_DISCONNECT, ZOMBIE, }
Protocol ¶
Protocol :: struct #raw_union { header: ProtocolCommandHeader, acknowledge: ProtocolAcknowledge, connect: ProtocolConnect, verifyConnect: ProtocolVerifyConnect, disconnect: ProtocolDisconnect, ping: ProtocolPing, sendReliable: ProtocolSendReliable, sendUnreliable: ProtocolSendUnreliable, sendUnsequenced: ProtocolSendUnsequenced, sendFragment: ProtocolSendFragment, bandwidthLimit: ProtocolBandwidthLimit, throttleConfigure: ProtocolThrottleConfigure, }
ProtocolAcknowledge ¶
ProtocolAcknowledge :: struct #packed { header: ProtocolCommandHeader, outgoingPeerID: u16, incomingSessionID: u8, outgoingSessionID: u8, mtu: u32, windowSize: u32, channelCount: u32, incomingBandwidth: u32, outgoingBandwidth: u32, packetThrottleInterval: u32, packetThrottleAcceleration: u32, packetThrottleDeceleration: u32, connectID: u32, data: u32, }
ProtocolBandwidthLimit ¶
ProtocolBandwidthLimit :: struct #packed { header: ProtocolCommandHeader, incomingBandwidth: u32, outgoingBandwidth: u32, }
ProtocolCommand ¶
ProtocolCommand :: enum i32 { NONE = 0, ACKNOWLEDGE = 1, CONNECT = 2, VERIFY_CONNECT = 3, DISCONNECT = 4, PING = 5, SEND_RELIABLE = 6, SEND_UNRELIABLE = 7, SEND_FRAGMENT = 8, SEND_UNSEQUENCED = 9, BANDWIDTH_LIMIT = 10, THROTTLE_CONFIGURE = 11, SEND_UNRELIABLE_FRAGMENT = 12, COUNT = 13, MASK = 15, }
ProtocolConnect ¶
ProtocolConnect :: struct #packed { header: ProtocolCommandHeader, outgoingPeerID: u16, incomingSessionID: u8, outgoingSessionID: u8, mtu: u32, windowSize: u32, channelCount: u32, incomingBandwidth: u32, outgoingBandwidth: u32, packetThrottleInterval: u32, packetThrottleAcceleration: u32, packetThrottleDeceleration: u32, connectID: u32, data: u32, }
ProtocolDisconnect ¶
ProtocolDisconnect :: struct #packed { header: ProtocolCommandHeader, data: u32, }
ProtocolFlag ¶
ProtocolFlag :: enum i32 { COMMAND_ACKNOWLEDGE = 128, COMMAND_UNSEQUENCED = 64, HEADER_COMPRESSED = 16384, HEADER_SENT_TIME = 32768, HEADER_MASK = 49152, HEADER_SESSION_MASK = 12288, HEADER_SESSION_SHIFT = 12, }
ProtocolPing ¶
ProtocolPing :: struct #packed { header: ProtocolCommandHeader, }
ProtocolSendReliable ¶
ProtocolSendReliable :: struct #packed { header: ProtocolCommandHeader, dataLength: u16, }
ProtocolSendUnreliable ¶
ProtocolSendUnreliable :: struct #packed { header: ProtocolCommandHeader, unreliableSequenceNumber: u16, dataLength: u16, }
ProtocolSendUnsequenced ¶
ProtocolSendUnsequenced :: struct #packed { header: ProtocolCommandHeader, unsequencedGroup: u16, dataLength: u16, }
ProtocolThrottleConfigure ¶
ProtocolThrottleConfigure :: struct #packed { header: ProtocolCommandHeader, packetThrottleInterval: u32, packetThrottleAcceleration: u32, packetThrottleDeceleration: u32, }
ProtocolVerifyConnect ¶
ProtocolVerifyConnect :: struct #packed { header: ProtocolCommandHeader, outgoingPeerID: u16, incomingSessionID: u8, outgoingSessionID: u8, mtu: u32, windowSize: u32, channelCount: u32, incomingBandwidth: u32, outgoingBandwidth: u32, packetThrottleInterval: u32, packetThrottleAcceleration: u32, packetThrottleDeceleration: u32, connectID: u32, }
Socket ¶
Socket :: distinct uintptr
Related Procedures With Parameters
- SOCKETSET_ADD
- SOCKETSET_REMOVE
- SOCKSET_CHECK
- socket_accept
- socket_bind
- socket_connect
- socket_destroy
- socket_get_address
- socket_get_option
- socket_listen
- socket_receive
- socket_send
- socket_set_option
- socket_shutdown
- socket_wait
- socketset_select
Related Procedures With Returns
Related Constants
SocketOption ¶
SocketOption :: enum i32 { NONBLOCK = 1, BROADCAST = 2, RCVBUF = 3, SNDBUF = 4, REUSEADDR = 5, RCVTIMEO = 6, SNDTIMEO = 7, ERROR = 8, NODELAY = 9, }
Related Procedures With Parameters
SocketSet ¶
Related Procedures With Parameters
SocketShutdown ¶
SocketShutdown :: enum i32 { READ = 0, WRITE = 1, READ_WRITE = 2, }
Related Procedures With Parameters
SocketType ¶
SocketType :: enum i32 { STREAM = 1, DATAGRAM = 2, }
Related Procedures With Parameters
SocketWait ¶
SocketWait :: enum i32 { NONE = 0, SEND = 1, RECEIVE = 2, INTERRUPT = 4, }
Constants
BUFFER_MAXIMUM ¶
BUFFER_MAXIMUM :: 1 + 2 * PROTOCOL_MAXIMUM_PACKET_COMMANDS
HOST_ANY ¶
HOST_ANY :: u32(0)
HOST_BANDWIDTH_THROTTLE_INTERVAL ¶
HOST_BANDWIDTH_THROTTLE_INTERVAL :: 1000
HOST_BROADCAST ¶
HOST_BROADCAST :: u32(0xffffffff)
HOST_DEFAULT_MAXIMUM_PACKET_SIZE ¶
HOST_DEFAULT_MAXIMUM_PACKET_SIZE :: 32 * 1024 * 1024
HOST_DEFAULT_MAXIMUM_WAITING_DATA ¶
HOST_DEFAULT_MAXIMUM_WAITING_DATA :: 32 * 1024 * 1024
HOST_DEFAULT_MTU ¶
HOST_DEFAULT_MTU :: 1400
HOST_RECEIVE_BUFFER_SIZE ¶
HOST_RECEIVE_BUFFER_SIZE :: 256 * 1024
HOST_SEND_BUFFER_SIZE ¶
HOST_SEND_BUFFER_SIZE :: 256 * 1024
PEER_DEFAULT_PACKET_THROTTLE ¶
PEER_DEFAULT_PACKET_THROTTLE :: 32
PEER_DEFAULT_ROUND_TRIP_TIME ¶
PEER_DEFAULT_ROUND_TRIP_TIME :: 500
PEER_FREE_RELIABLE_WINDOWS ¶
PEER_FREE_RELIABLE_WINDOWS :: 8
PEER_FREE_UNSEQUENCED_WINDOWS ¶
PEER_FREE_UNSEQUENCED_WINDOWS :: 32
PEER_PACKET_LOSS_INTERVAL ¶
PEER_PACKET_LOSS_INTERVAL :: 10000
PEER_PACKET_LOSS_SCALE ¶
PEER_PACKET_LOSS_SCALE :: 1 << 16
PEER_PACKET_THROTTLE_ACCELERATION ¶
PEER_PACKET_THROTTLE_ACCELERATION :: 2
PEER_PACKET_THROTTLE_COUNTER ¶
PEER_PACKET_THROTTLE_COUNTER :: 7
PEER_PACKET_THROTTLE_DECELERATION ¶
PEER_PACKET_THROTTLE_DECELERATION :: 2
PEER_PACKET_THROTTLE_INTERVAL ¶
PEER_PACKET_THROTTLE_INTERVAL :: 5000
PEER_PACKET_THROTTLE_SCALE ¶
PEER_PACKET_THROTTLE_SCALE :: 32
PEER_PING_INTERVAL ¶
PEER_PING_INTERVAL :: 500
PEER_RELIABLE_WINDOWS ¶
PEER_RELIABLE_WINDOWS :: 16
PEER_RELIABLE_WINDOW_SIZE ¶
PEER_RELIABLE_WINDOW_SIZE :: 0x1000
PEER_TIMEOUT_LIMIT ¶
PEER_TIMEOUT_LIMIT :: 32
PEER_TIMEOUT_MAXIMUM ¶
PEER_TIMEOUT_MAXIMUM :: 30000
PEER_TIMEOUT_MINIMUM ¶
PEER_TIMEOUT_MINIMUM :: 5000
PEER_UNSEQUENCED_WINDOWS ¶
PEER_UNSEQUENCED_WINDOWS :: 64
PEER_UNSEQUENCED_WINDOW_SIZE ¶
PEER_UNSEQUENCED_WINDOW_SIZE :: 1024
PEER_WINDOW_SIZE_SCALE ¶
PEER_WINDOW_SIZE_SCALE :: 64 * 1024
PORT_ANY ¶
PORT_ANY :: u16(0)
PROTOCOL_MAXIMUM_CHANNEL_COUNT ¶
PROTOCOL_MAXIMUM_CHANNEL_COUNT :: 255
PROTOCOL_MAXIMUM_FRAGMENT_COUNT ¶
PROTOCOL_MAXIMUM_FRAGMENT_COUNT :: 1024 * 1024
PROTOCOL_MAXIMUM_MTU ¶
PROTOCOL_MAXIMUM_MTU :: 4096
PROTOCOL_MAXIMUM_PACKET_COMMANDS ¶
PROTOCOL_MAXIMUM_PACKET_COMMANDS :: 32
PROTOCOL_MAXIMUM_PEER_ID ¶
PROTOCOL_MAXIMUM_PEER_ID :: 0xFFF
PROTOCOL_MAXIMUM_WINDOW_SIZE ¶
PROTOCOL_MAXIMUM_WINDOW_SIZE :: 65536
PROTOCOL_MINIMUM_CHANNEL_COUNT ¶
PROTOCOL_MINIMUM_CHANNEL_COUNT :: 1
PROTOCOL_MINIMUM_MTU ¶
PROTOCOL_MINIMUM_MTU :: 576
PROTOCOL_MINIMUM_WINDOW_SIZE ¶
PROTOCOL_MINIMUM_WINDOW_SIZE :: 4096
SOCKET_NULL ¶
SOCKET_NULL :: Socket(~uintptr(0))
TIME_OVERFLOW ¶
TIME_OVERFLOW :: u32(86400000)
VERSION ¶
VERSION: u32 : (u32(VERSION_MAJOR) << 16) | (u32(VERSION_MINOR) << 8) | u32(VERSION_PATCH)
Odin does not have "macros" or compile-time evaluation of functions, so the following is just the same as. VERSION :: VERSION_CREATE(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
VERSION_MAJOR ¶
VERSION_MAJOR :: u8(1)
VERSION_MINOR ¶
VERSION_MINOR :: u8(3)
VERSION_PATCH ¶
VERSION_PATCH :: u8(17)
Variables
This section is empty.
Procedures
HOST_TO_NET_16 ¶
Network byte order is always Big Endian. Instead of using the method ENet uses (leveraging {n,h}to{n,h}{s,l}), we can just use Odin's endianess types to get the correct byte swaps, if any.
SOCKETSET_EMPTY ¶
SOCKETSET_EMPTY :: proc "contextless" (sockset: ^SocketSet) {…}
deinitialize ¶
deinitialize :: proc "c" () ---
host_compress ¶
host_compress :: proc "c" (host: ^Host, compressor: ^Compressor) ---
host_destroy ¶
host_destroy :: proc "c" (host: ^Host) ---
host_flush ¶
host_flush :: proc "c" (host: ^Host) ---
initialize ¶
initialize :: proc "c" () -> i32 ---
linked_version ¶
linked_version :: proc "c" () -> u32 ---
packet_create ¶
packet_create :: proc "c" (data: rawptr, dataLength: uint, flags: bit_set[PacketFlag; i32]) -> ^Packet ---
packet_destroy ¶
packet_destroy :: proc "c" (packet: ^Packet) ---
peer_ping ¶
peer_ping :: proc "c" (peer: ^Peer) ---
peer_reset ¶
peer_reset :: proc "c" (peer: ^Peer) ---
range_coder_create ¶
range_coder_create :: proc "c" () -> rawptr ---
range_coder_destroy ¶
range_coder_destroy :: proc "c" (ctx: rawptr) ---
socket_create ¶
socket_create :: proc "c" (SocketType) -> Socket ---
socket_destroy ¶
socket_destroy :: proc "c" (socket: Socket) ---
socket_get_option ¶
socket_get_option :: proc "c" (socket: Socket, option: SocketOption, value: ^i32) -> i32 ---
socket_set_option ¶
socket_set_option :: proc "c" (socket: Socket, option: SocketOption, value: i32) -> i32 ---
socket_shutdown ¶
socket_shutdown :: proc "c" (socket: Socket, how: SocketShutdown) -> i32 ---
time_get ¶
time_get :: proc "c" () -> u32 ---
time_set ¶
time_set :: proc "c" (newTimeBase: u32) ---
Procedure Groups
This section is empty.
Source Files
Generation Information
Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-20 21:10:47.460839000 +0000 UTC