blob: 937c5b7588c9569e6e0fa00e1832a5118cc8dc29 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 #include <sys/driver_hooks.h>
3
4 set_driver_hook(H_TELNET_NEG, value)
5
6 <value> being:
7
8 void|mixed <name>(int action, int option [, int * opts ] )
9 void|mixed <closure>(int action, int option [, int * opts ] )
10
11DESCRIPTION
12 Optional hook to specifiy how to perform a single telnet
Zesstra7ea4a032019-11-26 20:11:40 +010013 negotiation. Hook setting may be any closure or a string. If
MG Mud User88f12472016-06-24 23:31:02 +020014 not set, most telnet options are rejected (read: only a very
15 minimal negotiation takes place).
16
17 The hook is called whenever the driver receives a demand for
18 option negotiation for any option the driver does not handle itself.
19 By default, the driver deals with the following options:
20 TELOPT_ECHO: Echo option
21 TELOPT_SGA: Suppress Go Ahead (nearly always on)
22 TELOPT_COMPRESS: Mud client compression protocol (obsolete)
23 TELOPT_COMPRESS2: Mud client compression protocol V2
24
25 For all other telnet options negotiations, this hook is called.
26
27 The hook has then to perform the negotiation using the efun
28 binary_message().
29
30 Alternatively, if H_NOECHO is set, this hook is called for
31 _all_ telnet data received.
32
Zesstra7ea4a032019-11-26 20:11:40 +010033 If the setting is a string, it used as the name of an lfun to
34 call in this_player(). Closures are just called, with unbound
35 lambda-closures being bound to this_player() prior to execution.
MG Mud User88f12472016-06-24 23:31:02 +020036
37 The hook is called for a 'DO/DONT/WILL/WONT <opt>' with the action
38 (DO/DONT/...) as the first, and <opt> as the second argument.
39
40 For example:, if the driver receives the sequence
41
42 IAC SB <opt> <opts>...
43
Zesstra7ea4a032019-11-26 20:11:40 +010044 followed by IAC SB/SE, the hook is called with 'SB' as first
MG Mud User88f12472016-06-24 23:31:02 +020045 argument, <opt> as second, and <opts> as an array of integers as
46 third argument.
47
48REMARKS
49 An incomplete list of telnet negotiations this hook is called
50 for includes the following:
51 SB: Suboption negotiation
52 TELOPT_LINEMODE: linemode
53 TELOPT_NAWS: window size
54 TELOPT_TTYPE: terminal type
55 TELOPT_TM: timing mark
56 TELOPT_NEWENV: remote environment variables
57 TELOPT_ENVIRON: remote environment variables
58 TELOPT_XDISPLOC: remote X display address
59 TELOPT_TSPEED: terminal speed
60 TELOPT_BINARY: binary data, needed for non-ASCII charsets
61 TELOPT_EOR: TinyFugue prompt marker (together with EOR)
62
63 TELOPT_MSP: Mud Sound Protocol
64 TELOPT_MXP: Mud Extension Protocol
65 TELOPT_MSSP: Mud Server Status Protocol
66 TELOPT_GMCP: Generic Mud Communication Protocol
67
68HISTORY
69
70SEE ALSO
71 hooks(C), telnet(C), no_echo(H)