2021-09-04 23:32:04 -05:00
|
|
|
/*
|
|
|
|
* 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 <glib-object.h>
|
|
|
|
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
2022-01-02 23:07:39 -06:00
|
|
|
#include "ni-ip.h"
|
|
|
|
|
2021-09-04 23:32:04 -05:00
|
|
|
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);
|
2021-09-17 08:20:00 -05:00
|
|
|
void ni_interface_set_name (NIInterface *ni_interface, const gchar *name);
|
2021-09-04 23:32:04 -05:00
|
|
|
guint ni_interface_get_iface_type (NIInterface *ni_interface);
|
|
|
|
gboolean ni_interface_is_wireless (NIInterface *ni_interface);
|
2021-12-10 09:56:18 -06:00
|
|
|
guint ni_interface_get_mtu (NIInterface *ni_interface);
|
|
|
|
void ni_interface_set_mtu (NIInterface *ni_interface, guint mtu);
|
2021-12-28 23:16:15 -06:00
|
|
|
guint ni_interface_get_master (NIInterface *ni_interface);
|
2021-09-04 23:32:04 -05:00
|
|
|
NIClient *ni_interface_get_client (NIInterface *ni_interface);
|
|
|
|
const GList *ni_interface_get_ip_list (NIInterface *ni_interface);
|
2021-09-17 08:20:00 -05:00
|
|
|
guint ni_interface_get_flags (NIInterface *ni_interface);
|
|
|
|
void ni_interface_set_down (NIInterface *ni_interface);
|
|
|
|
void ni_interface_set_up (NIInterface *ni_interface);
|
2023-07-28 17:01:59 -06:00
|
|
|
void ni_interface_run_dhcp (NIInterface *ni_interface, int type, guint flags);
|
2022-01-02 23:07:39 -06:00
|
|
|
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);
|
2022-01-04 00:08:47 -06:00
|
|
|
gint ni_interface_get_dhcp_gw_count (NIInterface *ni_interface);
|
2022-01-02 23:07:39 -06:00
|
|
|
gboolean ni_interface_has_dhcp_server_addr (NIInterface *ni_interface);
|
2022-01-04 00:08:47 -06:00
|
|
|
gint ni_interface_get_dhcp_dns_count (NIInterface *ni_interface);
|
2022-01-02 23:07:39 -06:00
|
|
|
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);
|
2022-01-04 00:08:47 -06:00
|
|
|
const struct_addr * ni_interface_get_dhcp_dns_addr (NIInterface *ni_interface);
|
|
|
|
const char *ni_interface_get_dhcp_domain_name (NIInterface *ni_interface);
|
2021-09-04 23:32:04 -05:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __NI_INTERFACE_H__ */
|