summaryrefslogtreecommitdiff
path: root/include/dhcp.h
blob: e19dac0d66ab9cf49157c04d5882ca0900df26a0 (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
40
41
42
43
44
45
46
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) 2015 PHYTEC Messtechnik GmbH,
 * Author: Wadim Egorov <w.egorov@phytec.de>
 */

#ifndef __DHCP_H__
#define __DHCP_H__

#define DHCP_DEFAULT_RETRY 20

struct dhcp_req_param {
	char *hostname;
	char *vendor_id;
	char *client_id;
	char *user_class;
	char *client_uuid;
	char *option224;
	int retries;
};

struct dhcp_result {
	IPaddr_t ip;
	IPaddr_t netmask;
	IPaddr_t gateway;
	IPaddr_t nameserver;
	IPaddr_t serverip;
	IPaddr_t dhcp_serverip;
	char *hostname;
	char *domainname;
	char *rootpath;
	char *devicetree;
	char *bootfile;
	char *tftp_server_name;
	uint32_t leasetime;
};

struct eth_device;

int dhcp_request(struct eth_device *edev, const struct dhcp_req_param *param,
		 struct dhcp_result **res);
int dhcp_set_result(struct eth_device *edev, struct dhcp_result *res);
void dhcp_result_free(struct dhcp_result *res);
int dhcp(struct eth_device *edev, const struct dhcp_req_param *param);

#endif