ipc.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #pragma once
  2. #include <sys/socket.h>
  3. #include <sys/un.h>
  4. #define IPC_SOCKET "\0/tmp/upekuxd.ipc-socket"
  5. extern int checkSocketSecurity( int socket );
  6. static const unsigned char IPC_PROMPT_SWIPE_SCANNER = 0xff;
  7. //ipc commands
  8. static const unsigned char IPC_SUCCESS = 0x00;
  9. static const unsigned char IPC_ERROR = 0x01;
  10. static const unsigned char IPC_DENIED = 0x02;
  11. static const unsigned char IPC_DRIVER_MESSAGE = 0x03;
  12. static const unsigned char IPC_TOUCHPAD = 0x10;
  13. static const unsigned char IPC_TOUCHPAD_STATUS = 0x11;
  14. static const unsigned char IPC_TOUCHPAD_OFF = 0x12;
  15. static const unsigned char IPC_TOUCHPAD_MOUSE = 0x13;
  16. static const unsigned char IPC_TOUCHPAD_WHEELS = 0x14;
  17. static const unsigned char IPC_TOUCHPAD_ARROWS = 0x15;
  18. static const unsigned char IPC_USER_AUTH = 0x20;
  19. static const unsigned char IPC_USER_AUTH_ACTIVE = 0x21;
  20. static const unsigned char IPC_USER_AUTH_PASSIVE = 0x22;
  21. static const unsigned char IPC_FINGER_LIST = 0x30;
  22. static const unsigned char IPC_FINGER_DETECT = 0x31;
  23. static const unsigned char IPC_FINGER_ADD = 0x50;
  24. static const unsigned char IPC_FINGER_ADD_SINGLE = 0x51;
  25. static const unsigned char IPC_FINGER_ADD_BEST = 0x52;
  26. static const unsigned char IPC_FINGER_VIEW = 0x61;
  27. static const unsigned char IPC_FINGER_EDIT = 0x62;
  28. static const unsigned char IPC_FINGER_TEST = 0x63;
  29. static const unsigned char IPC_FINGER_REMOVE = 0x64;
  30. //field IDs
  31. static const unsigned char IPC_FIELD_USER = 0x00;
  32. static const unsigned char IPC_FIELD_DESCRIPTION = 0x01;
  33. static const unsigned char IPC_FIELD_THRESHOLD = 0x02;
  34. static const unsigned char IPC_FIELD_ACTION = 0x03;
  35. //field names usable to access to db
  36. static const char ipc_field_user[] = "user";
  37. static const char ipc_field_description[] = "description";
  38. static const char ipc_field_threshold[] = "threshold";
  39. static const char ipc_field_action[] = "action" ;
  40. static const struct ipc_field{
  41. const char* name;//used in db request
  42. const unsigned char id;
  43. const char type;//t - text, i - integer
  44. } ipcFieldList[] = {
  45. { ipc_field_user, IPC_FIELD_USER, 't' },
  46. { ipc_field_description, IPC_FIELD_DESCRIPTION, 't' },
  47. { ipc_field_threshold, IPC_FIELD_THRESHOLD, 'i' },
  48. { ipc_field_action, IPC_FIELD_ACTION, 't' },
  49. { NULL, 0x00, 0x00 }//list terminator
  50. };