nm-setting-generic.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
  2. /*
  3. * This library is free software; you can redistribute it and/or
  4. * modify it under the terms of the GNU Lesser General Public
  5. * License as published by the Free Software Foundation; either
  6. * version 2 of the License, or (at your option) any later version.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with this library; if not, write to the
  15. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. * Boston, MA 02110-1301 USA.
  17. *
  18. * Copyright 2013 Red Hat, Inc.
  19. */
  20. #include "nm-default.h"
  21. #include "nm-setting-generic.h"
  22. #include "nm-setting-private.h"
  23. /**
  24. * SECTION:nm-setting-generic
  25. * @short_description: Describes connection properties for generic devices
  26. *
  27. * The #NMSettingGeneric object is a #NMSetting subclass that describes
  28. * optional properties that apply to "generic" devices (ie, devices that
  29. * NetworkManager does not specifically recognize).
  30. *
  31. * There are currently no properties on this object; it exists only to be
  32. * the "connection type" setting on #NMConnections for generic devices.
  33. **/
  34. G_DEFINE_TYPE (NMSettingGeneric, nm_setting_generic, NM_TYPE_SETTING)
  35. #define NM_SETTING_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GENERIC, NMSettingGenericPrivate))
  36. typedef struct {
  37. int dummy;
  38. } NMSettingGenericPrivate;
  39. /*****************************************************************************/
  40. /**
  41. * nm_setting_generic_new:
  42. *
  43. * Creates a new #NMSettingGeneric object with default values.
  44. *
  45. * Returns: (transfer full): the new empty #NMSettingGeneric object
  46. **/
  47. NMSetting *
  48. nm_setting_generic_new (void)
  49. {
  50. return (NMSetting *) g_object_new (NM_TYPE_SETTING_GENERIC, NULL);
  51. }
  52. static void
  53. nm_setting_generic_init (NMSettingGeneric *setting)
  54. {
  55. }
  56. static void
  57. nm_setting_generic_class_init (NMSettingGenericClass *klass)
  58. {
  59. NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
  60. g_type_class_add_private (klass, sizeof (NMSettingGenericPrivate));
  61. _nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_GENERIC);
  62. }