sctp_core.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * $Id$
  3. *
  4. * Copyright (C) 2013 Daniel-Constantin Mierla (asipto.com)
  5. *
  6. * This file is part of Kamailio, a free SIP server.
  7. *
  8. * Permission to use, copy, modify, and distribute this software for any
  9. * purpose with or without fee is hereby granted, provided that the above
  10. * copyright notice and this permission notice appear in all copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  13. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  14. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  15. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  16. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  17. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  18. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  19. */
  20. #ifndef __sctp_core_h__
  21. #define __sctp_core_h__
  22. #include "ip_addr.h"
  23. int sctp_core_init(void);
  24. typedef int (*sctp_srapi_init_f)(void);
  25. void sctp_core_destroy(void);
  26. typedef void (*sctp_srapi_destroy_f)(void);
  27. int sctp_core_init_sock(struct socket_info* sock_info);
  28. typedef int (*sctp_srapi_init_sock_f)(struct socket_info* sock_info);
  29. void sctp_core_init_options(void);
  30. typedef void (*sctp_srapi_init_options_f)(void);
  31. int sctp_core_check_compiled_sockopts(char* buf, int size);
  32. typedef int (*sctp_srapi_check_compiled_sockopts_f)(char* buf, int size);
  33. int sctp_core_check_support(void);
  34. typedef int (*sctp_srapi_check_support_f)(void);
  35. int sctp_core_rcv_loop(void);
  36. typedef int (*sctp_srapi_rcv_loop_f)(void);
  37. int sctp_core_msg_send(struct dest_info* dst, char* buf, unsigned len);
  38. typedef int (*sctp_srapi_msg_send_f)(struct dest_info* dst, char* buf,
  39. unsigned len);
  40. typedef struct sctp_srapi {
  41. sctp_srapi_init_f init;
  42. sctp_srapi_destroy_f destroy;
  43. sctp_srapi_init_sock_f init_sock;
  44. sctp_srapi_check_support_f check_support;
  45. sctp_srapi_rcv_loop_f rcv_loop;
  46. sctp_srapi_msg_send_f msg_send;
  47. } sctp_srapi_t;
  48. int sctp_core_register_api(sctp_srapi_t *api);
  49. #endif