nm-setting-sriov.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. * You should have received a copy of the GNU Lesser General Public
  9. * License along with this program. If not, see
  10. * <http://www.gnu.org/licenses/>.
  11. *
  12. * Copyright 2018 Red Hat, Inc.
  13. */
  14. #ifndef NM_SETTING_SRIOV_H
  15. #define NM_SETTING_SRIOV_H
  16. #if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
  17. #error "Only <NetworkManager.h> can be included directly."
  18. #endif
  19. #include "nm-setting.h"
  20. G_BEGIN_DECLS
  21. #define NM_TYPE_SETTING_SRIOV (nm_setting_sriov_get_type ())
  22. #define NM_SETTING_SRIOV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_SRIOV, NMSettingSriov))
  23. #define NM_SETTING_SRIOV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_SRIOV, NMSettingSriovClass))
  24. #define NM_IS_SETTING_SRIOV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_SRIOV))
  25. #define NM_IS_SETTING_SRIOV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_SRIOV))
  26. #define NM_SETTING_SRIOV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_SRIOV, NMSettingSriovClass))
  27. #define NM_SETTING_SRIOV_SETTING_NAME "sriov"
  28. #define NM_SETTING_SRIOV_TOTAL_VFS "total-vfs"
  29. #define NM_SETTING_SRIOV_VFS "vfs"
  30. #define NM_SETTING_SRIOV_AUTOPROBE_DRIVERS "autoprobe-drivers"
  31. #define NM_SRIOV_VF_ATTRIBUTE_MAC "mac"
  32. #define NM_SRIOV_VF_ATTRIBUTE_SPOOF_CHECK "spoof-check"
  33. #define NM_SRIOV_VF_ATTRIBUTE_TRUST "trust"
  34. #define NM_SRIOV_VF_ATTRIBUTE_MIN_TX_RATE "min-tx-rate"
  35. #define NM_SRIOV_VF_ATTRIBUTE_MAX_TX_RATE "max-tx-rate"
  36. typedef struct _NMSettingSriovClass NMSettingSriovClass;
  37. typedef struct _NMSriovVF NMSriovVF;
  38. /**
  39. * NMSriovVFVlanProtocol:
  40. * @NM_SRIOV_VF_VLAN_PROTOCOL_802_1Q: use 802.1Q
  41. * @NM_SRIOV_VF_VLAN_PROTOCOL_802_1AD: use 802.1ad
  42. *
  43. * #NMSriovVFVlanProtocol indicates the VLAN protocol to use.
  44. *
  45. * Since: 1.14
  46. */
  47. typedef enum {
  48. NM_SRIOV_VF_VLAN_PROTOCOL_802_1Q = 0,
  49. NM_SRIOV_VF_VLAN_PROTOCOL_802_1AD = 1,
  50. } NMSriovVFVlanProtocol;
  51. NM_AVAILABLE_IN_1_14
  52. GType nm_setting_sriov_get_type (void);
  53. NM_AVAILABLE_IN_1_14
  54. NMSetting *nm_setting_sriov_new (void);
  55. NM_AVAILABLE_IN_1_14
  56. guint nm_setting_sriov_get_total_vfs (NMSettingSriov *setting);
  57. NM_AVAILABLE_IN_1_14
  58. guint nm_setting_sriov_get_num_vfs (NMSettingSriov *setting);
  59. NM_AVAILABLE_IN_1_14
  60. NMSriovVF *nm_setting_sriov_get_vf (NMSettingSriov *setting, guint idx);
  61. NM_AVAILABLE_IN_1_14
  62. void nm_setting_sriov_add_vf (NMSettingSriov *setting, NMSriovVF *vf);
  63. NM_AVAILABLE_IN_1_14
  64. void nm_setting_sriov_remove_vf (NMSettingSriov *setting, guint idx);
  65. NM_AVAILABLE_IN_1_14
  66. gboolean nm_setting_sriov_remove_vf_by_index (NMSettingSriov *setting, guint index);
  67. NM_AVAILABLE_IN_1_14
  68. void nm_setting_sriov_clear_vfs (NMSettingSriov *setting);
  69. NM_AVAILABLE_IN_1_14
  70. NMTernary nm_setting_sriov_get_autoprobe_drivers (NMSettingSriov *setting);
  71. NM_AVAILABLE_IN_1_14
  72. gboolean nm_sriov_vf_add_vlan (NMSriovVF *vf, guint vlan_id);
  73. NM_AVAILABLE_IN_1_14
  74. gboolean nm_sriov_vf_remove_vlan (NMSriovVF *vf, guint vlan_id);
  75. NM_AVAILABLE_IN_1_14
  76. const guint *nm_sriov_vf_get_vlan_ids (const NMSriovVF *vf, guint *length);
  77. NM_AVAILABLE_IN_1_14
  78. void nm_sriov_vf_set_vlan_qos (NMSriovVF *vf, guint vlan_id, guint32 qos);
  79. NM_AVAILABLE_IN_1_14
  80. void nm_sriov_vf_set_vlan_protocol (NMSriovVF *vf, guint vlan_id, NMSriovVFVlanProtocol protocol);
  81. NM_AVAILABLE_IN_1_14
  82. guint32 nm_sriov_vf_get_vlan_qos (const NMSriovVF *vf, guint vlan_id);
  83. NM_AVAILABLE_IN_1_14
  84. NMSriovVFVlanProtocol nm_sriov_vf_get_vlan_protocol (const NMSriovVF *vf, guint vlan_id);
  85. NM_AVAILABLE_IN_1_14
  86. GType nm_sriov_vf_get_type (void);
  87. NM_AVAILABLE_IN_1_14
  88. NMSriovVF *nm_sriov_vf_new (guint index);
  89. NM_AVAILABLE_IN_1_14
  90. void nm_sriov_vf_ref (NMSriovVF *vf);
  91. NM_AVAILABLE_IN_1_14
  92. void nm_sriov_vf_unref (NMSriovVF *vf);
  93. NM_AVAILABLE_IN_1_14
  94. gboolean nm_sriov_vf_equal (const NMSriovVF *vf, const NMSriovVF *other);
  95. NM_AVAILABLE_IN_1_14
  96. NMSriovVF *nm_sriov_vf_dup (const NMSriovVF *vf);
  97. NM_AVAILABLE_IN_1_14
  98. guint nm_sriov_vf_get_index (const NMSriovVF *vf);
  99. NM_AVAILABLE_IN_1_14
  100. void nm_sriov_vf_set_attribute (NMSriovVF *vf, const char *name, GVariant *value);
  101. NM_AVAILABLE_IN_1_14
  102. const char **nm_sriov_vf_get_attribute_names (const NMSriovVF *vf);
  103. NM_AVAILABLE_IN_1_14
  104. GVariant *nm_sriov_vf_get_attribute (const NMSriovVF *vf, const char *name);
  105. NM_AVAILABLE_IN_1_14
  106. gboolean nm_sriov_vf_attribute_validate (const char *name, GVariant *value, gboolean *known, GError **error);
  107. G_END_DECLS
  108. #endif /* NM_SETTING_SRIOV_H */