Minor re-organisation and logging improvements
[oweals/dinit.git] / 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
18 // Shutdown:
19 constexpr static int DINIT_CP_SHUTDOWN = 5;
20  // followed by 1-byte shutdown type
21
22
23
24 // Replies:
25
26 // Reply: ACK/NAK to request
27 constexpr static int DINIT_RP_ACK = 50;
28 constexpr static int DINIT_RP_NAK = 51;
29
30 // Request was bad (connection will be closed)
31 constexpr static int DINIT_RP_BADREQ = 52;
32
33 // Connection being closed due to out-of-memory condition
34 constexpr static int DINIT_RP_OOM = 53;
35
36 // Start service replies:
37 constexpr static int DINIT_RP_SERVICELOADERR = 54;
38 constexpr static int DINIT_RP_SERVICEOOM = 55; // couldn't start due to out-of-memory
39
40 constexpr static int DINIT_RP_SSISSUED = 56;  // service start/stop was issued (includes 4-byte service handle)
41 constexpr static int DINIT_RP_SSREDUNDANT = 57;  // service was already started/stopped (or for stop, not loaded)
42
43 // Query version response:
44 constexpr static int DINIT_RP_CPVERSION = 58;
45
46 // Service record loaded/found
47 constexpr static int DINIT_RP_SERVICERECORD = 59;
48 //     followed by 4-byte service handle, 1-byte service state
49
50 // Couldn't find/load service
51 constexpr static int DINIT_RP_NOSERVICE = 60;
52
53
54
55 // Information:
56
57 // Service event occurred (4-byte service handle, 1 byte event code)
58 constexpr static int DINIT_IP_SERVICEEVENT = 100;
59
60 // rollback completed
61 constexpr static int DINIT_ROLLBACK_COMPLETED = 101;