bkd.h 1009 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef __BKD_H__
  2. #define __BKD_H__
  3. #include <sys/shm.h>
  4. #include <arpa/inet.h>
  5. #include <errno.h>
  6. #include <fcntl.h>
  7. #include <inttypes.h>
  8. #include <linux/sockios.h>
  9. #include <linux/types.h>
  10. #include <linux/socket.h>
  11. #include <netinet/in.h>
  12. #include <pthread.h>
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <stdarg.h>
  16. #include <math.h>
  17. #include <string.h>
  18. #include <stdbool.h>
  19. #include <sys/socket.h>
  20. #include <sys/time.h>
  21. #include <sys/stat.h>
  22. #include <sys/ioctl.h>
  23. #include <syslog.h>
  24. #include <time.h>
  25. #include <termios.h>
  26. #include <unistd.h>
  27. #include <signal.h>
  28. #define BKD_HEAD_VERSION "1.1.1"
  29. //
  30. // shared memory for communication
  31. //
  32. #define BKDSHMBUFSIZE 1*1024*1024
  33. #define BKDSHMID 0x22345673
  34. struct bkd_cmd_t{
  35. int ready;
  36. char szcmd[64];
  37. unsigned int serial;
  38. char buf[128];
  39. };
  40. struct bkd_rsp_t{
  41. int ready;
  42. char szcmd[64];
  43. unsigned int serial;
  44. char buf[BKDSHMBUFSIZE];
  45. };
  46. struct bkd_shm_t
  47. {
  48. struct bkd_cmd_t cmd;
  49. struct bkd_rsp_t rsp;
  50. };
  51. #endif