31c0b1c7ac7bdf462e89366979d3a90be7f8bd4c
[oweals/dinit.git] / src / control-cmds.h
1 // Dinit control command packet types
2
3 // Requests:
4
5 // Query protocol version:
6 constexpr static int DINIT_CP_QUERYVERSION = 0;
7
8 // Find (but don't load) a service:
9 constexpr static int DINIT_CP_FINDSERVICE = 1;
10
11 // Find or load a service:
12 constexpr static int DINIT_CP_LOADSERVICE = 2;
13
14 // Start or stop a service:
15 constexpr static int DINIT_CP_STARTSERVICE = 3;
16 constexpr static int DINIT_CP_STOPSERVICE  = 4;
17 constexpr static int DINIT_CP_WAKESERVICE = 5;
18 constexpr static int DINIT_CP_RELEASESERVICE = 6;
19
20 // Shutdown:
21 constexpr static int DINIT_CP_SHUTDOWN = 10;
22  // followed by 1-byte shutdown type
23
24
25
26 // Replies:
27
28 // Reply: ACK/NAK to request
29 constexpr static int DINIT_RP_ACK = 50;
30 constexpr static int DINIT_RP_NAK = 51;
31
32 // Request was bad (connection will be closed)
33 constexpr static int DINIT_RP_BADREQ = 52;
34
35 // Connection being closed due to out-of-memory condition
36 constexpr static int DINIT_RP_OOM = 53;
37
38 // Start service replies:
39 constexpr static int DINIT_RP_SERVICELOADERR = 54;
40 constexpr static int DINIT_RP_SERVICEOOM = 55; // couldn't start due to out-of-memory
41
42 constexpr static int DINIT_RP_SSISSUED = 56;  // service start/stop was issued (includes 4-byte service handle)
43 constexpr static int DINIT_RP_SSREDUNDANT = 57;  // service was already started/stopped (or for stop, not loaded)
44
45 // Query version response:
46 constexpr static int DINIT_RP_CPVERSION = 58;
47
48 // Service record loaded/found
49 constexpr static int DINIT_RP_SERVICERECORD = 59;
50 //     followed by 4-byte service handle, 1-byte service state
51
52 // Couldn't find/load service
53 constexpr static int DINIT_RP_NOSERVICE = 60;
54
55 // Service is already started/stopped
56 constexpr static int DINIT_RP_ALREADYSS = 61;
57
58
59
60 // Information:
61
62 // Service event occurred (4-byte service handle, 1 byte event code)
63 constexpr static int DINIT_IP_SERVICEEVENT = 100;
64
65 // rollback completed
66 constexpr static int DINIT_ROLLBACK_COMPLETED = 101;