Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

porting to 1.9, the print command should work properly now.

  • Loading branch information...
commit 19c9a190e21adc408418daf95d8d9d805cf908aa 1 parent 71bdc53
@dakrone authored
View
2  gentags
@@ -3,4 +3,4 @@
## This script is intended to be used in conjuction with exuberant-ctags:
## http://ctags.sourceforge.net/
-/usr/local/bin/ctags -L files -f tags --verbose=yes
+ctags -L files -f tags --verbose=yes
View
6 lib/encodelib.rb
@@ -71,13 +71,13 @@ def Encoder.decode_urlescape(str)
end
def Encoder.decode_binary(str)
- return str.to_a.pack('B*')
+ return [str].pack('B*')
end
def Encoder.decode_binary_MSB(str)
- return str.to_a.pack('B*')
+ return [str].pack('B*')
end
def Encoder.decode_binary_LSB(str)
- return str.to_a.pack('b*')
+ return [str].pack('b*')
end
def Encoder.decode_hex(str)
View
4 lib/pcaplib.rb
@@ -49,9 +49,9 @@ def print_pkt_payload(p,opts,fullpacket)
# If the full packet is requested, print all the data, not just
# the payload
if fullpacket
- data = p.data.unpack('H*').to_s
+ data = p.data.unpack('H*').join
else
- data = p.payload.unpack('H*').to_s
+ data = p.payload.unpack('H*').join
end
if opts == "full"
View
17 lib/pcapparser.rb
@@ -1,5 +1,4 @@
-# vim: set ts=2 sw=2 tw=80
-# FLOWTAG - parses and visualizes pcap data
+# DESCRIPTION: is part of the flowtag toolkit and simply parses a pcap file.
# Copyright (C) 2007 Christopher Lee
#
# This program is free software: you can redistribute it and/or modify
@@ -16,9 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
class PcapParser
- LINKTYPE_ETH = 0x0001
+ LINKTYPE_ETH = 0x0001
LINKTYPE_NULL = 0x0000
- LINKTYPE_SLL = 0x0071
+ LINKTYPE_SLL = 0x0071
def initialize(pcapfh)
@offset = 0
@@ -31,7 +30,7 @@ def initialize(pcapfh)
@version_major, @version_minor, @zone, @significant_figures, @snaplength, @linktype = @fh.read(20).unpack(endian)
@offset += 24
if (@linktype != LINKTYPE_ETH) && (@linktype != LINKTYPE_NULL)
- puts "Only ethernet or null are supported, sorry."
+ puts "Only ethernet is supported, sorry."
exit
end
end
@@ -76,8 +75,8 @@ def initialize(time, data, linktype)
offset = 4
end
if @ip
- @ip_hlen = (data[offset] & 0x0f) << 2
- @ip_proto = data[offset+9]
+ @ip_hlen = (data[offset].ord & 0x0f) << 2
+ @ip_proto = data[offset+9].ord
@ip_src, @ip_dst = data[offset+12,8].unpack("NN")
offset += @ip_hlen
@tcp = true if @ip_proto == 0x06
@@ -91,10 +90,10 @@ def initialize(time, data, linktype)
@ack_num = data[offset+8,4].unpack("nn").to_s.to_i
## Determine TCP flags
- @flags = data[offset+13].to_s
+ @flags = data[offset+13].ord.to_s
@urg, @ack, @psh, @rst, @syn, @fin = parse_flags(@flags)
- @tcp_hlen = (data[offset+12]>>4)<<2
+ @tcp_hlen = (data[offset+12].ord>>4)<<2
offset += @tcp_hlen
elsif @udp
@sport, @dport = data[offset,4].unpack("nn")
View
2  nsm
@@ -20,7 +20,7 @@
## ${MODULE_NAME} - The base name (without the .module) of the module
## ${OUTPUT_DIR} - The base output directory
-$NSM_VERSION = "0.8-DEVEL"
+$NSM_VERSION = "0.8.1-DEVEL"
# Add the directory nsm is in to the include path
$:.push(File.dirname(__FILE__))
View
2  tags
@@ -3,7 +3,7 @@
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
-!_TAG_PROGRAM_VERSION 5.7 //
+!_TAG_PROGRAM_VERSION 5.8 //
Command lib/command_manager.rb /^class Command$/;" c
CommandManager lib/command_manager.rb /^class CommandManager$/;" c
Encoder lib/encodelib.rb /^class Encoder$/;" c
Please sign in to comment.
Something went wrong with that request. Please try again.