cdma-connman.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. *
  3. * oFono - Open Source Telephony
  4. *
  5. * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
  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_CDMA_CONNMAN_H
  22. #define __OFONO_CDMA_CONNMAN_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. struct ofono_cdma_connman;
  28. #define OFONO_CDMA_CONNMAN_MAX_USERNAME_LENGTH 63
  29. #define OFONO_CDMA_CONNMAN_MAX_PASSWORD_LENGTH 255
  30. typedef void (*ofono_cdma_connman_cb_t)(const struct ofono_error *error,
  31. void *data);
  32. typedef void (*ofono_cdma_connman_up_cb_t)(const struct ofono_error *error,
  33. const char *interface,
  34. ofono_bool_t static_ip,
  35. const char *address,
  36. const char *netmask,
  37. const char *gw,
  38. const char **dns,
  39. void *data);
  40. struct ofono_cdma_connman_driver {
  41. const char *name;
  42. int (*probe)(struct ofono_cdma_connman *cm, unsigned int vendor,
  43. void *data);
  44. void (*remove)(struct ofono_cdma_connman *cm);
  45. void (*activate)(struct ofono_cdma_connman *cm,
  46. const char *username,
  47. const char *password,
  48. ofono_cdma_connman_up_cb_t cb,
  49. void *data);
  50. void (*deactivate)(struct ofono_cdma_connman *cm,
  51. ofono_cdma_connman_cb_t cb,
  52. void *data);
  53. };
  54. int ofono_cdma_connman_driver_register(
  55. const struct ofono_cdma_connman_driver *d);
  56. void ofono_cdma_connman_driver_unregister(
  57. const struct ofono_cdma_connman_driver *d);
  58. void ofono_cdma_connman_deactivated(struct ofono_cdma_connman *cm);
  59. void ofono_cdma_connman_dormant_notify(struct ofono_cdma_connman *cm,
  60. ofono_bool_t dormant);
  61. struct ofono_cdma_connman *ofono_cdma_connman_create(
  62. struct ofono_modem *modem,
  63. unsigned int vendor,
  64. const char *driver,
  65. void *data);
  66. void ofono_cdma_connman_register(struct ofono_cdma_connman *cm);
  67. void ofono_cdma_connman_remove(struct ofono_cdma_connman *cm);
  68. void ofono_cdma_connman_set_data(struct ofono_cdma_connman *cm,
  69. void *data);
  70. void *ofono_cdma_connman_get_data(struct ofono_cdma_connman *cm);
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif /* __OFONO_CDMA_CONNMAN_H */