blob: 3d0edfd6ce7a8c20b0e8bb90c34ae96416b00cb1 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001/* external request demon interface definitions */
2
3#ifndef LPC__ERQ_H__
4#define LPC__ERQ_H__ 1
5
6/* servive request types */
7
8#define ERQ_RLOOKUP 0 /* Lookup ip -> name */
9#define ERQ_EXECUTE 1 /* Execute a program */
10#define ERQ_FORK 2 /* Fork a program */
11#define ERQ_AUTH 3 /* Connect to a remote authd */
12#define ERQ_SPAWN 4 /* Spawn a program */
13#define ERQ_SEND 5 /* Send data to a program or connection */
14#define ERQ_KILL 6 /* Kill a program or connection */
15#define ERQ_OPEN_UDP 7 /* Open a UDP socket */
16#define ERQ_OPEN_TCP 8 /* Open a TCP connection */
17#define ERQ_LISTEN 9 /* Open a TCP accept-socket */
18#define ERQ_ACCEPT 10 /* Accept a connection from a accept-socket */
19#define ERQ_LOOKUP 11 /* Lookup name -> ip */
20
21#ifdef __IPV6__
22#define ERQ_RLOOKUPV6 12 /* Lookup name/ip6 */
23#endif
24
25/* Additional service request type flags evaluated by efun send_erq().
26 * The ERQ itself won't get to see it.
27 */
28
29#define ERQ_CB_STRING (1 << 31) /* Callback closure takes a string arg */
30
31
32/* answers from ERQ_EXECUTE / ERQ_FORK */
33
34#define ERQ_OK 0
35#define ERQ_SIGNALED 1
36#define ERQ_E_NOTFOUND 2 /* process not found by wait */
37#define ERQ_E_UNKNOWN 3 /* unknown exit condition from wait() */
38#define ERQ_E_ARGLENGTH 4
39#define ERQ_E_ARGFORMAT 5
40#define ERQ_E_ARGNUMBER 6
41#define ERQ_E_ILLEGAL 7
42#define ERQ_E_PATHLEN 8
43#define ERQ_E_FORKFAIL 9
44#define ERQ_E_TICKET 11
45#define ERQ_E_INCOMPLETE 12
46#define ERQ_E_WOULDBLOCK 13
47#define ERQ_E_PIPE 14
48#define ERQ_STDOUT 15 /* Normal data received */
49#define ERQ_STDERR 16
50#define ERQ_EXITED 17 /* Connection closed on EOF */
51#define ERQ_E_NSLOTS 18
52
53/* reserved handles */
54
55#define ERQ_HANDLE_RLOOKUP (-1)
56#define ERQ_HANDLE_KEEP_HANDLE (-2)
57#define ERQ_HANDLE_RLOOKUPV6 (-3)
58
59#endif /* LPC__ERQ_H__ */