@@ -35,18 +35,8 @@ use pnet::{
35
35
36
36
use tokio:: task;
37
37
38
- use proton_mac:: MacAddrPolicy ;
39
-
40
38
use proton_nat:: NatTable ;
41
39
42
- use proton_nif:: {
43
- ifnames:: {
44
- DEFAULT_WIRED_INTERFACE ,
45
- DEFAULT_WIRELESS_INTERFACE ,
46
- } ,
47
- NetworkInterface ,
48
- } ;
49
-
50
40
use crate :: AccessPointResult ;
51
41
52
42
/// Transport channel buffer size.
@@ -59,9 +49,6 @@ pub struct AccessPoint {
59
49
60
50
/// CIDR network range.
61
51
range : Ipv4Cidr ,
62
-
63
- /// MAC address management policy.
64
- mac_policy : MacAddrPolicy ,
65
52
}
66
53
67
54
impl AccessPoint {
@@ -72,20 +59,16 @@ impl AccessPoint {
72
59
/// to this access point
73
60
/// - `range` (`Ipv4Cidr`): the internal network range associated to
74
61
/// this access point
75
- /// - `mac_policy` (`MacAddrPolicy`): the MAC address policy of this
76
- /// access point
77
62
///
78
63
/// # Returns
79
64
/// A new `AccessPoint`.
80
65
pub fn new (
81
66
external_ipv4 : Ipv4Addr ,
82
67
range : Ipv4Cidr ,
83
- mac_policy : MacAddrPolicy ,
84
68
) -> Self {
85
69
Self {
86
70
nat : NatTable :: new ( vec ! [ external_ipv4] ) ,
87
71
range,
88
- mac_policy,
89
72
}
90
73
}
91
74
@@ -106,15 +89,10 @@ impl AccessPoint {
106
89
// Get network range
107
90
let range = self . range ;
108
91
109
- // Get MAC policy
110
- let mac_policy = self . mac_policy . clone ( ) ;
111
-
112
- let layer_2_task = task:: spawn ( Self :: run_layer_2 ( mac_policy) ) ;
113
-
114
92
let layer_4_task = task:: spawn ( Self :: run_layer_4 ( nat, range) ) ;
115
93
116
- match tokio:: join!( layer_2_task , layer_4_task) {
117
- ( Ok ( _) , Ok ( _ ) ) => Ok ( ( ) ) ,
94
+ match tokio:: join!( layer_4_task) {
95
+ ( Ok ( _) , ) => Ok ( ( ) ) ,
118
96
_ => todo ! ( ) ,
119
97
}
120
98
}
@@ -170,68 +148,6 @@ impl AccessPoint {
170
148
}
171
149
}
172
150
173
- /// Continuously route frames on the Data Link Layer (OSI Layer 2).
174
- ///
175
- /// # Parameters
176
- /// - `mac_policy` (`MacAddrPolicy`): the MAC address management policy
177
- ///
178
- /// # Returns
179
- /// An `AccessPointResult<()>` indicating an error, if one occurred.
180
- ///
181
- /// This function does not return during nominal operation.
182
- async fn run_layer_2 ( mac_policy : MacAddrPolicy ) -> AccessPointResult < ( ) > {
183
- // Construct the wired network interface
184
- let wired_if = NetworkInterface :: new ( DEFAULT_WIRED_INTERFACE )
185
- . ok_or ( io:: Error :: new ( io:: ErrorKind :: Other , "could not find wired interface" ) ) ?;
186
-
187
- // Construct the wireless network interface
188
- let wireless_if = NetworkInterface :: new ( DEFAULT_WIRELESS_INTERFACE )
189
- . ok_or ( io:: Error :: new ( io:: ErrorKind :: Other , "could not find wireless interface" ) ) ?;
190
-
191
- // Route outgoing ETH frames
192
- let outgoing_task = task:: spawn ( Self :: route_outgoing_frames ( wired_if. clone ( ) , wireless_if. clone ( ) , mac_policy) ) ;
193
-
194
- // Route incoming ETH frames
195
- let incoming_task = task:: spawn ( Self :: route_incoming_frames ( wired_if, wireless_if) ) ;
196
-
197
- match tokio:: join!( outgoing_task, incoming_task) {
198
- ( Ok ( _) , Ok ( _) ) => Ok ( ( ) ) ,
199
- _ => todo ! ( ) ,
200
- }
201
- }
202
-
203
- /// Route incoming Ethernet frames.
204
- ///
205
- /// # Parameters
206
- /// - `wired_if` (`NetworkInterface`): the wired network interface
207
- /// - `wireless_if` (`NetworkInterface`): the wireless network interface
208
- ///
209
- /// # Returns
210
- /// TODO
211
- async fn route_incoming_frames (
212
- _wired_if : NetworkInterface ,
213
- _wireless_if : NetworkInterface ,
214
- ) {
215
- todo ! ( )
216
- }
217
-
218
- /// Route outgoing Ethernet frames.
219
- ///
220
- /// # Parameters
221
- /// - `wired_if` (`NetworkInterface`): the wired network interface
222
- /// - `wireless_if` (`NetworkInterface`): the wireless network interface
223
- /// - `mac_policy` (`MacAddrPolicy`): the MAC address management policy
224
- ///
225
- /// # Returns
226
- /// TODO
227
- async fn route_outgoing_frames (
228
- _wired_if : NetworkInterface ,
229
- _wireless_if : NetworkInterface ,
230
- _mac_policy : MacAddrPolicy ,
231
- ) {
232
- todo ! ( )
233
- }
234
-
235
151
/// Translate an IPv4 packet.
236
152
///
237
153
/// # Parameters
0 commit comments