MCPcopy Index your code
hub / github.com/secdev/scapy / send

Method send

scapy/arch/windows/native.py:157–172  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

155 self.ins.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON)
156
157 def send(self, x):
158 # type: (Packet) -> int
159 data = raw(x)
160 if self.cls not in x:
161 raise Scapy_Exception("L3WinSocket can only send IP/IPv6 packets !"
162 " Install Npcap/Winpcap to send more")
163 from scapy.layers.inet import TCP
164 if TCP in x:
165 raise Scapy_Exception(
166 "'TCP data cannot be sent over raw socket': "
167 "https://learn.microsoft.com/en-us/windows/win32/winsock/tcp-ip-raw-sockets-2" # noqa: E501
168 )
169 if not self.outs:
170 raise Scapy_Exception("Socket not created")
171 dst_ip = str(x[self.cls].dst)
172 return self.outs.sendto(data, (dst_ip, 0))
173
174 def nonblock_recv(self, x=MTU):
175 # type: (int) -> Optional[Packet]

Callers

nothing calls this directly

Calls 2

rawFunction · 0.90
Scapy_ExceptionClass · 0.90

Tested by

no test coverage detected