From a8986413c299c77c6f57f7e8f8f0e5abf1a882c9 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 28 Jul 2011 10:20:32 +0200 Subject: Use sockaddr_any for storing address and gateway --- pingu_iface.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'pingu_iface.h') diff --git a/pingu_iface.h b/pingu_iface.h index b44415d..e690506 100644 --- a/pingu_iface.h +++ b/pingu_iface.h @@ -1,19 +1,33 @@ #ifndef PINGU_IFACE_H #define PINGU_IFACE_H +#include #include #include "list.h" +union sockaddr_any { + struct sockaddr sa; + struct sockaddr_in sin; + struct sockaddr_in6 sin6; +}; + +struct pingu_gateway { + union sockaddr_any gw; + int metric; + struct list_head gateway_list_entry; +}; + struct pingu_iface { char name[32]; int index; int has_binding; int has_link; int fd; - struct sockaddr primary_addr; + union sockaddr_any primary_addr; int route_table; struct list_head iface_list_entry; struct list_head ping_list; + struct list_head gateway_list; struct ev_io socket_watcher; }; -- cgit v1.2.3