summaryrefslogtreecommitdiffstats
path: root/src/network.h
blob: db95412ecf875b9123bc05147a98bab66642bbd9 (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
/*
 * functions and data types for networking calls
 *
 * Copyright (c) 2015 Ultimaker B.V.
 * Author: Olliver Schinagl <o.schinagl@ultimaker.com>
 *
 * SPDX-License-Identifier:	AGPL-3.0+
 */

#ifndef _NETWORK_H
#define _NETWORK_H

#include <Eina.h>
#include <Eldbus.h>
#include <stdint.h>

#define IPV4_MAX_LEN 16 /* 255.255.255.255\0 */
#define IPV6_MAX_LEN 40 /* ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff\0 */
#define SSID_MAX_LEN 33 /* Section 7.3.2.1 SSID element of IEE802.11-2007 + \0 */

enum network_tech {
	TECH_UNKNOWN,
	TECH_ETHERNET,
	TECH_WIFI,
};

struct network_data {
	char *obj_path;
	enum network_tech tech;
	char ipv4[IPV4_MAX_LEN];
	char ipv6[IPV6_MAX_LEN];
	char ssid[SSID_MAX_LEN];
};

Eldbus_Pending *network_connect_wifi(const struct network_data *network);
void network_init(Eldbus_Proxy *proxy);
void network_shutdown(void);

#endif /* _NETWORK_H */