ascii-chat 0.11.33
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#pragma once
151
152#include <stdint.h>
153#include "../../network/packet/packet.h"
154
155#ifdef __cplusplus
156extern "C" {
157#endif
158
249// ACIP packet types are defined in packet_type_t enum (network/packet.h):
250//
251// Session Management (6000-6008):
252// PACKET_TYPE_ACIP_SESSION_CREATE = 6000 // Client -> Server: Create session
253// PACKET_TYPE_ACIP_SESSION_CREATED = 6001 // Server -> Client: Session created
254// PACKET_TYPE_ACIP_SESSION_LOOKUP = 6002 // Client -> Server: Lookup session
255// PACKET_TYPE_ACIP_SESSION_INFO = 6003 // Server -> Client: Session info
256// PACKET_TYPE_ACIP_SESSION_JOIN = 6004 // Client -> Server: Join session
257// PACKET_TYPE_ACIP_SESSION_JOINED = 6005 // Server -> Client: Join confirmed
258// PACKET_TYPE_ACIP_SESSION_LEAVE = 6006 // Client -> Server: Leave session
259// PACKET_TYPE_ACIP_SESSION_END = 6007 // Server -> Client: Session ended
260// PACKET_TYPE_ACIP_SESSION_RECONNECT = 6008 // Client -> Server: Reconnect
261//
262// WebRTC Signaling (6009-6010):
263// PACKET_TYPE_ACIP_WEBRTC_SDP = 6009 // Bidirectional: SDP offer/answer
264// PACKET_TYPE_ACIP_WEBRTC_ICE = 6010 // Bidirectional: ICE candidate
265//
266// String Reservation (6020-6023):
267// PACKET_TYPE_ACIP_STRING_RESERVE = 6020 // Client -> Server: Reserve string
268// PACKET_TYPE_ACIP_STRING_RESERVED = 6021 // Server -> Client: String reserved
269// PACKET_TYPE_ACIP_STRING_RENEW = 6022 // Client -> Server: Renew reservation
270// PACKET_TYPE_ACIP_STRING_RELEASE = 6023 // Client -> Server: Release string
271//
272// Ring Consensus (6050-6051):
273// PACKET_TYPE_ACIP_PARTICIPANT_LIST = 6050 // ACDS -> Participants: Participant list
274// PACKET_TYPE_ACIP_RING_COLLECT = 6051 // Participant -> Next: Ring collect
275//
276// Host Negotiation (6060-6068):
277// PACKET_TYPE_ACIP_NETWORK_QUALITY = 6060 // Bidirectional: Quality metrics
278// PACKET_TYPE_ACIP_HOST_ANNOUNCEMENT = 6061 // Participant -> ACDS: Host announcement
279// PACKET_TYPE_ACIP_HOST_DESIGNATED = 6062 // ACDS -> All: Host designated
280// PACKET_TYPE_ACIP_SETTINGS_SYNC = 6063 // Initiator -> Host -> All: Settings
281// PACKET_TYPE_ACIP_SETTINGS_ACK = 6064 // Participant -> Initiator: Ack
282// PACKET_TYPE_ACIP_HOST_LOST = 6065 // Participant -> ACDS: Host lost
283// PACKET_TYPE_ACIP_FUTURE_HOST_ELECTED = 6066 // Quorum Leader -> All: Future host elected
284// PACKET_TYPE_ACIP_PARTICIPANT_JOINED = 6067 // ACDS -> Participants: New participant
285// PACKET_TYPE_ACIP_PARTICIPANT_LEFT = 6068 // ACDS -> Participants: Participant left
286//
287// Bandwidth Testing (6070-6071):
288// PACKET_TYPE_ACIP_BANDWIDTH_TEST = 6070 // Client -> ACDS: Bandwidth test
289// PACKET_TYPE_ACIP_BANDWIDTH_RESULT = 6071 // ACDS -> Client: Bandwidth result
290//
291// Broadcast Acknowledgment (6075):
292// PACKET_TYPE_ACIP_BROADCAST_ACK = 6075 // Broadcast acknowledgment
293//
294// Control & Discovery (6190, 6199):
295// PACKET_TYPE_ACIP_DISCOVERY_PING = 6190 // Client -> ACDS: Keepalive ping
296// PACKET_TYPE_ACIP_ERROR = 6199 // Server -> Client: Error message
297
315static inline bool packet_is_acip_type(uint16_t type) {
316 return (type >= 6000 && type <= 6199);
317}
318
326static inline bool packet_is_acip_session_type(uint16_t type) {
328}
329
337static inline bool packet_is_acip_webrtc_type(uint16_t type) {
339}
340
348static inline bool packet_is_acip_string_type(uint16_t type) {
350}
351
/* acip */
355
356#ifdef __cplusplus
357}
358#endif
unsigned short uint16_t
Definition common.h:57
@ PACKET_TYPE_ACIP_WEBRTC_ICE
WebRTC ICE candidate (bidirectional)
Definition packet.h:428
@ PACKET_TYPE_ACIP_SESSION_RECONNECT
Reconnect to session (Client -> Discovery Server)
Definition packet.h:423
@ PACKET_TYPE_ACIP_STRING_RESERVE
Reserve session string (Client -> Discovery Server)
Definition packet.h:431
@ PACKET_TYPE_ACIP_SESSION_CREATE
Create new session (Client -> Discovery Server)
Definition packet.h:407
@ PACKET_TYPE_ACIP_WEBRTC_SDP
WebRTC SDP offer/answer (bidirectional)
Definition packet.h:426
@ PACKET_TYPE_ACIP_STRING_RELEASE
Release string reservation (Client -> Discovery Server)
Definition packet.h:437