class

Pcap::Packet

Inherits Reference / Object

Constructors

new(headp : Pointer(LibPcap::PcapPkthdr), data : Pointer(LibPcap::UChar))
Source

Instance methods

caplen(*args, **options)
Source
caplen(*args, **options, &)
Source
capture_slice

#####################################################################

human friendly api

Source
data_slice
Source
dst

returns a string of host and port about dst ex: "127.0.0.1:80"

Source
ether_header
Source
hexdump(io : IO)

similar to "tcpdump -XX"

Source
hexdump
Source
inspect(io : IO)

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Source
ip_dst
Source
ip_header
Source
ip_hl
Source
ip_id
Source
ip_len
Source
ip_proto
Source
ip_src

Convenient accessor methods for IpHeader and TcpHeader

Source
ip_sum
Source
ip_tos
Source
ip_ttl
Source
ip_v
Source
len(*args, **options)
Source
len(*args, **options, &)
Source
packet_header
Source
packet_header=(packet_header : Pcap::PacketHeader)
Source
size_ip
Source
size_tcp
Source
src

returns a string of host and port about src ex: "127.0.0.1:80"

Source
tcp_ack
Source
tcp_ack?
Source
tcp_cwr?
Source
tcp_data
Source
tcp_data?
Source
tcp_dst
Source
tcp_ece?
Source
tcp_fin?
Source
tcp_header
Source
tcp_offx2
Source
tcp_push?
Source
tcp_rst?
Source
tcp_seq
Source
tcp_src
Source
tcp_sum
Source
tcp_syn?
Source
tcp_urg
Source
tcp_urg?
Source
tcp_urp?
Source
tcp_win
Source
to_s(io : IO)

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source