1999-05-17 01:36:30 +00:00
|
|
|
/*
|
2013-04-24 09:35:02 -04:00
|
|
|
* Copyright (c) 1996, 1998-2005, 2007, 2010-2013
|
2008-11-09 14:13:13 +00:00
|
|
|
* Todd C. Miller <Todd.Miller@courtesan.com>
|
1999-05-17 01:36:30 +00:00
|
|
|
*
|
2004-02-13 21:36:43 +00:00
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
1999-05-17 01:36:30 +00:00
|
|
|
*
|
2003-04-16 00:42:10 +00:00
|
|
|
* Sponsored in part by the Defense Advanced Research Projects
|
|
|
|
* Agency (DARPA) and Air Force Research Laboratory, Air Force
|
|
|
|
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
1999-05-17 01:36:30 +00:00
|
|
|
*/
|
|
|
|
|
2015-05-21 11:13:20 -06:00
|
|
|
#ifndef SUDOERS_INTERFACES_H
|
|
|
|
#define SUDOERS_INTERFACES_H
|
1999-05-17 01:36:30 +00:00
|
|
|
|
2010-06-14 14:52:53 -04:00
|
|
|
/*
|
|
|
|
* Union to hold either strucr in_addr or in6_add
|
|
|
|
*/
|
|
|
|
union sudo_in_addr_un {
|
|
|
|
struct in_addr ip4;
|
2011-12-01 11:07:17 -05:00
|
|
|
#ifdef HAVE_STRUCT_IN6_ADDR
|
2010-06-14 14:52:53 -04:00
|
|
|
struct in6_addr ip6;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
1999-05-17 01:36:30 +00:00
|
|
|
/*
|
|
|
|
* IP address and netmask pairs for checking against local interfaces.
|
|
|
|
*/
|
|
|
|
struct interface {
|
2013-10-22 09:08:09 -06:00
|
|
|
SLIST_ENTRY(interface) entries;
|
2013-10-23 15:03:31 -06:00
|
|
|
unsigned int family; /* AF_INET or AF_INET6 */
|
2010-06-14 14:52:53 -04:00
|
|
|
union sudo_in_addr_un addr;
|
|
|
|
union sudo_in_addr_un netmask;
|
1999-05-17 01:36:30 +00:00
|
|
|
};
|
|
|
|
|
2013-10-22 09:08:09 -06:00
|
|
|
SLIST_HEAD(interface_list, interface);
|
|
|
|
|
1999-05-17 01:36:30 +00:00
|
|
|
/*
|
|
|
|
* Prototypes for external functions.
|
|
|
|
*/
|
2010-09-08 15:07:40 -04:00
|
|
|
int get_net_ifs(char **addrinfo);
|
|
|
|
void dump_interfaces(const char *);
|
2015-06-17 06:49:59 -06:00
|
|
|
bool set_interfaces(const char *);
|
2013-10-22 09:08:09 -06:00
|
|
|
struct interface_list *get_interfaces(void);
|
1999-05-17 01:36:30 +00:00
|
|
|
|
2015-05-21 11:13:20 -06:00
|
|
|
#endif /* SUDOERS_INTERFACES_H */
|