File tree Expand file tree Collapse file tree 9 files changed +27
-54
lines changed Expand file tree Collapse file tree 9 files changed +27
-54
lines changed Original file line number Diff line number Diff line change 57
57
IpAddress ,
58
58
MacAddress ,
59
59
)
60
- from pytcp import TcpIpStack , initialize_interface , stack
60
+ from pytcp import stack
61
61
from pytcp .protocols .icmp4 .message .icmp4_message__echo_request import (
62
62
Icmp4EchoRequestMessage ,
63
63
)
@@ -225,17 +225,14 @@ def cli(
225
225
Start Icmp Echo client.
226
226
"""
227
227
228
- fd , mtu = initialize_interface (interface )
229
-
230
228
if ip6_host :
231
229
ip6_host .gateway = ip6_gateway
232
230
233
231
if ip4_host :
234
232
ip4_host .gateway = ip4_gateway
235
233
236
- stack = TcpIpStack (
237
- fd = fd ,
238
- mtu = mtu ,
234
+ stack .init (
235
+ * stack .initialize_interface (interface ),
239
236
mac_address = mac_address ,
240
237
ip6_host = ip6_host ,
241
238
ip4_host = ip4_host ,
Original file line number Diff line number Diff line change 55
55
IpAddress ,
56
56
MacAddress ,
57
57
)
58
- from pytcp import TcpIpStack , initialize_interface
58
+ from pytcp import stack
59
59
60
60
if TYPE_CHECKING :
61
61
from pytcp .socket .socket import Socket
@@ -184,17 +184,14 @@ def cli(
184
184
Start TCP Daytime service.
185
185
"""
186
186
187
- fd , mtu = initialize_interface (interface )
188
-
189
187
if ip6_host :
190
188
ip6_host .gateway = ip6_gateway
191
189
192
190
if ip4_host :
193
191
ip4_host .gateway = ip4_gateway
194
192
195
- stack = TcpIpStack (
196
- fd = fd ,
197
- mtu = mtu ,
193
+ stack .init (
194
+ * stack .initialize_interface (interface ),
198
195
mac_address = mac_address ,
199
196
ip6_host = ip6_host ,
200
197
ip4_host = ip4_host ,
Original file line number Diff line number Diff line change 54
54
IpAddress ,
55
55
MacAddress ,
56
56
)
57
- from pytcp import TcpIpStack , initialize_interface
57
+ from pytcp import stack
58
58
59
59
if TYPE_CHECKING :
60
60
from pytcp .socket .socket import Socket
@@ -190,17 +190,14 @@ def cli(
190
190
Start TCP Daytime service.
191
191
"""
192
192
193
- fd , mtu = initialize_interface (interface )
194
-
195
193
if ip6_host :
196
194
ip6_host .gateway = ip6_gateway
197
195
198
196
if ip4_host :
199
197
ip4_host .gateway = ip4_gateway
200
198
201
- stack = TcpIpStack (
202
- fd = fd ,
203
- mtu = mtu ,
199
+ stack .init (
200
+ * stack .initialize_interface (interface ),
204
201
mac_address = mac_address ,
205
202
ip6_host = ip6_host ,
206
203
ip4_host = ip4_host ,
Original file line number Diff line number Diff line change 56
56
IpAddress ,
57
57
MacAddress ,
58
58
)
59
- from pytcp import TcpIpStack , initialize_interface
59
+ from pytcp import stack
60
60
61
61
62
62
class TcpEchoClient (Client ):
@@ -202,17 +202,14 @@ def cli(
202
202
Start TCP Echo client.
203
203
"""
204
204
205
- fd , mtu = initialize_interface (interface )
206
-
207
205
if ip6_host :
208
206
ip6_host .gateway = ip6_gateway
209
207
210
208
if ip4_host :
211
209
ip4_host .gateway = ip4_gateway
212
210
213
- stack = TcpIpStack (
214
- fd = fd ,
215
- mtu = mtu ,
211
+ stack .init (
212
+ * stack .initialize_interface (interface ),
216
213
mac_address = mac_address ,
217
214
ip6_host = ip6_host ,
218
215
ip4_host = ip4_host ,
Original file line number Diff line number Diff line change 55
55
IpAddress ,
56
56
MacAddress ,
57
57
)
58
- from pytcp import TcpIpStack , initialize_interface
58
+ from pytcp import stack
59
59
60
60
if TYPE_CHECKING :
61
61
from pytcp .socket .socket import Socket
@@ -200,17 +200,14 @@ def cli(
200
200
Start TCP Echo service.
201
201
"""
202
202
203
- fd , mtu = initialize_interface (interface )
204
-
205
203
if ip6_host :
206
204
ip6_host .gateway = ip6_gateway
207
205
208
206
if ip4_host :
209
207
ip4_host .gateway = ip4_gateway
210
208
211
- stack = TcpIpStack (
212
- fd = fd ,
213
- mtu = mtu ,
209
+ stack .init (
210
+ * stack .initialize_interface (interface ),
214
211
mac_address = mac_address ,
215
212
ip6_host = ip6_host ,
216
213
ip4_host = ip4_host ,
Original file line number Diff line number Diff line change 55
55
IpAddress ,
56
56
MacAddress ,
57
57
)
58
- from pytcp import TcpIpStack , initialize_interface
58
+ from pytcp import stack
59
59
60
60
if TYPE_CHECKING :
61
61
from pytcp .socket .socket import Socket
@@ -150,17 +150,14 @@ def cli(
150
150
Start UDP Daytime service.
151
151
"""
152
152
153
- fd , mtu = initialize_interface (interface )
154
-
155
153
if ip6_host :
156
154
ip6_host .gateway = ip6_gateway
157
155
158
156
if ip4_host :
159
157
ip4_host .gateway = ip4_gateway
160
158
161
- stack = TcpIpStack (
162
- fd = fd ,
163
- mtu = mtu ,
159
+ stack .init (
160
+ * stack .initialize_interface (interface ),
164
161
mac_address = mac_address ,
165
162
ip6_host = ip6_host ,
166
163
ip4_host = ip4_host ,
Original file line number Diff line number Diff line change 54
54
IpAddress ,
55
55
MacAddress ,
56
56
)
57
- from pytcp import TcpIpStack , initialize_interface
57
+ from pytcp import stack
58
58
59
59
if TYPE_CHECKING :
60
60
from pytcp .socket .socket import Socket
@@ -147,17 +147,14 @@ def cli(
147
147
Start UDP Discard service.
148
148
"""
149
149
150
- fd , mtu = initialize_interface (interface )
151
-
152
150
if ip6_host :
153
151
ip6_host .gateway = ip6_gateway
154
152
155
153
if ip4_host :
156
154
ip4_host .gateway = ip4_gateway
157
155
158
- stack = TcpIpStack (
159
- fd = fd ,
160
- mtu = mtu ,
156
+ stack .init (
157
+ * stack .initialize_interface (interface ),
161
158
mac_address = mac_address ,
162
159
ip6_host = ip6_host ,
163
160
ip4_host = ip4_host ,
Original file line number Diff line number Diff line change 55
55
IpAddress ,
56
56
MacAddress ,
57
57
)
58
- from pytcp import TcpIpStack , initialize_interface
58
+ from pytcp import stack
59
59
60
60
61
61
class UdpEchoClient (Client ):
@@ -183,17 +183,14 @@ def cli(
183
183
Start UDP Echo client.
184
184
"""
185
185
186
- fd , mtu = initialize_interface (interface )
187
-
188
186
if ip6_host :
189
187
ip6_host .gateway = ip6_gateway
190
188
191
189
if ip4_host :
192
190
ip4_host .gateway = ip4_gateway
193
191
194
- stack = TcpIpStack (
195
- fd = fd ,
196
- mtu = mtu ,
192
+ stack .init (
193
+ * stack .initialize_interface (interface ),
197
194
mac_address = mac_address ,
198
195
ip6_host = ip6_host ,
199
196
ip4_host = ip4_host ,
Original file line number Diff line number Diff line change 55
55
IpAddress ,
56
56
MacAddress ,
57
57
)
58
- from pytcp import TcpIpStack , initialize_interface
58
+ from pytcp import stack
59
59
60
60
if TYPE_CHECKING :
61
61
from pytcp .socket .socket import Socket
@@ -163,17 +163,14 @@ def cli(
163
163
Start TCP Echo service.
164
164
"""
165
165
166
- fd , mtu = initialize_interface (interface )
167
-
168
166
if ip6_host :
169
167
ip6_host .gateway = ip6_gateway
170
168
171
169
if ip4_host :
172
170
ip4_host .gateway = ip4_gateway
173
171
174
- stack = TcpIpStack (
175
- fd = fd ,
176
- mtu = mtu ,
172
+ stack .init (
173
+ * stack .initialize_interface (interface ),
177
174
mac_address = mac_address ,
178
175
ip6_host = ip6_host ,
179
176
ip4_host = ip4_host ,
You can’t perform that action at this time.
0 commit comments