ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
include/ascii-chat/network/acip/protocol.h
Go to the documentation of this file.
1
150
151#pragma once
152
153#include <stdint.h>
155
156#ifdef __cplusplus
157extern "C" {
158#endif
159
249
250// ACIP packet types are defined in packet_type_t enum (network/packet.h):
251//
252// Session Management (6000-6008):
253// PACKET_TYPE_ACIP_SESSION_CREATE = 6000 // Client -> Server: Create session
254// PACKET_TYPE_ACIP_SESSION_CREATED = 6001 // Server -> Client: Session created
255// PACKET_TYPE_ACIP_SESSION_LOOKUP = 6002 // Client -> Server: Lookup session
256// PACKET_TYPE_ACIP_SESSION_INFO = 6003 // Server -> Client: Session info
257// PACKET_TYPE_ACIP_SESSION_JOIN = 6004 // Client -> Server: Join session
258// PACKET_TYPE_ACIP_SESSION_JOINED = 6005 // Server -> Client: Join confirmed
259// PACKET_TYPE_ACIP_SESSION_LEAVE = 6006 // Client -> Server: Leave session
260// PACKET_TYPE_ACIP_SESSION_END = 6007 // Server -> Client: Session ended
261// PACKET_TYPE_ACIP_SESSION_RECONNECT = 6008 // Client -> Server: Reconnect
262//
263// WebRTC Signaling (6009-6010):
264// PACKET_TYPE_ACIP_WEBRTC_SDP = 6009 // Bidirectional: SDP offer/answer
265// PACKET_TYPE_ACIP_WEBRTC_ICE = 6010 // Bidirectional: ICE candidate
266//
267// String Reservation (6020-6023):
268// PACKET_TYPE_ACIP_STRING_RESERVE = 6020 // Client -> Server: Reserve string
269// PACKET_TYPE_ACIP_STRING_RESERVED = 6021 // Server -> Client: String reserved
270// PACKET_TYPE_ACIP_STRING_RENEW = 6022 // Client -> Server: Renew reservation
271// PACKET_TYPE_ACIP_STRING_RELEASE = 6023 // Client -> Server: Release string
272//
273// Ring Consensus (6050-6051):
274// PACKET_TYPE_ACIP_PARTICIPANT_LIST = 6050 // ACDS -> Participants: Participant list
275// PACKET_TYPE_ACIP_RING_COLLECT = 6051 // Participant -> Next: Ring collect
276//
277// Host Negotiation (6060-6068):
278// PACKET_TYPE_ACIP_NETWORK_QUALITY = 6060 // Bidirectional: Quality metrics
279// PACKET_TYPE_ACIP_HOST_ANNOUNCEMENT = 6061 // Participant -> ACDS: Host announcement
280// PACKET_TYPE_ACIP_HOST_DESIGNATED = 6062 // ACDS -> All: Host designated
281// PACKET_TYPE_ACIP_SETTINGS_SYNC = 6063 // Initiator -> Host -> All: Settings
282// PACKET_TYPE_ACIP_SETTINGS_ACK = 6064 // Participant -> Initiator: Ack
283// PACKET_TYPE_ACIP_HOST_LOST = 6065 // Participant -> ACDS: Host lost
284// PACKET_TYPE_ACIP_FUTURE_HOST_ELECTED = 6066 // Quorum Leader -> All: Future host elected
285// PACKET_TYPE_ACIP_PARTICIPANT_JOINED = 6067 // ACDS -> Participants: New participant
286// PACKET_TYPE_ACIP_PARTICIPANT_LEFT = 6068 // ACDS -> Participants: Participant left
287//
288// Bandwidth Testing (6070-6071):
289// PACKET_TYPE_ACIP_BANDWIDTH_TEST = 6070 // Client -> ACDS: Bandwidth test
290// PACKET_TYPE_ACIP_BANDWIDTH_RESULT = 6071 // ACDS -> Client: Bandwidth result
291//
292// Broadcast Acknowledgment (6075):
293// PACKET_TYPE_ACIP_BROADCAST_ACK = 6075 // Broadcast acknowledgment
294//
295// Control & Discovery (6190, 6199):
296// PACKET_TYPE_ACIP_DISCOVERY_PING = 6190 // Client -> ACDS: Keepalive ping
297// PACKET_TYPE_ACIP_ERROR = 6199 // Server -> Client: Error message
298
300
306
316static inline bool packet_is_acip_type(uint16_t type) {
317 return (type >= 6000 && type <= 6199);
318}
319
327static inline bool packet_is_acip_session_type(uint16_t type) {
329}
330
338static inline bool packet_is_acip_webrtc_type(uint16_t type) {
340}
341
349static inline bool packet_is_acip_string_type(uint16_t type) {
351}
352
354 /* acip */
356
357#ifdef __cplusplus
358}
359#endif
unsigned short uint16_t
Definition common.h:61
@ PACKET_TYPE_ACIP_WEBRTC_ICE
WebRTC ICE candidate (bidirectional).
Definition packet.h:452
@ PACKET_TYPE_ACIP_SESSION_RECONNECT
Reconnect to session (Client -> Discovery Server).
Definition packet.h:447
@ PACKET_TYPE_ACIP_STRING_RESERVE
Reserve session string (Client -> Discovery Server).
Definition packet.h:455
@ PACKET_TYPE_ACIP_SESSION_CREATE
Create new session (Client -> Discovery Server).
Definition packet.h:431
@ PACKET_TYPE_ACIP_WEBRTC_SDP
WebRTC SDP offer/answer (bidirectional).
Definition packet.h:450
@ PACKET_TYPE_ACIP_STRING_RELEASE
Release string reservation (Client -> Discovery Server).
Definition packet.h:461