blob: 0f8b8c165f29785c2d302933fee2884e231564c1 [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
13 negotiation. Hook setting may be any closure or a string. If
14 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
33 If the setting is a string, it used as name of an lfun to call
34 in this_player(). Closures are just called, with unbound
35 lambda-closures being bound to this_player() prior to
36 execution.
37
38 The hook is called for a 'DO/DONT/WILL/WONT <opt>' with the action
39 (DO/DONT/...) as the first, and <opt> as the second argument.
40
41 For example:, if the driver receives the sequence
42
43 IAC SB <opt> <opts>...
44
45 followed by IAC SB/SE, the hook is called with 'SB' as first
46 argument, <opt> as second, and <opts> as an array of integers as
47 third argument.
48
49REMARKS
50 An incomplete list of telnet negotiations this hook is called
51 for includes the following:
52 SB: Suboption negotiation
53 TELOPT_LINEMODE: linemode
54 TELOPT_NAWS: window size
55 TELOPT_TTYPE: terminal type
56 TELOPT_TM: timing mark
57 TELOPT_NEWENV: remote environment variables
58 TELOPT_ENVIRON: remote environment variables
59 TELOPT_XDISPLOC: remote X display address
60 TELOPT_TSPEED: terminal speed
61 TELOPT_BINARY: binary data, needed for non-ASCII charsets
62 TELOPT_EOR: TinyFugue prompt marker (together with EOR)
63
64 TELOPT_MSP: Mud Sound Protocol
65 TELOPT_MXP: Mud Extension Protocol
66 TELOPT_MSSP: Mud Server Status Protocol
67 TELOPT_GMCP: Generic Mud Communication Protocol
68
69HISTORY
70
71SEE ALSO
72 hooks(C), telnet(C), no_echo(H)