summaryrefslogtreecommitdiffstats
path: root/src/network/wait-online/link.h
blob: 5dc26d9c40ab314c2f7a875686869d08b18de160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once

#include "sd-netlink.h"

#include "log-link.h"
#include "network-util.h"

typedef struct Link Link;
typedef struct Manager Manager;

struct Link {
        Manager *manager;

        int ifindex;
        char *ifname;
        char **altnames;
        unsigned flags;

        bool required_for_online;
        LinkOperationalStateRange required_operstate;
        LinkOperationalState operational_state;
        AddressFamily required_family;
        LinkAddressState ipv4_address_state;
        LinkAddressState ipv6_address_state;
        char *state;
};

int link_new(Manager *m, Link **ret, int ifindex, const char *ifname);
Link *link_free(Link *l);
int link_update_rtnl(Link *l, sd_netlink_message *m);
int link_update_monitor(Link *l);

DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_free);