nm-ssh.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
  2. /***************************************************************************
  3. * nm-ssh.h : GNOME UI dialogs for configuring ssh VPN connections
  4. *
  5. * Copyright (C) 2013 Dan Fruehauf, <malkodan@gmail.com>
  6. * Based on work by Dan Williams, <dcbw@redhat.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. *
  22. **************************************************************************/
  23. #ifndef _NM_SSH_H_
  24. #define _NM_SSH_H_
  25. #include <glib-object.h>
  26. typedef enum
  27. {
  28. SSH_PLUGIN_UI_ERROR_UNKNOWN = 0,
  29. SSH_PLUGIN_UI_ERROR_INVALID_CONNECTION,
  30. SSH_PLUGIN_UI_ERROR_INVALID_PROPERTY,
  31. SSH_PLUGIN_UI_ERROR_MISSING_PROPERTY,
  32. SSH_PLUGIN_UI_ERROR_FILE_NOT_READABLE,
  33. SSH_PLUGIN_UI_ERROR_FILE_NOT_SSH
  34. } SshPluginUiError;
  35. #define SSH_TYPE_PLUGIN_UI_ERROR (ssh_plugin_ui_error_get_type ())
  36. GType ssh_plugin_ui_error_get_type (void);
  37. #define SSH_PLUGIN_UI_ERROR (ssh_plugin_ui_error_quark ())
  38. GQuark ssh_plugin_ui_error_quark (void);
  39. #define SSH_TYPE_PLUGIN_UI (ssh_plugin_ui_get_type ())
  40. #define SSH_PLUGIN_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SSH_TYPE_PLUGIN_UI, SshPluginUi))
  41. #define SSH_PLUGIN_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SSH_TYPE_PLUGIN_UI, SshPluginUiClass))
  42. #define SSH_IS_PLUGIN_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SSH_TYPE_PLUGIN_UI))
  43. #define SSH_IS_PLUGIN_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SSH_TYPE_PLUGIN_UI))
  44. #define SSH_PLUGIN_UI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SSH_TYPE_PLUGIN_UI, SshPluginUiClass))
  45. typedef struct _SshPluginUi SshPluginUi;
  46. typedef struct _SshPluginUiClass SshPluginUiClass;
  47. struct _SshPluginUi {
  48. GObject parent;
  49. };
  50. struct _SshPluginUiClass {
  51. GObjectClass parent;
  52. };
  53. GType ssh_plugin_ui_get_type (void);
  54. #define SSH_TYPE_PLUGIN_UI_WIDGET (ssh_plugin_ui_widget_get_type ())
  55. #define SSH_PLUGIN_UI_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SSH_TYPE_PLUGIN_UI_WIDGET, SshPluginUiWidget))
  56. #define SSH_PLUGIN_UI_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SSH_TYPE_PLUGIN_UI_WIDGET, SshPluginUiWidgetClass))
  57. #define SSH_IS_PLUGIN_UI_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SSH_TYPE_PLUGIN_UI_WIDGET))
  58. #define SSH_IS_PLUGIN_UI_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SSH_TYPE_PLUGIN_UI_WIDGET))
  59. #define SSH_PLUGIN_UI_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SSH_TYPE_PLUGIN_UI_WIDGET, SshPluginUiWidgetClass))
  60. typedef struct _SshPluginUiWidget SshPluginUiWidget;
  61. typedef struct _SshPluginUiWidgetClass SshPluginUiWidgetClass;
  62. struct _SshPluginUiWidget {
  63. GObject parent;
  64. };
  65. struct _SshPluginUiWidgetClass {
  66. GObjectClass parent;
  67. };
  68. GType ssh_plugin_ui_widget_get_type (void);
  69. typedef void (*ChangedCallback) (GtkWidget *widget, gpointer user_data);
  70. void init_auth_widget (GtkBuilder *builder,
  71. GtkSizeGroup *group,
  72. NMSettingVPN *s_vpn,
  73. const char *contype,
  74. const char *prefix,
  75. ChangedCallback changed_cb,
  76. gpointer user_data);
  77. /* Export/Import key dictionary */
  78. #define REMOTE_KEY "REMOTE"
  79. #define AUTH_TYPE_KEY "AUTH_TYPE"
  80. #define KEY_FILE_KEY "KEY_FILE"
  81. #define PREFERRED_AUTHENTICATION_KEY "PREFERRED_AUTHENTICATION"
  82. #define PASSWORD_PROMPT_NR_KEY "PASSWORD_PROMPT_NR"
  83. #define REMOTE_USERNAME_KEY "REMOTE_USERNAME"
  84. #define REMOTE_IP_KEY "REMOTE_IP"
  85. #define LOCAL_IP_KEY "LOCAL_IP"
  86. #define NETMASK_KEY "NETMASK"
  87. #define IP_6_KEY "IP_6"
  88. #define REMOTE_IP_6_KEY "REMOTE_IP_6"
  89. #define LOCAL_IP_6_KEY "LOCAL_IP_6"
  90. #define NETMASK_6_KEY "NETMASK_6"
  91. #define PORT_KEY "PORT"
  92. #define MTU_KEY "MTU"
  93. #define EXTRA_OPTS_KEY "EXTRA_OPTS"
  94. #define REMOTE_DEV_KEY "REMOTE_DEV"
  95. #define DEV_TYPE_KEY "DEV_TYPE"
  96. #define NO_DEFAULT_ROUTE_KEY "NO_DEFAULT_ROUTE"
  97. #define TUNNEL_TYPE_KEY "TUNNEL_TYPE"
  98. #endif /* _NM_SSH_H_ */