1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/*
* nl.h - Netlink helper functions, the header file
*
* Copyright 2006 Red Hat, Inc.
*
* David Cantrell <dcantrell@redhat.com>
*
* This software may be freely redistributed under the terms of the GNU
* general public license.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Information per interface */
typedef struct _interface_info_t {
int i; /* interface index */
char *name; /* name (eth0, eth1, ...) */
struct in_addr ip_addr; /* IPv4 address (0=none) */
struct in6_addr ip6_addr; /* IPv6 address (0=none) */
unsigned char mac[8]; /* MAC address */
} interface_info_t;
/* Function prototypes */
char *netlink_format_mac_addr(char *buf, unsigned char *mac);
char *netlink_format_ip_addr(int family, interface_info_t *intf, char *buf);
int netlink_create_socket(void);
int netlink_send_dump_request(int sock, int type, int family);
int netlink_get_interface_ip(int index, int family, void *addr);
int netlink_init_interfaces_list(void);
|