]> git.ipfire.org Git - thirdparty/samba.git/blame - source3/lib/interface.h
lib-interface: Add parsing for interface 'options'
[thirdparty/samba.git] / source3 / lib / interface.h
CommitLineData
925cc9aa
AS
1/*
2 *
3 * Unix SMB/CIFS implementation.
4 *
5 * Type definitions for interfaces
6 *
7 * Copyright (c) 2020 Andreas Schneider <asn@samba.org>
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef _INTERFACE_H
23#define _INTERFACE_H
24
25#include <system/network.h>
26
3edeb2bd
VA
27#define IFACE_NONE_OPTION 0x00000000U
28#define IFACE_DYNAMIC_OPTION 0x00000001U
29
925cc9aa
AS
30bool ismyaddr(const struct sockaddr *ip);
31bool ismyip_v4(struct in_addr ip);
32bool is_local_net(const struct sockaddr *from);
33void setup_linklocal_scope_id(struct sockaddr *pss);
34bool is_local_net_v4(struct in_addr from);
35int iface_count(void);
36int iface_count_v4_nl(void);
37const struct in_addr *first_ipv4_iface(void);
38struct interface *get_interface(int n);
39const struct sockaddr_storage *iface_n_sockaddr_storage(int n);
40const struct in_addr *iface_n_ip_v4(int n);
41const struct in_addr *iface_n_bcast_v4(int n);
42const struct sockaddr_storage *iface_n_bcast(int n);
43const struct sockaddr_storage *iface_ip(const struct sockaddr *ip);
44bool iface_local(const struct sockaddr *ip);
45void load_interfaces(void);
46void gfree_interfaces(void);
47bool interfaces_changed(void);
96110426 48bool interface_ifindex_exists(int if_index);
925cc9aa
AS
49
50#endif /* _INTERFACE_H */