socket_info.h 586 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef socket_info_h
  2. #define socket_info_h
  3. #define SOCKET_INFO_UNKNOWN 0
  4. #define SOCKET_INFO_LISTEN 1
  5. #define SOCKET_INFO_TCP 2
  6. #define SOCKET_INFO_UDP 3
  7. #define SOCKET_INFO_BIND 4
  8. #define SOCKET_INFO_CLOSING 5
  9. #include <stdint.h>
  10. struct socket_info {
  11. int id;
  12. int type;
  13. uint64_t opaque;
  14. uint64_t read;
  15. uint64_t write;
  16. uint64_t rtime;
  17. uint64_t wtime;
  18. int64_t wbuffer;
  19. uint8_t reading;
  20. uint8_t writing;
  21. char name[128];
  22. struct socket_info *next;
  23. };
  24. struct socket_info * socket_info_create(struct socket_info *last);
  25. void socket_info_release(struct socket_info *);
  26. #endif