MCPcopy Create free account
hub / github.com/secdev/scapy / BEGIN

Method BEGIN

scapy/layers/tftp.py:279–292  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

277 # BEGIN
278 @ATMT.state(initial=1)
279 def BEGIN(self):
280 self.data = [self.origdata[i * self.blocksize:(i + 1) * self.blocksize]
281 for i in range(len(self.origdata) // self.blocksize + 1)]
282 self.my_tid = self.sport or RandShort()._fix()
283 bind_bottom_up(UDP, TFTP, dport=self.my_tid)
284 self.server_tid = None
285
286 self.l3 = IP(dst=self.server) / UDP(sport=self.my_tid, dport=self.port) / TFTP() # noqa: E501
287 self.last_packet = self.l3 / TFTP_WRQ(filename=self.filename, mode="octet") # noqa: E501
288 self.send(self.last_packet)
289 self.res = ""
290 self.awaiting = 0
291
292 raise self.WAITING_ACK()
293
294 # WAITING_ACK
295 @ATMT.state()

Callers

nothing calls this directly

Calls 9

WAITING_ACKMethod · 0.95
RandShortClass · 0.90
bind_bottom_upFunction · 0.90
IPClass · 0.90
UDPClass · 0.90
TFTPClass · 0.85
TFTP_WRQClass · 0.85
_fixMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected