Class: Pcap::TCPPacket
- Defined in:
- lib/pcap/packet.rb,
ext/pcap/tcp_packet.c
Instance Method Summary collapse
- #dport ⇒ Object
-
#dport= ⇒ Object
Set TCP destination port and update checksum.
- #sport ⇒ Object
-
#sport= ⇒ Object
Set TCP source port and update checksum.
- #tcp_ack ⇒ Object
- #tcp_ack? ⇒ Boolean
- #tcp_csum_ok? ⇒ Boolean
-
#tcp_csum_update! ⇒ Object
Calculate TCP checksum and update it in packet.
- #tcp_data ⇒ Object
- #tcp_data_len ⇒ Object
- #tcp_dport ⇒ Object
-
#tcp_dport= ⇒ Object
Set TCP destination port and update checksum.
- #tcp_fin? ⇒ Boolean
- #tcp_flags ⇒ Object
- #tcp_flags_s ⇒ Object
- #tcp_hlen ⇒ Object
- #tcp_off ⇒ Object
- #tcp_options ⇒ Object
- #tcp_psh? ⇒ Boolean
- #tcp_rst? ⇒ Boolean
- #tcp_seq ⇒ Object
-
#tcp_sport ⇒ Object
define methods under IPv4.
-
#tcp_sport= ⇒ Object
Set TCP source port and update checksum.
- #tcp_sum ⇒ Object
- #tcp_syn? ⇒ Boolean
- #tcp_truncated? ⇒ Boolean
- #tcp_urg? ⇒ Boolean
- #tcp_urp ⇒ Object
- #tcp_win ⇒ Object
- #to_s ⇒ Object
Methods inherited from IPPacket
#dst, #dst=, #ip_data, #ip_df?, #ip_dst, #ip_dst=, #ip_flags, #ip_hlen, #ip_id, #ip_len, #ip_mf?, #ip_off, #ip_proto, #ip_src, #ip_src=, #ip_sum, #ip_sum_update!, #ip_sumok?, #ip_tos, #ip_truncated?, #ip_ttl, #ip_ver, #src, #src=
Methods inherited from Packet
#=~, #_dump, #_dump_to, _load, _load_from, #arp?, #caplen, #datalink, #dst_mac_address, #ethertype, #inspect, #ip?, #ipv6?, #lacp?, #length, #raw_data, #size, #src_mac_address, #tcp?, #time, #time_i, #time_i=, #udata, #udata=, #udp?, #unpack_hex_string
Instance Method Details
#dport ⇒ Object
#dport= ⇒ Object
Set TCP destination port and update checksum
267 268 269 |
# File 'ext/pcap/tcp_packet.c', line 267 static VALUE tcpp_dport_set(self, val) VALUE self, val; |
#sport ⇒ Object
#sport= ⇒ Object
Set TCP source port and update checksum
235 236 237 |
# File 'ext/pcap/tcp_packet.c', line 235 static VALUE tcpp_sport_set(self, val) VALUE self, val; |
#tcp_ack ⇒ Object
#tcp_ack? ⇒ Boolean
#tcp_csum_ok? ⇒ Boolean
109 110 111 |
# File 'ext/pcap/tcp_packet.c', line 109 static VALUE tcpp_csumok(self) VALUE self; |
#tcp_csum_update! ⇒ Object
Calculate TCP checksum and update it in packet
181 182 183 |
# File 'ext/pcap/tcp_packet.c', line 181 static VALUE tcpp_csum_update(self) VALUE self; |
#tcp_data ⇒ Object
#tcp_data_len ⇒ Object
168 169 170 |
# File 'ext/pcap/tcp_packet.c', line 168 def tcp_data_len ip_len - 4 * (ip_hlen + tcp_hlen) end |
#tcp_dport ⇒ Object
#tcp_dport= ⇒ Object
Set TCP destination port and update checksum
267 268 269 |
# File 'ext/pcap/tcp_packet.c', line 267 static VALUE tcpp_dport_set(self, val) VALUE self, val; |
#tcp_fin? ⇒ Boolean
#tcp_flags ⇒ Object
#tcp_flags_s ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/pcap/packet.rb', line 44 def tcp_flags_s return \ (tcp_urg? ? 'U' : '.') + (tcp_ack? ? 'A' : '.') + (tcp_psh? ? 'P' : '.') + (tcp_rst? ? 'R' : '.') + (tcp_syn? ? 'S' : '.') + (tcp_fin? ? 'F' : '.') end |
#tcp_hlen ⇒ Object
#tcp_off ⇒ Object
#tcp_options ⇒ Object
95 96 97 |
# File 'ext/pcap/tcp_packet.c', line 95 static VALUE (self) VALUE self; |
#tcp_psh? ⇒ Boolean
#tcp_rst? ⇒ Boolean
#tcp_seq ⇒ Object
#tcp_sport ⇒ Object
define methods under IPv4
#tcp_sport= ⇒ Object
Set TCP source port and update checksum
235 236 237 |
# File 'ext/pcap/tcp_packet.c', line 235 static VALUE tcpp_sport_set(self, val) VALUE self, val; |
#tcp_sum ⇒ Object
#tcp_syn? ⇒ Boolean
#tcp_truncated? ⇒ Boolean
153 154 155 |
# File 'ext/pcap/tcp_packet.c', line 153 static VALUE tcpp_truncated(self) VALUE self; |
#tcp_urg? ⇒ Boolean
#tcp_urp ⇒ Object
#tcp_win ⇒ Object
#to_s ⇒ Object
54 55 56 |
# File 'lib/pcap/packet.rb', line 54 def to_s "#{src}:#{sport} > #{dst}:#{dport} #{tcp_flags_s}" end |