private.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _klish_ktp_private_h
  2. #define _klish_ktp_private_h
  3. #include <faux/net.h>
  4. #include <faux/async.h>
  5. #include <faux/msg.h>
  6. #include <klish/ktp_session.h>
  7. typedef enum {
  8. KTPD_SESSION_STATE_DISCONNECTED = 'd',
  9. KTPD_SESSION_STATE_NOT_AUTHORIZED = 'a',
  10. KTPD_SESSION_STATE_IDLE = 'i',
  11. KTPD_SESSION_STATE_WAIT_FOR_PROCESS = 'p',
  12. } ktpd_session_state_e;
  13. struct ktpd_session_s {
  14. ksession_t *ksession;
  15. ktpd_session_state_e state;
  16. uid_t uid;
  17. gid_t gid;
  18. char *user;
  19. faux_async_t *async;
  20. faux_session_stall_cb_fn stall_cb; // Stall callback
  21. void *stall_udata;
  22. faux_hdr_t *hdr; // Engine will receive header and then msg
  23. };
  24. typedef enum {
  25. KTP_SESSION_STATE_DISCONNECTED = 'd',
  26. KTP_SESSION_STATE_NOT_AUTHORIZED = 'a',
  27. KTP_SESSION_STATE_IDLE = 'i',
  28. KTP_SESSION_STATE_WAIT_FOR_COMPLETION = 'v',
  29. KTP_SESSION_STATE_WAIT_FOR_HELP = 'h',
  30. KTP_SESSION_STATE_WAIT_FOR_CMD = 'c',
  31. } ktp_session_state_e;
  32. struct ktp_session_s {
  33. ktp_session_state_e state;
  34. faux_net_t *net;
  35. };
  36. /*
  37. struct ktpd_clients_s {
  38. faux_list_t *list;
  39. };
  40. */
  41. #endif // _klish_ktp_private_h