dvbnet.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * libdvbnet - a DVB network support library
  3. *
  4. * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library 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 GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  19. */
  20. #ifndef LIBDVBNET_H
  21. #define LIBDVBNET_H 1
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif
  26. #include <stdint.h>
  27. /**
  28. * Possible encapsulations of data.
  29. */
  30. enum dvbnet_encap {
  31. DVBNET_ENCAP_MPE,
  32. DVBNET_ENCAP_ULE,
  33. };
  34. /**
  35. * The maximum allowed number of dvb network devices per adapter netdevice.
  36. */
  37. #define DVBNET_MAX_INTERFACES 10
  38. /**
  39. * Open a DVB net interface.
  40. *
  41. * @param adapter DVB adapter ID.
  42. * @param netdeviceid Network control interface of that adapter to open.
  43. * @return A unix file descriptor on success, or -1 on failure.
  44. */
  45. extern int dvbnet_open(int adapter, int netdeviceid);
  46. /**
  47. * Create a new DVBNET interface.
  48. *
  49. * @param fd FD opened with libdvbnet_open().
  50. * @param pid PID of the stream containing the network data.
  51. * @param encapsulation Encapsulation type of the stream (one of DVBNET_ENCAP_*).
  52. * @return Index of new interface on success, < 0 on failure.
  53. */
  54. extern int dvbnet_add_interface(int fd, uint16_t pid, enum dvbnet_encap encapsulation);
  55. /**
  56. * Get details of a DVBNET interface.
  57. *
  58. * @param fd FD opened with libdvbnet_open().
  59. * @param ifnum Index of interface to retrieve.
  60. * @param pid The PID of the interface.
  61. * @param encapsulation The encapsulation of the interface (DVBNET_ENCAP_*).
  62. * @return 0 on success, nonzero on failure.
  63. */
  64. extern int dvbnet_get_interface(int fd, int ifnum, uint16_t *pid, enum dvbnet_encap *encapsulation);
  65. /**
  66. * Remove a DVBNET interface.
  67. *
  68. * @param fd FD opened with libdvbnet_open().
  69. * @param ifnum Index of interface to remove.
  70. * @return 0 on success, nonzero on failure.
  71. */
  72. extern int dvbnet_remove_interface(int fd, int ifnum);
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif // LIBDVBNET_H