--- embedaddon/sudo/plugins/sudoers/interfaces.h 2012/02/21 16:23:02 1.1 +++ embedaddon/sudo/plugins/sudoers/interfaces.h 2014/06/15 16:12:54 1.1.1.4 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 1998-2005, 2007, 2010 + * Copyright (c) 1996, 1998-2005, 2007, 2010-2013 * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any @@ -19,15 +19,15 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#ifndef _SUDO_INTERFACES_H -#define _SUDO_INTERFACES_H +#ifndef _SUDOERS_INTERFACES_H +#define _SUDOERS_INTERFACES_H /* * Union to hold either strucr in_addr or in6_add */ union sudo_in_addr_un { struct in_addr ip4; -#ifdef HAVE_IN6_ADDR +#ifdef HAVE_STRUCT_IN6_ADDR struct in6_addr ip6; #endif }; @@ -36,24 +36,20 @@ union sudo_in_addr_un { * IP address and netmask pairs for checking against local interfaces. */ struct interface { - int family; /* AF_INET or AF_INET6 */ + SLIST_ENTRY(interface) entries; + unsigned int family; /* AF_INET or AF_INET6 */ union sudo_in_addr_un addr; union sudo_in_addr_un netmask; - struct interface *next; }; +SLIST_HEAD(interface_list, interface); + /* * Prototypes for external functions. */ int get_net_ifs(char **addrinfo); void dump_interfaces(const char *); void set_interfaces(const char *); +struct interface_list *get_interfaces(void); -/* - * Definitions for external variables. - */ -#ifndef _SUDO_MAIN -extern struct interface *interfaces; -#endif - -#endif /* _SUDO_INTERFACES_H */ +#endif /* _SUDOERS_INTERFACES_H */