aboutsummaryrefslogtreecommitdiffstats
path: root/src/fst/fst_iface.h
blob: cbaa7d81788d99802de5272d6b26ab2347ec5aaf (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
 * FST module - FST interface object definitions
 * Copyright (c) 2014, Qualcomm Atheros, Inc.
 *
 * This software may be distributed under the terms of the BSD license.
 * See README for more details.
 */


#ifndef FST_IFACE_H
#define FST_IFACE_H

#include "utils/includes.h"
#include "utils/common.h"
#include "list.h"
#include "fst.h"

struct fst_iface {
	struct fst_group *group;
	struct fst_wpa_obj iface_obj;
	u8 own_addr[ETH_ALEN];
	struct wpabuf *mb_ie;
	char ifname[IFNAMSIZ + 1];
	struct fst_iface_cfg cfg;
	struct dl_list group_lentry;
};

struct fst_iface * fst_iface_create(struct fst_group *g, const char *ifname,
				    const u8 *own_addr,
				    const struct fst_wpa_obj *iface_obj,
				    const struct fst_iface_cfg *cfg);
void fst_iface_delete(struct fst_iface *i);

static inline struct fst_group * fst_iface_get_group(struct fst_iface *i)
{
	return i->group;
}

static inline const char * fst_iface_get_name(struct fst_iface *i)
{
	return i->ifname;
}

static inline const u8 * fst_iface_get_addr(struct fst_iface *i)
{
	return i->own_addr;
}

static inline const char * fst_iface_get_group_id(struct fst_iface *i)
{
	return i->cfg.group_id;
}

static inline u8 fst_iface_get_priority(struct fst_iface *i)
{
	return i->cfg.priority;
}

static inline u32 fst_iface_get_llt(struct fst_iface *i)
{
	return i->cfg.llt;
}

static inline const struct wpabuf * fst_iface_get_mbie(struct fst_iface *i)
{
	return i->mb_ie;
}

static inline const u8 * fst_iface_get_bssid(struct fst_iface *i)
{
	return i->iface_obj.get_bssid(i->iface_obj.ctx);
}

static inline void fst_iface_get_channel_info(struct fst_iface *i,
					      enum hostapd_hw_mode *hw_mode,
					      u8 *channel)
{
	i->iface_obj.get_channel_info(i->iface_obj.ctx, hw_mode, channel);
}

static inline int fst_iface_get_hw_modes(struct fst_iface *i,
					 struct hostapd_hw_modes **modes)
{
	return i->iface_obj.get_hw_modes(i->iface_obj.ctx, modes);
}

static inline void fst_iface_set_ies(struct fst_iface *i,
				     const struct wpabuf *fst_ies)
{
	i->iface_obj.set_ies(i->iface_obj.ctx, fst_ies);
}

static inline int fst_iface_send_action(struct fst_iface *i,
					const u8 *addr, struct wpabuf *data)
{
	return i->iface_obj.send_action(i->iface_obj.ctx, addr, data);
}

static inline const struct wpabuf *
fst_iface_get_peer_mb_ie(struct fst_iface *i, const u8 *addr)
{
	return i->iface_obj.get_mb_ie(i->iface_obj.ctx, addr);
}

static inline void fst_iface_update_mb_ie(struct fst_iface *i,
					  const u8 *addr,
					  const u8 *buf, size_t size)
{
	i->iface_obj.update_mb_ie(i->iface_obj.ctx, addr, buf, size);
}

static inline const u8 * fst_iface_get_peer_first(struct fst_iface *i,
						  struct fst_get_peer_ctx **ctx,
						  Boolean mb_only)
{
	return i->iface_obj.get_peer_first(i->iface_obj.ctx, ctx, mb_only);
}

static inline const u8 * fst_iface_get_peer_next(struct fst_iface *i,
						 struct fst_get_peer_ctx **ctx,
						 Boolean mb_only)
{
	return i->iface_obj.get_peer_next(i->iface_obj.ctx, ctx, mb_only);
}

Boolean fst_iface_is_connected(struct fst_iface *iface, const u8 *addr,
			       Boolean mb_only);
void fst_iface_attach_mbie(struct fst_iface *i, struct wpabuf *mbie);
enum mb_band_id fst_iface_get_band_id(struct fst_iface *i);

static inline void * fst_iface_get_wpa_obj_ctx(struct fst_iface *i)
{
	return i->iface_obj.ctx;
}

#endif /* FST_IFACE_H */