trema / pio

Packet parser and generator in Ruby
27 stars 11 forks source link

Add a test data for nx_packet_in #286

Closed shun159 closed 8 years ago

shun159 commented 9 years ago

データの中身です。 今回は少し複雑そうでしたので、、、

    Arp = <<16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#ac, 16#5d,
            16#10, 16#31, 16#37, 16#79, 16#08, 16#06, 16#00, 16#01,
            16#08, 16#00, 16#06, 16#04, 16#00, 16#01, 16#ac, 16#5d,
            16#10, 16#31, 16#37, 16#79, 16#c0, 16#a8, 16#02, 16#fe,
            16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#ff, 16#c0, 16#a8,
            16#02, 16#05, 16#00, 16#00, 16#00, 16#00, 16#00, 16#00,
            16#00, 16#00, 16#00, 16#00, 16#00, 16#00, 16#00, 16#00,
            16#00, 16#00, 16#00, 16#00>>,
    Match = [ofproto_nx:in_port(1),
             ofproto_nx:reg1(<<10,0,0,1>>),
             ofproto_nx:reg7(2),
             ofproto_nx:metadata(16#ff)],
    PktIn = #nx_packet_in{ buffer_id = 16#ffffff00,
                           total_len = 60,
                           reason    = action,
                           table_id  = 13,
                           cookie    = <<0:64>>,
                           match     = Match,
                           data      = Arp },
    Body = #ofp_vendor_header{ vendor = nicira,
                               data   = #nicira_header{
                                           sub_type = packet_in,
                                           body = PktIn } },
    Msg = #ofp_header{ version = 1,
                       type = vendor,
                       xid = 0,
                       body = Body },