ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
Acip

Files

file  client.c
 ACIP client-side protocol implementation.
 
file  server.c
 ACIP server-side protocol implementation.
 
file  acds.h
 ascii-chat Discovery Service (ACDS) Protocol Message Formats
 
file  acds_client.h
 ACIP client-side protocol library and ACDS client connection API.
 
file  acds_server.h
 ACIP server-side protocol library and ACDS server utilities.
 
file  client.h
 ACIP client-side protocol API.
 
file  server.h
 ACIP server-side protocol API.
 

Detailed Description

This module documents the complete ascii-chat binary network protocol, including:

ASCII-CHAT BINARY PROTOCOL ARCHITECTURE

Complete Protocol Overview

Universal Packet Structure

ALL packets in ascii-chat (regardless of type) use the same 22-byte header:

Offset Size Field Description
------ ---- ----- -----------
0 8 magic Magic number 0xA5C11C4A1 (spells "ASCIICHAT" in hex)
8 2 type Packet type enum (packet_type_t) - see full range below
10 4 length Payload length in bytes (0 = header-only, max ~2MB)
14 4 crc32 CRC32 checksum of payload (0 if length == 0)
18 4 client_id Client identifier (0=server, 1-9=clients)
22 N payload Payload data (N = length)
------
Total: 22 + payload_length bytes
packet_type_t
Network protocol packet type enumeration.
Definition packet.h:286

Complete Packet Type System

The ascii-chat binary protocol uses multiple packet type ranges for different purposes:

Type 1: Protocol Version Negotiation

Types 1000-1203: Cryptographic Handshake & Rekeying

Types 2000-2004: Session Messages

Types 3000-3002: Media Frames

Types 4000-4001: Audio Packets

Types 5000-5008: Control & State

Types 6000-6199: ACIP Discovery Service Protocol

Encryption & Handshake Flow

Unencrypted Phase (connection establishment):

  1. Client sends CRYPTO_CLIENT_HELLO (type 1000)
  2. Server sends CRYPTO_CAPABILITIES (type 1100)
  3. Exchange keys via CRYPTO_KEY_EXCHANGE_INIT/RESP (1102, 1103)
  4. Authentication via CRYPTO_AUTH_CHALLENGE/RESPONSE (1104, 1105)
  5. Server sends CRYPTO_HANDSHAKE_COMPLETE (type 1108)

Encrypted Phase (after handshake):

ACIP (ASCII-Chat IP) Discovery Service

ACIP is the discovery protocol layer that runs on top of the core binary protocol. It enables P2P session discovery without a central server (decentralized mode).

ACIP Use Cases:

ACIP Transport:

Integration with Other Modules

Version Information

Note
The packet_header_t structure is identical for ALL 200+ packet types. The only difference is the 'type' field and payload structure.
CRC32 is computed over payload bytes ONLY (not including the 22-byte header).
This file documents protocol architecture. Detailed packet definitions are in network/packet.h (packet_type_t enum). Detailed ACIP message structures are in network/acip/acds.h.
Author
Zachary Fogg me@zf.nosp@m.o.gg
Date
January 2026
Version
1.0 (Complete Binary Protocol Documentation)