call-barring.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. *
  3. * oFono - Open Telephony stack for Linux
  4. *
  5. * Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * This program 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 this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. *
  20. */
  21. #ifndef __OFONO_CALL_BARRING_H
  22. #define __OFONO_CALL_BARRING_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. struct ofono_call_barring;
  28. typedef void (*ofono_call_barring_set_cb_t)(const struct ofono_error *error,
  29. void *data);
  30. typedef void (*ofono_call_barring_query_cb_t)(const struct ofono_error *error,
  31. int status, void *data);
  32. struct ofono_call_barring_driver {
  33. const char *name;
  34. int (*probe)(struct ofono_call_barring *cb, unsigned int vendor,
  35. void *data);
  36. void (*remove)(struct ofono_call_barring *cb);
  37. void (*set)(struct ofono_call_barring *barr, const char *lock,
  38. int enable, const char *passwd, int cls,
  39. ofono_call_barring_set_cb_t cb, void *data);
  40. void (*query)(struct ofono_call_barring *barr, const char *lock,
  41. int cls, ofono_call_barring_query_cb_t cb, void *data);
  42. void (*set_passwd)(struct ofono_call_barring *barr, const char *lock,
  43. const char *old_passwd, const char *new_passwd,
  44. ofono_call_barring_set_cb_t cb, void *data);
  45. };
  46. int ofono_call_barring_driver_register(
  47. const struct ofono_call_barring_driver *d);
  48. void ofono_call_barring_driver_unregister(
  49. const struct ofono_call_barring_driver *d);
  50. struct ofono_call_barring *ofono_call_barring_create(struct ofono_modem *modem,
  51. unsigned int vendor,
  52. const char *driver,
  53. void *data);
  54. void ofono_call_barring_register(struct ofono_call_barring *cb);
  55. void ofono_call_barring_remove(struct ofono_call_barring *cb);
  56. void ofono_call_barring_set_data(struct ofono_call_barring *cb, void *data);
  57. void *ofono_call_barring_get_data(struct ofono_call_barring *cb);
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* __OFONO_CALL_BARRING_H */