-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.h
59 lines (46 loc) · 1.23 KB
/
config.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Authors:
* Alexander Aring <alex.aring@gmail.com>
*
* This software is Copyright 2019 by the above mentioned author(s),
* All Rights Reserved.
*
* The license which is distributed with this software in the file COPYRIGHT
* applies to this software. If your distribution is missing this file, you
* may request it from <alex.aring@gmail.com>.
*/
#ifndef __RPLD_CONFIG__
#define __RPLD_CONFIG__
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <stdbool.h>
#include <net/if.h>
#include <stdint.h>
#include "dag.h"
#include "list.h"
#define MAX_RPL_INSTANCEID UINT8_MAX
#define DEFAULT_TICKLE_T 5
#define DEFAULT_DAG_VERSION 1
struct iface_llinfo {
unsigned char *addr;
uint8_t addr_len;
uint32_t ifindex;
};
struct iface {
char ifname[IFNAMSIZ];
uint32_t ifindex;
ev_timer dis_w;
struct iface_llinfo llinfo;
struct in6_addr ifaddr;
struct in6_addr *ifaddrs;
int ifaddrs_count;
struct in6_addr *ifaddr_src;
struct list_head rpls;
bool dodag_root;
struct list list;
};
int config_load(const char *filename, struct list_head *ifaces);
void config_free(struct list_head *ifaces);
struct iface *iface_find_by_ifindex(const struct list_head *ifaces,
uint32_t ifindex);
#endif /* __RPLD_CONFIG__ */