patch-opennap_h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. $OpenBSD: patch-opennap_h,v 1.3 2016/09/10 13:03:41 ajacoutot Exp $
  2. --- opennap.h.orig Mon Oct 1 00:12:37 2001
  3. +++ opennap.h Sat Sep 10 10:44:09 2016
  4. @@ -16,6 +16,8 @@
  5. #endif
  6. #include <stdarg.h>
  7. +/* fd_set */
  8. +#include <sys/select.h>
  9. #include <sys/types.h>
  10. #include <zlib.h>
  11. #include "hash.h"
  12. @@ -143,9 +145,26 @@ struct _user
  13. NOTE. this is a pointer to an entry in
  14. Server_Names, and not malloc'd. */
  15. + time_t connected; /* time at which the user connected */
  16. + LIST *channels; /* channels of which this user is a member */
  17. + CONNECTION *con; /* local connection, or server which this
  18. + user is behind */
  19. +
  20. + unsigned int libsize; /* approximate size of shared files in kB */
  21. + unsigned int ip; /* ip of user in network byte order */
  22. +
  23. unsigned short uploads; /* no. of uploads in progress */
  24. unsigned short downloads; /* no. of downloads in progress */
  25. + unsigned short port; /* data port client is listening on */
  26. + unsigned short conport; /* remote port for connection to server */
  27. + unsigned short totalup; /* total number of uploads */
  28. + unsigned short totaldown; /* total number of downloads */
  29. + unsigned short shared; /* # of shared files */
  30. + unsigned short wantPong; /* # of outstanding PONGs */
  31. +
  32. + unsigned short yyy; /* unused */
  33. +
  34. unsigned int level:3; /* user level */
  35. unsigned int speed:4; /* link speed */
  36. unsigned int local:1; /* nonzero if locally connected */
  37. @@ -154,20 +173,6 @@ struct _user
  38. unsigned int unsharing:1;
  39. unsigned int cloaked:1;
  40. unsigned int xxx:4; /* unused */
  41. - unsigned short shared; /* # of shared files */
  42. -
  43. - unsigned short totalup; /* total number of uploads */
  44. - unsigned short totaldown; /* total number of downloads */
  45. -
  46. - unsigned int libsize; /* approximate size of shared files in kB */
  47. - unsigned int ip; /* ip of user in network byte order */
  48. -
  49. - unsigned short port; /* data port client is listening on */
  50. - unsigned short conport; /* remote port for connection to server */
  51. - time_t connected; /* time at which the user connected */
  52. - LIST *channels; /* channels of which this user is a member */
  53. - CONNECTION *con; /* local connection, or server which this
  54. - user is behind */
  55. };
  56. enum
  57. @@ -486,6 +491,7 @@ extern HASH *MD5;
  58. extern int Stats_Port;
  59. #endif
  60. +extern int gBlockWinMX;
  61. extern HASH *Channel_Db;
  62. extern int Client_Queue_Length;
  63. extern HASH *Client_Versions;
  64. @@ -835,6 +841,7 @@ int config (int);
  65. void config_defaults (void);
  66. USERDB *create_db (USER *);
  67. void destroy_connection (CONNECTION *);
  68. +void discipline_user (USER *);
  69. void dump_channels (void);
  70. void exec_timers (time_t);
  71. void expand_hex (char *, int);