NetworkInador/lib/network-inador-private.h

76 lines
2.0 KiB
C
Raw Normal View History

/*
* network-inador-private.h
* This file is part of Network-Inador
*
* Copyright (C) 2024 - Félix Arreola Rodríguez
*
* Network-Inador 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.
*
* Network-Inador 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 Network-Inador; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifndef __NETWORK_INADOR_PRIVATE_H__
#define __NETWORK_INADOR_PRIVATE_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <netlink/socket.h>
#include <netlink/msg.h>
#include "network-inador.h"
#include "flist.h"
/* Para vigilar eventos */
typedef struct {
struct nl_sock * nl_sock;
unsigned int source;
} NetlinkEventPair;
/* La definición principal que engloba todo */
struct _NetworkInadorHandle {
struct NetworkInadorOps ops;
/* La verdadera información */
FList *interfaces;
FList *route_v4_tables;
FList *route_v6_tables;
FList *route_tables_names;
/* Entradas para el resolv conf */
FList *resolver_entries;
int resolver_inotify_fd;
int resolver_inotify_watch;
/* Estos sockets ejecutan comandos */
struct nl_sock * nl_sock_route;
//struct nl_sock * nl_sock_nl80211;
/* Estos sockets son de vigilancia de eventos */
int has_route_events;
NetlinkEventPair route_events;
/*NetlinkEventPair nl80211_scan;
NetlinkEventPair nl80211_scan_results;*/
/* El pipe de vigilancia especial de las rutas eliminadas */
int pipe_routes[2];
unsigned int source_pipe_routes;
};
#endif /* __NETWORK_INADOR_PRIVATE_H__ */