blob: 9d902937d19d3c03925711b65b9fd7a011c87ed2 [file] [log] [blame]
Wilson Ngd6181882014-04-14 16:28:35 -07001-- binary
204 04 # version, type
Wilson Ng28fc85b2014-06-10 18:18:39 -0700300 4c # len
Wilson Ngd6181882014-04-14 16:28:35 -0700401 02 03 04 # xid
500 5c 16 c7 # experimenter
600 00 00 0f # subtype
700 01 # vport type
Wilson Ng28fc85b2014-06-10 18:18:39 -0700800 3c # vport len
Wilson Ng8c9d9572014-04-15 16:27:53 -0700900 00 00 03 # vport flags
Wilson Ng28fc85b2014-06-10 18:18:39 -07001000 00 00 01 # parent port no
1100 00 00 02 # loopback port no
Wilson Ngd6181882014-04-14 16:28:35 -0700120a 0b 0c 0d 0e 0f # local mac
1301 02 03 04 05 06 # next hop mac
14c0 00 00 02 # src ip
15c0 00 10 02 # dst ip
Wilson Ng8c9d9572014-04-15 16:27:53 -07001601 40 00 00 # dscp, ttl, pad(2)
Wilson Ngd6181882014-04-14 16:28:35 -07001700 00 be ef # vpn
1866 6f 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 # vport if name
19-- python
20ofp.message.bsn_virtual_port_create_request(
21xid=0x01020304, vport=ofp.bsn_vport_l2gre(
Wilson Ng8c9d9572014-04-15 16:27:53 -070022flags=ofp.OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID | ofp.OF_BSN_VPORT_L2GRE_DSCP_ASSIGN,
Wilson Ngd6181882014-04-14 16:28:35 -070023port_no=1,
Wilson Ng28fc85b2014-06-10 18:18:39 -070024loopback_port_no=2,
Wilson Ngd6181882014-04-14 16:28:35 -070025local_mac=[0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f],
26nh_mac=[0x01, 0x02, 0x03, 0x04, 0x05, 0x06],
27src_ip=0xc0000002,
28dst_ip=0xc0001002,
Wilson Ngd6181882014-04-14 16:28:35 -070029dscp=1,
30ttl=64,
31vpn=0xbeef,
32if_name="foo"
33))
34-- c
35obj = of_bsn_virtual_port_create_request_new(OF_VERSION_1_3);
36of_bsn_virtual_port_create_request_xid_set(obj, 0x01020304);
37{
38 of_object_t *vport = of_bsn_vport_l2gre_new(OF_VERSION_1_3);
39 {
40 of_port_name_t if_name = "foo";
41 of_mac_addr_t local_mac = { { 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f } };
42 of_mac_addr_t nh_mac = { { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 } };
Wilson Ng8c9d9572014-04-15 16:27:53 -070043 of_bsn_vport_l2gre_flags_set(vport,
44 OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID |
45 OF_BSN_VPORT_L2GRE_DSCP_ASSIGN);
Wilson Ngd6181882014-04-14 16:28:35 -070046 of_bsn_vport_l2gre_port_no_set(vport, 1);
Wilson Ng28fc85b2014-06-10 18:18:39 -070047 of_bsn_vport_l2gre_loopback_port_no_set(vport, 2);
Wilson Ngd6181882014-04-14 16:28:35 -070048 of_bsn_vport_l2gre_local_mac_set(vport, local_mac);
49 of_bsn_vport_l2gre_nh_mac_set(vport, nh_mac);
50 of_bsn_vport_l2gre_src_ip_set(vport, 0xc0000002);
51 of_bsn_vport_l2gre_dst_ip_set(vport, 0xc0001002);
Wilson Ngd6181882014-04-14 16:28:35 -070052 of_bsn_vport_l2gre_dscp_set(vport, 1);
53 of_bsn_vport_l2gre_ttl_set(vport, 64);
54 of_bsn_vport_l2gre_vpn_set(vport, 0xbeef);
55 of_bsn_vport_l2gre_if_name_set(vport, if_name);
56 }
57 of_bsn_virtual_port_create_request_vport_set(obj, vport);
58 of_object_delete(vport);
59}
Wilson Ng7e7aa352014-04-15 17:51:01 -070060-- java
61builder.setXid(0x01020304)
62 .setVport(
63 factory.buildBsnVportL2Gre()
64 .setFlags(
65 ImmutableSet.<OFBsnVportL2GreFlags>of(
66 OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID,
67 OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_DSCP_ASSIGN
68 )
69 )
70 .setPortNo(OFPort.of(1))
Wilson Ng28fc85b2014-06-10 18:18:39 -070071 .setLoopbackPortNo(OFPort.of(2))
Wilson Ng7e7aa352014-04-15 17:51:01 -070072 .setLocalMac(MacAddress.of("0a:0b:0c:0d:0e:0f"))
73 .setNhMac(MacAddress.of("01:02:03:04:05:06"))
74 .setSrcIp(IPv4Address.of("192.0.0.2"))
75 .setDstIp(IPv4Address.of("192.0.16.2"))
76 .setDscp((short)1)
77 .setTtl((short)64)
78 .setVpn(0xbeef)
79 .setIfName("foo")
80 .build()
81 );