summaryrefslogtreecommitdiffstats
path: root/src/shared/local-addresses.h
blob: 399d0c6fb8099c2273a3b57609632a65b3ab1a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once

#include "sd-netlink.h"

#include "in-addr-util.h"

struct local_address {
        int ifindex;
        unsigned char scope;
        uint32_t priority;
        uint32_t weight;
        int family;
        union in_addr_union address;
};

bool has_local_address(const struct local_address *addresses, size_t n_addresses, const struct local_address *needle);

int local_addresses(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret);

int local_gateways(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret);

int local_outbounds(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret);