summaryrefslogtreecommitdiff
path: root/src/dhcp/nm-dhcp-utils.h
blob: 2572dd4fe30d05ba064f56fc83679a8e8c745a96 (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
35
36
37
38
39
// SPDX-License-Identifier: GPL-2.0+
/* Copyright (C) 2014 Red Hat, Inc.
 */

#ifndef __NETWORKMANAGER_DHCP_UTILS_H__
#define __NETWORKMANAGER_DHCP_UTILS_H__

#include <stdlib.h>

#include "nm-ip4-config.h"
#include "nm-ip6-config.h"

NMIP4Config *nm_dhcp_utils_ip4_config_from_options (struct _NMDedupMultiIndex *multi_idx,
                                                    int ifindex,
                                                    const char *iface,
                                                    GHashTable *options,
                                                    guint32 route_table,
                                                    guint32 route_metric);

NMIP6Config *nm_dhcp_utils_ip6_config_from_options (struct _NMDedupMultiIndex *multi_idx,
                                                    int ifindex,
                                                    const char *iface,
                                                    GHashTable *options,
                                                    gboolean info_only);

NMPlatformIP6Address nm_dhcp_utils_ip6_prefix_from_options (GHashTable *options);

char *nm_dhcp_utils_duid_to_string (GBytes *duid);

GBytes *nm_dhcp_utils_client_id_string_to_bytes (const char *client_id);

gboolean nm_dhcp_utils_get_leasefile_path (int addr_family,
                                           const char *plugin_name,
                                           const char *iface,
                                           const char *uuid,
                                           char **out_leasefile_path);

#endif /* __NETWORKMANAGER_DHCP_UTILS_H__ */