IRC client framework (wrapper around libircclient library).
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

session.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
  3. *
  4. * This library is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU Lesser General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or (at your
  7. * option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  12. * License for more details.
  13. */
  14. #ifndef INCLUDE_IRC_SESSION_H
  15. #define INCLUDE_IRC_SESSION_H
  16. #include "params.h"
  17. #include "dcc.h"
  18. #include "libirc_events.h"
  19. // Session flags
  20. #define SESSIONFL_MOTD_RECEIVED (0x00000001)
  21. #define SESSIONFL_SSL_CONNECTION (0x00000002)
  22. #define SESSIONFL_SSL_WRITE_WANTS_READ (0x00000004)
  23. #define SESSIONFL_SSL_READ_WANTS_WRITE (0x00000008)
  24. #define SESSIONFL_USES_IPV6 (0x00000010)
  25. struct irc_session_s {
  26. void * ctx;
  27. int dcc_timeout;
  28. int options;
  29. int lasterror;
  30. char incoming_buf[LIBIRC_BUFFER_SIZE];
  31. size_t incoming_offset;
  32. char outgoing_buf[LIBIRC_BUFFER_SIZE];
  33. size_t outgoing_offset;
  34. port_mutex_t mutex_session;
  35. socket_t sock;
  36. int state;
  37. int flags;
  38. char * server;
  39. char * server_password;
  40. char * realname;
  41. char * username;
  42. char * nick;
  43. char * ctcp_version;
  44. #if defined( ENABLE_IPV6 )
  45. struct in6_addr local_addr6;
  46. #endif
  47. struct in_addr local_addr;
  48. irc_dcc_t dcc_last_id;
  49. irc_dcc_session_t * dcc_sessions;
  50. port_mutex_t mutex_dcc;
  51. irc_callbacks_t callbacks;
  52. #if defined (ENABLE_SSL)
  53. SSL * ssl;
  54. #endif
  55. };
  56. #endif /* INCLUDE_IRC_SESSION_H */