pktccops.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2009, Attila Domjan
  5. *
  6. * Attila Domjan <attila.domjan.hu@gmail.com>
  7. *
  8. * See http://www.asterisk.org for more information about
  9. * the Asterisk project. Please do not directly contact
  10. * any of the maintainers of this project for assistance;
  11. * the project provides a web site, mailing lists and IRC
  12. * channels for your use.
  13. *
  14. * This program is free software, distributed under the terms of
  15. * the GNU General Public License Version 2. See the LICENSE file
  16. * at the top of the source tree.
  17. */
  18. /*! \file
  19. *
  20. * \brief PacketCable COPS
  21. *
  22. * \author Attila Domjan <attila.domjan.hu@gmail.com>
  23. */
  24. #ifndef _ASTERISK_PKTCCOPS_H
  25. #define _ASTERISK_PKTCCOPS_H
  26. #include "asterisk/optional_api.h"
  27. #if defined(__cplusplus) || defined(c_plusplus)
  28. extern "C" {
  29. #endif
  30. enum {
  31. GATE_SET,
  32. GATE_INFO,
  33. GATE_SET_HAVE_GATEID,
  34. GATE_DEL
  35. };
  36. enum {
  37. GATE_ALLOC_FAILED,
  38. GATE_ALLOC_PROGRESS,
  39. GATE_ALLOCATED,
  40. GATE_CLOSED,
  41. GATE_CLOSED_ERR,
  42. GATE_OPEN,
  43. GATE_DELETED,
  44. GATE_TIMEOUT
  45. };
  46. struct cops_gate {
  47. AST_LIST_ENTRY(cops_gate) list;
  48. uint32_t gateid;
  49. uint16_t trid;
  50. time_t in_transaction;
  51. uint32_t mta;
  52. int state;
  53. time_t allocated;
  54. time_t checked;
  55. time_t deltimer;
  56. struct cops_cmts *cmts;
  57. int (* got_dq_gi) (struct cops_gate *gate);
  58. int (* gate_remove) (struct cops_gate *gate);
  59. int (* gate_open) (struct cops_gate *gate);
  60. void *tech_pvt;
  61. };
  62. AST_OPTIONAL_API(struct cops_gate *, ast_pktccops_gate_alloc,
  63. (int cmd, struct cops_gate *gate, uint32_t mta, uint32_t actcount,
  64. float bitrate, uint32_t psize, uint32_t ssip, uint16_t ssport,
  65. int (* const got_dq_gi) (struct cops_gate *gate),
  66. int (* const gate_remove) (struct cops_gate *gate)),
  67. { return NULL; });
  68. #if defined(__cplusplus) || defined(c_plusplus)
  69. }
  70. #endif
  71. #endif /* _ASTERISK_PKTCCOPS_H */