]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
139b011a PF |
2 | #ifndef foosddhcp6clienthfoo |
3 | #define foosddhcp6clienthfoo | |
4 | ||
5 | /*** | |
810adae9 | 6 | Copyright © 2014 Intel Corporation. All rights reserved. |
139b011a PF |
7 | |
8 | systemd is free software; you can redistribute it and/or modify it | |
9 | under the terms of the GNU Lesser General Public License as published by | |
10 | the Free Software Foundation; either version 2.1 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | systemd is distributed in the hope that it will be useful, but | |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | Lesser General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU Lesser General Public License | |
19 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
20 | ***/ | |
21 | ||
04c01369 | 22 | #include <inttypes.h> |
139b011a | 23 | #include <net/ethernet.h> |
04c01369 | 24 | #include <sys/types.h> |
139b011a | 25 | |
ea3b3a75 | 26 | #include "sd-dhcp6-lease.h" |
71d35b6b | 27 | #include "sd-event.h" |
ea3b3a75 | 28 | |
04c01369 LP |
29 | #include "_sd-common.h" |
30 | ||
31 | _SD_BEGIN_DECLARATIONS; | |
32 | ||
139b011a | 33 | enum { |
10c9ce61 DH |
34 | SD_DHCP6_CLIENT_EVENT_STOP = 0, |
35 | SD_DHCP6_CLIENT_EVENT_RESEND_EXPIRE = 10, | |
36 | SD_DHCP6_CLIENT_EVENT_RETRANS_MAX = 11, | |
37 | SD_DHCP6_CLIENT_EVENT_IP_ACQUIRE = 12, | |
38 | SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST = 13, | |
139b011a PF |
39 | }; |
40 | ||
2c1ab8ca BG |
41 | enum { |
42 | SD_DHCP6_OPTION_CLIENTID = 1, | |
43 | SD_DHCP6_OPTION_SERVERID = 2, | |
44 | SD_DHCP6_OPTION_IA_NA = 3, | |
45 | SD_DHCP6_OPTION_IA_TA = 4, | |
46 | SD_DHCP6_OPTION_IAADDR = 5, | |
47 | SD_DHCP6_OPTION_ORO = 6, | |
48 | SD_DHCP6_OPTION_PREFERENCE = 7, | |
49 | SD_DHCP6_OPTION_ELAPSED_TIME = 8, | |
50 | SD_DHCP6_OPTION_RELAY_MSG = 9, | |
51 | /* option code 10 is unassigned */ | |
52 | SD_DHCP6_OPTION_AUTH = 11, | |
53 | SD_DHCP6_OPTION_UNICAST = 12, | |
54 | SD_DHCP6_OPTION_STATUS_CODE = 13, | |
55 | SD_DHCP6_OPTION_RAPID_COMMIT = 14, | |
56 | SD_DHCP6_OPTION_USER_CLASS = 15, | |
57 | SD_DHCP6_OPTION_VENDOR_CLASS = 16, | |
58 | SD_DHCP6_OPTION_VENDOR_OPTS = 17, | |
59 | SD_DHCP6_OPTION_INTERFACE_ID = 18, | |
60 | SD_DHCP6_OPTION_RECONF_MSG = 19, | |
61 | SD_DHCP6_OPTION_RECONF_ACCEPT = 20, | |
62 | ||
63 | SD_DHCP6_OPTION_DNS_SERVERS = 23, /* RFC 3646 */ | |
64 | SD_DHCP6_OPTION_DOMAIN_LIST = 24, /* RFC 3646 */ | |
831ad964 PF |
65 | SD_DHCP6_OPTION_IA_PD = 25, /* RFC 3633, prefix delegation */ |
66 | SD_DHCP6_OPTION_IA_PD_PREFIX = 26, /* RFC 3633, prefix delegation */ | |
2c1ab8ca BG |
67 | |
68 | SD_DHCP6_OPTION_SNTP_SERVERS = 31, /* RFC 4075, deprecated */ | |
fcb51238 | 69 | SD_DHCP6_OPTION_INFORMATION_REFRESH_TIME = 32, /* RFC 8415, sec. 21.23 */ |
2c1ab8ca BG |
70 | |
71 | /* option code 35 is unassigned */ | |
72 | ||
8006aa32 SA |
73 | SD_DHCP6_OPTION_FQDN = 39, /* RFC 4704 */ |
74 | ||
2c1ab8ca | 75 | SD_DHCP6_OPTION_NTP_SERVER = 56, /* RFC 5908 */ |
de8d6e55 | 76 | SD_DHCP6_OPTION_MUD_URL = 112, /* RFC 8250 */ |
2c1ab8ca BG |
77 | |
78 | /* option codes 89-142 are unassigned */ | |
79 | /* option codes 144-65535 are unassigned */ | |
80 | }; | |
81 | ||
139b011a PF |
82 | typedef struct sd_dhcp6_client sd_dhcp6_client; |
83 | ||
4b558378 ZJS |
84 | typedef void (*sd_dhcp6_client_callback_t)(sd_dhcp6_client *client, int event, void *userdata); |
85 | int sd_dhcp6_client_set_callback( | |
86 | sd_dhcp6_client *client, | |
87 | sd_dhcp6_client_callback_t cb, | |
88 | void *userdata); | |
89 | ||
2f8e7633 | 90 | int sd_dhcp6_client_set_ifindex( |
4b558378 ZJS |
91 | sd_dhcp6_client *client, |
92 | int interface_index); | |
93 | int sd_dhcp6_client_set_local_address( | |
94 | sd_dhcp6_client *client, | |
95 | const struct in6_addr *local_address); | |
96 | int sd_dhcp6_client_set_mac( | |
97 | sd_dhcp6_client *client, | |
98 | const uint8_t *addr, | |
99 | size_t addr_len, | |
100 | uint16_t arp_type); | |
101 | int sd_dhcp6_client_set_duid( | |
102 | sd_dhcp6_client *client, | |
103 | uint16_t duid_type, | |
f7a92d1a | 104 | const void *duid, |
4b558378 | 105 | size_t duid_len); |
7e90a499 YW |
106 | int sd_dhcp6_client_set_duid_llt( |
107 | sd_dhcp6_client *client, | |
108 | uint64_t llt_time); | |
4b558378 ZJS |
109 | int sd_dhcp6_client_set_iaid( |
110 | sd_dhcp6_client *client, | |
111 | uint32_t iaid); | |
8006aa32 SA |
112 | int sd_dhcp6_client_set_fqdn( |
113 | sd_dhcp6_client *client, | |
114 | const char *fqdn); | |
4b558378 ZJS |
115 | int sd_dhcp6_client_set_information_request( |
116 | sd_dhcp6_client *client, | |
117 | int enabled); | |
118 | int sd_dhcp6_client_get_information_request( | |
119 | sd_dhcp6_client *client, | |
120 | int *enabled); | |
121 | int sd_dhcp6_client_set_request_option( | |
122 | sd_dhcp6_client *client, | |
123 | uint16_t option); | |
de8d6e55 SS |
124 | int sd_dhcp6_client_set_request_mud_url( |
125 | sd_dhcp6_client *client, | |
feb7d7a2 | 126 | const char *mudurl); |
2805536b SS |
127 | int sd_dhcp6_client_set_prefix_delegation_hint( |
128 | sd_dhcp6_client *client, | |
129 | uint8_t prefixlen, | |
130 | const struct in6_addr *pd_address); | |
d8c51121 PF |
131 | int sd_dhcp6_client_get_prefix_delegation(sd_dhcp6_client *client, |
132 | int *delegation); | |
7c3de8f8 | 133 | int sd_dhcp6_client_set_prefix_delegation(sd_dhcp6_client *client, |
d8c51121 | 134 | int delegation); |
f311a62b PF |
135 | int sd_dhcp6_client_get_address_request(sd_dhcp6_client *client, |
136 | int *request); | |
137 | int sd_dhcp6_client_set_address_request(sd_dhcp6_client *client, | |
138 | int request); | |
b62f9008 | 139 | int sd_dhcp6_client_set_transaction_id(sd_dhcp6_client *client, uint32_t transaction_id); |
4b558378 ZJS |
140 | |
141 | int sd_dhcp6_client_get_lease( | |
142 | sd_dhcp6_client *client, | |
143 | sd_dhcp6_lease **ret); | |
ea3b3a75 | 144 | |
139b011a PF |
145 | int sd_dhcp6_client_stop(sd_dhcp6_client *client); |
146 | int sd_dhcp6_client_start(sd_dhcp6_client *client); | |
f667c150 | 147 | int sd_dhcp6_client_is_running(sd_dhcp6_client *client); |
4b558378 ZJS |
148 | int sd_dhcp6_client_attach_event( |
149 | sd_dhcp6_client *client, | |
150 | sd_event *event, | |
151 | int64_t priority); | |
139b011a PF |
152 | int sd_dhcp6_client_detach_event(sd_dhcp6_client *client); |
153 | sd_event *sd_dhcp6_client_get_event(sd_dhcp6_client *client); | |
154 | sd_dhcp6_client *sd_dhcp6_client_ref(sd_dhcp6_client *client); | |
155 | sd_dhcp6_client *sd_dhcp6_client_unref(sd_dhcp6_client *client); | |
156 | int sd_dhcp6_client_new(sd_dhcp6_client **ret); | |
157 | ||
4afd3348 LP |
158 | _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp6_client, sd_dhcp6_client_unref); |
159 | ||
04c01369 LP |
160 | _SD_END_DECLARATIONS; |
161 | ||
139b011a | 162 | #endif |