ws_handshake.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2012-2013 Crocodile RCS Ltd
  5. *
  6. * This file is part of Kamailio, a free SIP server.
  7. *
  8. * Kamailio is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version
  12. *
  13. * Kamailio is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. * Exception: permission to copy, modify, propagate, and distribute a work
  23. * formed by combining OpenSSL toolkit software and the code in this file,
  24. * such as linking with software components and libraries released under
  25. * OpenSSL project license.
  26. *
  27. */
  28. #ifndef _WS_HANDSHAKE_H
  29. #define _WS_HANDSHAKE_H
  30. #include "../../sr_module.h"
  31. #include "../../parser/msg_parser.h"
  32. #include "ws_mod.h"
  33. #define DEFAULT_SUB_PROTOCOLS (SUB_PROTOCOL_SIP | SUB_PROTOCOL_MSRP)
  34. #define SUB_PROTOCOL_ALL (SUB_PROTOCOL_SIP | SUB_PROTOCOL_MSRP)
  35. extern int ws_sub_protocols;
  36. #define CORS_MODE_NONE 0
  37. #define CORS_MODE_ANY 1
  38. #define CORS_MODE_ORIGIN 2
  39. extern int ws_cors_mode;
  40. extern stat_var *ws_failed_handshakes;
  41. extern stat_var *ws_successful_handshakes;
  42. extern stat_var *ws_sip_successful_handshakes;
  43. extern stat_var *ws_msrp_successful_handshakes;
  44. int ws_handle_handshake(struct sip_msg *msg);
  45. struct mi_root *ws_mi_disable(struct mi_root *cmd, void *param);
  46. struct mi_root *ws_mi_enable(struct mi_root *cmd, void *param);
  47. #endif /* _WS_HANDSHAKE_H */