Class: PacketGen::Packet
- Inherits:
-
Object
- Object
- PacketGen::Packet
- Defined in:
- lib/capra/packetgen_extensions.rb
Instance Method Summary collapse
- #arp? ⇒ Boolean
- #dns? ⇒ Boolean
- #ftp? ⇒ Boolean
- #http? ⇒ Boolean
- #https? ⇒ Boolean
- #icmp? ⇒ Boolean
- #ip? ⇒ Boolean
- #ssh? ⇒ Boolean
- #telnet? ⇒ Boolean
Instance Method Details
#arp? ⇒ Boolean
40 41 42 |
# File 'lib/capra/packetgen_extensions.rb', line 40 def arp? return true if self.is? 'ARP' end |
#dns? ⇒ Boolean
32 33 34 |
# File 'lib/capra/packetgen_extensions.rb', line 32 def dns? return true if self.is? 'DNS' end |
#ftp? ⇒ Boolean
3 4 5 6 |
# File 'lib/capra/packetgen_extensions.rb', line 3 def ftp? return false unless self.is? 'TCP' self.tcp.dport == 21 || self.tcp.sport == 21 end |
#http? ⇒ Boolean
17 18 19 20 |
# File 'lib/capra/packetgen_extensions.rb', line 17 def http? return false unless self.is? 'TCP' self.is? 'HTTP::Request' or self.is? 'HTTP::Response' end |
#https? ⇒ Boolean
22 23 24 25 |
# File 'lib/capra/packetgen_extensions.rb', line 22 def https? return false unless self.is? 'TCP' self.tcp.dport == 443 || self.tcp.sport == 443 end |
#icmp? ⇒ Boolean
13 14 15 |
# File 'lib/capra/packetgen_extensions.rb', line 13 def icmp? self.is? 'ICMP' end |
#ip? ⇒ Boolean
36 37 38 |
# File 'lib/capra/packetgen_extensions.rb', line 36 def ip? return true if self.is? 'IP' end |
#ssh? ⇒ Boolean
8 9 10 11 |
# File 'lib/capra/packetgen_extensions.rb', line 8 def ssh? return false unless self.is? 'TCP' self.tcp.dport == 22 || self.tcp.sport == 22 end |
#telnet? ⇒ Boolean
27 28 29 30 |
# File 'lib/capra/packetgen_extensions.rb', line 27 def telnet? return false unless self.is? 'TCP' self.tcp.dport == 23 || self.tcp.sport == 23 end |