tdav_session_msrp.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * This file is part of Open Source Doubango Framework.
  5. *
  6. * DOUBANGO is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * DOUBANGO is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with DOUBANGO.
  18. *
  19. */
  20. /**@file tdav_session_msrp.h
  21. * @brief The Message Session Relay Protocol (MSRP) session.
  22. * Used for both Message (RFC 4975) and file transfer (RFC 5547).
  23. */
  24. #ifndef TINYDAV_SESSION_MSRP_H
  25. #define TINYDAV_SESSION_MSRP_H
  26. #include "tinydav_config.h"
  27. #if !defined(HAVE_TINYMSRP) || HAVE_TINYMSRP
  28. #include "tinymsrp/session/tmsrp_sender.h"
  29. #include "tinymsrp/session/tmsrp_receiver.h"
  30. #include "tmsrp.h"
  31. #include "tnet_transport.h"
  32. #include "tinymedia/tmedia_session.h"
  33. TDAV_BEGIN_DECLS
  34. typedef enum tdav_msrp_setup_e {
  35. msrp_setup_active,
  36. msrp_setup_passive,
  37. msrp_setup_actpass,
  38. msrp_setup_holdconn
  39. }
  40. tdav_msrp_setup_t;
  41. typedef enum tdav_msrp_dir_e {
  42. tdav_msrp_dir_none = 0x00,
  43. tdav_msrp_dir_sendonly = 0x01 << 0,
  44. tdav_msrp_dir_recvonly = 0x01 << 1,
  45. tdav_msrp_dir_sendrecv = (tdav_msrp_dir_sendonly | tdav_msrp_dir_recvonly),
  46. }
  47. tdav_msrp_dir_t;
  48. typedef struct tdav_session_msrp_s {
  49. TMEDIA_DECLARE_SESSION_MSRP;
  50. tsk_bool_t useIPv6;
  51. tnet_transport_t *transport;
  52. tmsrp_config_t* config;
  53. tdav_msrp_setup_t setup;
  54. tnet_fd_t connectedFD; // FullDuplex Socket
  55. tmsrp_sender_t* sender;
  56. tmsrp_receiver_t* receiver;
  57. char* local_ip;
  58. //uint16_t local_port;
  59. /* NAT Traversal context */
  60. struct tnet_nat_ctx_s* natt_ctx;
  61. char* remote_ip;
  62. uint16_t remote_port;
  63. tdav_msrp_dir_t dir;
  64. char* neg_accept_type;
  65. char* neg_accept_w_type;
  66. char* accept_types;
  67. char* accept_w_types;
  68. uint64_t chunck_duration;
  69. struct {
  70. char* path; //full-path
  71. char* selector;
  72. char* disposition;
  73. char* date;
  74. char* icon;
  75. char* transfer_id;
  76. unsigned sent:1;
  77. } file;
  78. unsigned fresh_conn:1;
  79. unsigned offerer:1;
  80. unsigned send_bodiless:1;
  81. }
  82. tdav_session_msrp_t;
  83. TINYDAV_GEXTERN const tmedia_session_plugin_def_t *tdav_session_msrp_plugin_def_t;
  84. TDAV_END_DECLS
  85. #endif /* !defined(HAVE_TINYMSRP) || HAVE_TINYMSRP */
  86. #endif /* TINYDAV_SESSION_MSRP_H */