control-cmds.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // Dinit control command packet types
  2. // Requests:
  3. // Query protocol version:
  4. constexpr static int DINIT_CP_QUERYVERSION = 0;
  5. // Find (but don't load) a service:
  6. constexpr static int DINIT_CP_FINDSERVICE = 1;
  7. // Find or load a service:
  8. constexpr static int DINIT_CP_LOADSERVICE = 2;
  9. // Start or stop a service:
  10. constexpr static int DINIT_CP_STARTSERVICE = 3;
  11. constexpr static int DINIT_CP_STOPSERVICE = 4;
  12. constexpr static int DINIT_CP_WAKESERVICE = 5;
  13. constexpr static int DINIT_CP_RELEASESERVICE = 6;
  14. constexpr static int DINIT_CP_UNPINSERVICE = 7;
  15. // List services:
  16. constexpr static int DINIT_CP_LISTSERVICES = 8;
  17. // Unload a service:
  18. constexpr static int DINIT_CP_UNLOADSERVICE = 9;
  19. // Shutdown:
  20. constexpr static int DINIT_CP_SHUTDOWN = 10;
  21. // followed by 1-byte shutdown type
  22. // Add/remove dependency to existing service:
  23. constexpr static int DINIT_CP_ADD_DEP = 11;
  24. constexpr static int DINIT_CP_REM_DEP = 12;
  25. // Query service load path / mechanism:
  26. constexpr static int DINIT_CP_QUERY_LOAD_MECH = 13;
  27. // Add a waits for dependency from one service to another, and start the dependency:
  28. constexpr static int DINIT_CP_ENABLESERVICE = 14;
  29. // Replies:
  30. // Reply: ACK/NAK to request
  31. constexpr static int DINIT_RP_ACK = 50;
  32. constexpr static int DINIT_RP_NAK = 51;
  33. // Request was bad (connection will be closed)
  34. constexpr static int DINIT_RP_BADREQ = 52;
  35. // Connection being closed due to out-of-memory condition
  36. constexpr static int DINIT_RP_OOM = 53;
  37. // Start service replies:
  38. constexpr static int DINIT_RP_SERVICELOADERR = 54;
  39. constexpr static int DINIT_RP_SERVICEOOM = 55; // couldn't start due to out-of-memory
  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. // Query version response:
  43. constexpr static int DINIT_RP_CPVERSION = 58;
  44. // Service record loaded/found
  45. constexpr static int DINIT_RP_SERVICERECORD = 59;
  46. // followed by 4-byte service handle, 1-byte service state
  47. // Couldn't find/load service
  48. constexpr static int DINIT_RP_NOSERVICE = 60;
  49. // Service is already started/stopped
  50. constexpr static int DINIT_RP_ALREADYSS = 61;
  51. // Information on a service / list complete:
  52. constexpr static int DINIT_RP_SVCINFO = 62;
  53. constexpr static int DINIT_RP_LISTDONE = 63;
  54. // Service loader information:
  55. constexpr static int DINIT_RP_LOADER_MECH = 64;
  56. // Dependent services prevent stopping/restarting. Includes size_t count, handle_t * N handles.
  57. constexpr static int DINIT_RP_DEPENDENTS = 65;
  58. // Information:
  59. // Service event occurred (4-byte service handle, 1 byte event code)
  60. constexpr static int DINIT_IP_SERVICEEVENT = 100;