blob: 3efeeae4145b5cb646454a4d30d0e76215ee8b78 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001// MorgenGrauen MUDlib
2//
3// telnetneg-structs.c -- Structs fuer die Telnet Option handler
4//
5#pragma strict_types,save_types
6#pragma range_check
7#pragma no_clone
8#pragma no_shadow
9#pragma pedantic
10
11struct to_state_s {
12 int localside; // wish for the local side (MUD)
13 int remoteside; // wish for the remote side (CLIENT)
14 int *sbdata; // last SB data sent/received by us
15};
16
17struct telopt_s {
18 int option;
19 // Receivehandler, wird gerufen, wenn wir vom Client irgendwas bzgl. dieser
20 // Telnet Option empfangen. Wenn gesetzt, darf der Client die Option
21 // einschalten.
22 closure remotehandler;
23 // Wird gerufen, wenn die Option auf unserer Seite eingeschaltet wurde.
24 // Wenn gesetzt, soll versucht werden, die Option auf Mudseite
25 // einzuschalten
26 closure localhandler;
27 // Die Wuensche _waehrend_ einer Verhandlung (bzw. gesendete (lo_wishes) und
28 // empfangene (re_wishes) SB-Daten auch ausserhalb von Verhandlungen).
29 struct to_state_s lo_wishes; // our wishes (sent by us)
30 struct to_state_s re_wishes; // remote wishes (received by us)
31 // currently effective/active state
32 struct to_state_s state;
33 // data used by the handlers - NOT USED BY this program!
34 mixed data;
35};
36/* explanations:
37 telopt_s->lo_wishes->localside: the state we want to be in (WILL/WONT)
38 telopt_s->lo_wishes->remoteside: the state we want the other side to
39 be in (DO/DONT)
40 telopt_s->re_wishes->localside: the state the other side wants US to be in
41 (DO/DONT)
42 telopt_s->re_wishes->remoteside: the state the other side wants to be in
43 (WILL/WONT)
44 telopt_s->state: the currently effective state of the option on the two
45 sides.
46 */
47