/* * ni-interface.h * This file is part of NetworkInador * * Copyright (C) 2021 - Gatuno * * NetworkInador is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * NetworkInador is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with NetworkInador; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ /* inclusion guard */ #ifndef __NI_INTERFACE_H__ #define __NI_INTERFACE_H__ #include #include #include #include "ni-ip.h" G_BEGIN_DECLS typedef struct _NIInterfaceClass NIInterfaceClass; typedef struct _NIInterface NIInterface; typedef struct _NIInterfacePrivate NIInterfacePrivate; typedef struct _NIClient NIClient; /* * Type declaration. */ #define NI_TYPE_INTERFACE (ni_interface_get_type ()) #define NI_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), NI_TYPE_INTERFACE, NIInterface)) #define NI_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), NI_TYPE_INTERFACE, NIInterfaceClass)) #define NI_IS_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NI_TYPE_INTERFACE)) #define NI_IS_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NI_TYPE_INTERFACE)) #define NI_INTERFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), NI_TYPE_INTERFACE, NIInterfaceClass)) GType ni_interface_get_type (void); struct _NIInterfaceClass { GObjectClass parent_class; }; struct _NIInterface { GObject parent_instance; NIInterfacePrivate *priv; }; /* * Method definitions. */ guint ni_interface_get_index (NIInterface *ni_interface); const gchar *ni_interface_get_name (NIInterface *ni_interface); void ni_interface_set_name (NIInterface *ni_interface, const gchar *name); guint ni_interface_get_iface_type (NIInterface *ni_interface); gboolean ni_interface_is_wireless (NIInterface *ni_interface); guint ni_interface_get_mtu (NIInterface *ni_interface); void ni_interface_set_mtu (NIInterface *ni_interface, guint mtu); guint ni_interface_get_master (NIInterface *ni_interface); NIClient *ni_interface_get_client (NIInterface *ni_interface); const GList *ni_interface_get_ip_list (NIInterface *ni_interface); guint ni_interface_get_flags (NIInterface *ni_interface); void ni_interface_set_down (NIInterface *ni_interface); void ni_interface_set_up (NIInterface *ni_interface); void ni_interface_run_dhcp (NIInterface *ni_interface, int type, guint flags); void ni_interface_stop_dhcp (NIInterface *ni_interface); guint ni_interface_get_dhcp_type (NIInterface *ni_interface); guint ni_interface_get_dhcp_status (NIInterface *ni_interface); guint ni_interface_get_dhcp_lease_time (NIInterface *ni_interface); guint ni_interface_get_dhcp_prefix (NIInterface *ni_interface); const struct_addr * ni_interface_get_dhcp_addr (NIInterface *ni_interface); gboolean ni_interface_has_dhcp_brd_addr (NIInterface *ni_interface); gint ni_interface_get_dhcp_gw_count (NIInterface *ni_interface); gboolean ni_interface_has_dhcp_server_addr (NIInterface *ni_interface); gint ni_interface_get_dhcp_dns_count (NIInterface *ni_interface); const struct_addr * ni_interface_get_dhcp_brd_addr (NIInterface *ni_interface); const struct_addr * ni_interface_get_dhcp_gw_addr (NIInterface *ni_interface); const struct_addr * ni_interface_get_dhcp_server_addr (NIInterface *ni_interface); const struct_addr * ni_interface_get_dhcp_dns_addr (NIInterface *ni_interface); const char *ni_interface_get_dhcp_domain_name (NIInterface *ni_interface); G_END_DECLS #endif /* __NI_INTERFACE_H__ */