Sha256: d01771c0e57555a1e15f27d0fa26913ef1749a1fa111c277fbb1872605f6cbc1

Contents?: true

Size: 629 Bytes

Versions: 5

Compression:

Stored size: 629 Bytes

Contents

# http://www.mudynamics.com
# http://labs.mudynamics.com
# http://www.pcapr.net

require 'mu/testcase'
require 'mu/pcap'

module Mu
class Pcap
class UDP

class Test < Mu::TestCase
    def test_basics
        udp = UDP.new
        udp.src_port = 0x3039
        udp.dst_port = 0x0050
        udp.payload = 'hello'
        udp.payload_raw = 'hello'
        
        bytes =
            "\x30\x39" + # src port
            "\x00\x50" + # dst port
            "\x00\x0d" + # length
            "\x00\x00" + # checksum
            'hello'
        udp_in = UDP.from_bytes bytes
        assert_equal udp_in, udp
    end
end

end
end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pcapr-local-0.2.0 test/mu/pcap/tc_udp.rb
pcapr-local-0.1.13 test/mu/pcap/tc_udp.rb
pcapr-local-0.1.12 test/mu/pcap/tc_udp.rb
pcapr-local-0.1.11 test/mu/pcap/tc_udp.rb
pcapr-local-0.1.10 test/mu/pcap/tc_udp.rb