MODULE ADCDEF IDENT "ADCDEF-1-X"; /*++ /* /* Facility: /* Advanced Direct Connection /* /* Abstract: /* This is an interface module contains data structures definitions, /* constants, functions/procedures prototypes. /* Based on spec: http://adc.sourceforge.net/ADC.html /* /* Author: /* Ruslan R. Laishev /* /* Creation Date: 03-JUL-2009 /* /* Modification History: /* /*-- CONSTANT adc EQUALS 412 PREFIX ADC$ TAG PORT; CONSTANT adc EQUALS 10 PREFIX ADC$ TAG EOL; /* /* Queue/Double Linked list /* AGGREGATE que STRUCTURE PREFIX que_ ALIGN; flink ADDRESS (que); blink ADDRESS (que); spare QUADWORD UNSIGNED FILL; END que; AGGREGATE asc STRUCTURE PREFIX asc_; asc BYTE UNSIGNED; asc CHARACTER LENGTH 64; END asc; AGGREGATE buf STRUCTURE PREFIX ichc_ TAG ichc; link que; len WORD UNSIGNED; buf BYTE UNSIGNED DIMENSION 2048; END buf; /* /* ADC Message Types /* CONSTANT ( BROAD, /* Hub must send message to all connected clients, including the sender of the message. CLIENT, /* Clients must use this message type when communicating directly over TCP. DIRECT, /* The hub must send the message to the target_sid user. ECHO, /* The hub must send the message to the target_sid user and the my_sid user. FEAT, /* The hub must send message to all clients that support both all required (+) /* and no excluded (-) features named. /* The feature name is matched against the corresponding SU field in INF sent by each client. HUB, /* Clients must use this message type when a message is intended for the hub only. INFO, /* Hubs must use this message type when sending a message to a client that didn't /* come from another client. UDP /* Clients must use this message type when communicating directly over UDP. ) EQUALS 1 INCREMENT 1 PREFIX ADC$ TAG MT; /* /* BASE messages /* CONSTANT ( FROMHUB,/* F - From hub (hub-client TCP) TOHUB, /* T - To hub (hub-client TCP) TC2C, /* C - Between clients (client-client TCP) UC2CP /* U - Between clients (client-client UDP) ) EQUALS 1 INCREMENT 1 PREFIX ADC$ TAG MT; /* /* ADC Actions /* CONSTANT ( STA, SUP, SID, INF, MSG, SCH, RES, CTM, RCM, GPA, PAS, QUI, GET, GFI, SND ) EQUALS 1 INCREMENT 1 PREFIX ADC$ TAG ACT; /* /* SCH/SEARCH options /* AGGREGATE sch STRUCTURE PREFIX sch$ TAG adc; flags STRUCTURE LONGWORD UNSIGNED; an BITFIELD LENGTH 1 MASK; no BITFIELD LENGTH 1 MASK; ex BITFIELD LENGTH 1 MASK; le BITFIELD LENGTH 1 MASK; ge BITFIELD LENGTH 1 MASK; eq BITFIELD LENGTH 1 MASK; to BITFIELD LENGTH 1 MASK; ty BITFIELD LENGTH 1 MASK; END flags; END sch; /* /* RES/SEARCH's result options /* AGGREGATE res STRUCTURE PREFIX res$ TAG adc; flags STRUCTURE LONGWORD UNSIGNED; fn BITFIELD LENGTH 1 MASK; si BITFIELD LENGTH 1 MASK; sl BITFIELD LENGTH 1 MASK; to BITFIELD LENGTH 1 MASK; END flags; END res; /* /* SUP/SUPPORTED Features options /* AGGREGATE sup STRUCTURE PREFIX sup$ TAG adc; flags STRUCTURE LONGWORD UNSIGNED; base BITFIELD LENGTH 1 MASK; tigr BITFIELD LENGTH 1 MASK; bzip BITFIELD LENGTH 1 MASK; zlif BITFIELD LENGTH 1 MASK; zlig BITFIELD LENGTH 1 MASK; END flags; END sup; /* /* ADC client's INFormation structure /* /* /* ADC Actions /* AGGREGATE inf STRUCTURE PREFIX inf$ TAG adc; inf STRUCTURE LONGWORD UNSIGNED; id BITFIELD LENGTH 1 MASK; pd BITFIELD LENGTH 1 MASK; i4 BITFIELD LENGTH 1 MASK; i6 BITFIELD LENGTH 1 MASK; u4 BITFIELD LENGTH 1 MASK; u6 BITFIELD LENGTH 1 MASK; ss BITFIELD LENGTH 1 MASK; sf BITFIELD LENGTH 1 MASK; ve BITFIELD LENGTH 1 MASK; us BITFIELD LENGTH 1 MASK; ds BITFIELD LENGTH 1 MASK; sl BITFIELD LENGTH 1 MASK; as BITFIELD LENGTH 1 MASK; am BITFIELD LENGTH 1 MASK; em BITFIELD LENGTH 1 MASK; ni BITFIELD LENGTH 1 MASK; de BITFIELD LENGTH 1 MASK; hn BITFIELD LENGTH 1 MASK; hr BITFIELD LENGTH 1 MASK; ho BITFIELD LENGTH 1 MASK; to BITFIELD LENGTH 1 MASK; ct BITFIELD LENGTH 1 MASK; aw BITFIELD LENGTH 1 MASK; su BITFIELD LENGTH 1 MASK; rf BITFIELD LENGTH 1 MASK; END inf; id asc; pd asc; i4 LONGWORD UNSIGNED; i6 QUADWORD UNSIGNED; u4 LONGWORD UNSIGNED; u6 LONGWORD UNSIGNED; ss QUADWORD UNSIGNED; sf LONGWORD UNSIGNED; ve asc; us LONGWORD UNSIGNED; ds LONGWORD UNSIGNED; sl LONGWORD UNSIGNED; as LONGWORD UNSIGNED; am LONGWORD UNSIGNED; em asc; ni asc; de asc; hn LONGWORD UNSIGNED; hr LONGWORD UNSIGNED; ho LONGWORD UNSIGNED; to asc; ct STRUCTURE LONGWORD UNSIGNED; bot BITFIELD LENGTH 1 MASK; user BITFIELD LENGTH 1 MASK; oper BITFIELD LENGTH 1 MASK; mgr BITFIELD LENGTH 1 MASK; owner BITFIELD LENGTH 1 MASK; hub BITFIELD LENGTH 1 MASK; END ct; aw LONGWORD UNSIGNED; su asc; rf asc; END inf; /* /* ADC Message fields arguments /* AGGREGATE msg STRUCTURE PREFIX msg$ TAG adc; link que; sid BITFIELD DIMENSION 20; /* SID of message originator mt BYTE UNSIGNED; /* See ADC Message Types constant act BYTE UNSIGNED; /* ADC Actions bl UNION; inf adc_inf; END bl; opts LONGWORD UNSIGNED; line STRUCTURE; len BYTE UNSIGNED; sts CHARACTER LENGTH 255; END line; END msg; /* /* ADC user's session context /* AGGREGATE ctx STRUCTURE PREFIX ctx$ TAG adc; link que; sid BITFIELD DIMENSION 20; /* Session Id chan LONGWORD UNSIGNED; /* Network I/O channel addr LONGWORD UNSIGNED; /* struct in_addr port WORD UNSIGNED; addr STRUCTURE PREFIX addr_; len BYTE UNSIGNED; sts CHARACTER DIMENSION 32; END addr; inf adc_inf; salt BYTE UNSIGNED DIMENSION 32; user asc; state STRUCTURE LONGWORD UNSIGNED; identify BITFIELD LENGTH 1 MASK; verify BITFIELD LENGTH 1 MASK; normal BITFIELD LENGTH 1 MASK; data BITFIELD LENGTH 1 MASK; END state; opts LONGWORD UNSIGNED; buf STRUCTURE PREFIX buf_; len WORD UNSIGNED; buf BYTE UNSIGNED DIMENSION 2048; END buf; END ctx; /* /* /* AGGREGATE ent STRUCTURE PREFIX ctx$ TAG adc ALIGN; flag STRUCTURE LONGWORD UNSIGNED; used BITFIELD LENGTH 1 MASK; END state; ptr ADDRESS (ctx); END ent; /* /* /* AGGREGATE vec STRUCTURE PREFIX vec$ TAG adc ALIGN; ni asc; de asc; ve asc; hh asc; ws asc; ow asc; uc WORD UNSIGNED; ss QUADWORD UNSIGNED; sf LONGWORD UNSIGNED; ms LONGWORD UNSIGNED; mc WORD UNSIGNED; minss QUADWORD UNSIGNED; /* Minimum Shared Size minsf LONGWORD UNSIGNED; /* Minimum Shared Files minsl LONGWORD UNSIGNED; /* Minimum slots END vec; END_MODULE ADCDEF;