Module: Msf::Sessions::Modem::UdpChannel::SocketInterface
- Includes:
- ChannelSocketInterface
- Defined in:
- lib/msf/base/sessions/modem.rb
Instance Attribute Summary
Attributes included from Rex::Post::Channel::SocketAbstraction::SocketInterface
Instance Method Summary collapse
-
#recvfrom_nonblock(length, flags = 0) ⇒ Array(String, String)
Read one datagram and use the channel's fixed peer address.
-
#send(buf, _flags = 0, _a = nil, _b = nil) ⇒ Object
UDPSocket#send-compatible signature.
- #type? ⇒ Boolean
Methods included from ChannelSocketInterface
Methods included from Rex::Post::Channel::SocketAbstraction::SocketInterface
Instance Method Details
#recvfrom_nonblock(length, flags = 0) ⇒ Array(String, String)
Read one datagram and use the channel's fixed peer address. Sending the address separately allows readers to run before it is available.
289 290 291 |
# File 'lib/msf/base/sessions/modem.rb', line 289 def recvfrom_nonblock(length, flags = 0) [super(length, flags)[0], channel.sockaddr.dup] end |
#send(buf, _flags = 0, _a = nil, _b = nil) ⇒ Object
UDPSocket#send-compatible signature. The modem connection is bound to a single peer (AT+QIOPEN "UDP","host",port), so the explicit host/port are accepted to satisfy the interface but the datagram always goes to that peer.
299 300 301 302 |
# File 'lib/msf/base/sessions/modem.rb', line 299 def send(buf, _flags = 0, _a = nil, _b = nil) channel.dio_write(buf) buf.length end |
#type? ⇒ Boolean
278 279 280 |
# File 'lib/msf/base/sessions/modem.rb', line 278 def type? 'udp' end |