summaryrefslogtreecommitdiffstats
path: root/isys/nl.h
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2006-05-24 20:40:21 +0000
committerDavid Cantrell <dcantrell@redhat.com>2006-05-24 20:40:21 +0000
commit3f9bae933be97d027e3211883e6c11c28b28e5a5 (patch)
tree865647b24c3d08a89148d013dc66fad421f88b14 /isys/nl.h
parent10c046488d9bdf57ca5f381382d29422f26b6545 (diff)
downloadanaconda-3f9bae933be97d027e3211883e6c11c28b28e5a5.tar.gz
anaconda-3f9bae933be97d027e3211883e6c11c28b28e5a5.tar.xz
anaconda-3f9bae933be97d027e3211883e6c11c28b28e5a5.zip
All hail the hypnotoad!
Yeah, so we have some netlink_* functions now. You can build nltest in the isys directory and it'll dump info on your interfaces including the index number, the name, the MAC address, the IPv4 address, and the IPv6 address. Next up is rewriting isys functions to use the netlink_* functions.
Diffstat (limited to 'isys/nl.h')
-rw-r--r--isys/nl.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/isys/nl.h b/isys/nl.h
new file mode 100644
index 000000000..46e70313a
--- /dev/null
+++ b/isys/nl.h
@@ -0,0 +1,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);