blob: 661fea176bbe3fcae8b25b8ba7208540fc48a274 [file] [log] [blame]
Wilson Ngd6181882014-04-14 16:28:35 -07001-- binary
204 04 # version, type
Wilson Ng5902bbf2014-07-31 13:30:49 -0700300 50 # 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 Ng5902bbf2014-07-31 13:30:49 -0700800 40 # vport len
900 00 00 1b # 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
Wilson Ng5902bbf2014-07-31 13:30:49 -07001800 00 04 00 # rate limit
Wilson Ngd6181882014-04-14 16:28:35 -07001966 6f 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 # vport if name
20-- python
21ofp.message.bsn_virtual_port_create_request(
22xid=0x01020304, vport=ofp.bsn_vport_l2gre(
Wilson Ng5902bbf2014-07-31 13:30:49 -070023flags=ofp.OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID | ofp.OF_BSN_VPORT_L2GRE_DSCP_ASSIGN | \
24ofp.OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID | ofp.OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID,
Wilson Ngd6181882014-04-14 16:28:35 -070025port_no=1,
Wilson Ng28fc85b2014-06-10 18:18:39 -070026loopback_port_no=2,
Wilson Ngd6181882014-04-14 16:28:35 -070027local_mac=[0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f],
28nh_mac=[0x01, 0x02, 0x03, 0x04, 0x05, 0x06],
29src_ip=0xc0000002,
30dst_ip=0xc0001002,
Wilson Ngd6181882014-04-14 16:28:35 -070031dscp=1,
32ttl=64,
33vpn=0xbeef,
Wilson Ng5902bbf2014-07-31 13:30:49 -070034rate_limit=0x400,
Wilson Ngd6181882014-04-14 16:28:35 -070035if_name="foo"
36))
37-- c
38obj = of_bsn_virtual_port_create_request_new(OF_VERSION_1_3);
39of_bsn_virtual_port_create_request_xid_set(obj, 0x01020304);
40{
41 of_object_t *vport = of_bsn_vport_l2gre_new(OF_VERSION_1_3);
42 {
43 of_port_name_t if_name = "foo";
44 of_mac_addr_t local_mac = { { 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f } };
45 of_mac_addr_t nh_mac = { { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 } };
Wilson Ng8c9d9572014-04-15 16:27:53 -070046 of_bsn_vport_l2gre_flags_set(vport,
47 OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID |
Wilson Ng5902bbf2014-07-31 13:30:49 -070048 OF_BSN_VPORT_L2GRE_DSCP_ASSIGN |
49 OF_BSN_VPORT_L2GRE_LOOPBACK_IS_VALID |
50 OF_BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID);
Wilson Ngd6181882014-04-14 16:28:35 -070051 of_bsn_vport_l2gre_port_no_set(vport, 1);
Wilson Ng28fc85b2014-06-10 18:18:39 -070052 of_bsn_vport_l2gre_loopback_port_no_set(vport, 2);
Wilson Ngd6181882014-04-14 16:28:35 -070053 of_bsn_vport_l2gre_local_mac_set(vport, local_mac);
54 of_bsn_vport_l2gre_nh_mac_set(vport, nh_mac);
55 of_bsn_vport_l2gre_src_ip_set(vport, 0xc0000002);
56 of_bsn_vport_l2gre_dst_ip_set(vport, 0xc0001002);
Wilson Ngd6181882014-04-14 16:28:35 -070057 of_bsn_vport_l2gre_dscp_set(vport, 1);
58 of_bsn_vport_l2gre_ttl_set(vport, 64);
59 of_bsn_vport_l2gre_vpn_set(vport, 0xbeef);
Wilson Ng5902bbf2014-07-31 13:30:49 -070060 of_bsn_vport_l2gre_rate_limit_set(vport, 0x400);
Wilson Ngd6181882014-04-14 16:28:35 -070061 of_bsn_vport_l2gre_if_name_set(vport, if_name);
62 }
63 of_bsn_virtual_port_create_request_vport_set(obj, vport);
64 of_object_delete(vport);
65}
Wilson Ng7e7aa352014-04-15 17:51:01 -070066-- java
67builder.setXid(0x01020304)
68 .setVport(
69 factory.buildBsnVportL2Gre()
70 .setFlags(
71 ImmutableSet.<OFBsnVportL2GreFlags>of(
72 OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID,
Wilson Ng5902bbf2014-07-31 13:30:49 -070073 OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_DSCP_ASSIGN,
74 OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_LOOPBACK_IS_VALID,
75 OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_RATE_LIMIT_IS_VALID
Wilson Ng7e7aa352014-04-15 17:51:01 -070076 )
77 )
78 .setPortNo(OFPort.of(1))
Wilson Ng28fc85b2014-06-10 18:18:39 -070079 .setLoopbackPortNo(OFPort.of(2))
Wilson Ng7e7aa352014-04-15 17:51:01 -070080 .setLocalMac(MacAddress.of("0a:0b:0c:0d:0e:0f"))
81 .setNhMac(MacAddress.of("01:02:03:04:05:06"))
82 .setSrcIp(IPv4Address.of("192.0.0.2"))
83 .setDstIp(IPv4Address.of("192.0.16.2"))
84 .setDscp((short)1)
85 .setTtl((short)64)
86 .setVpn(0xbeef)
Wilson Ng5902bbf2014-07-31 13:30:49 -070087 .setRateLimit(0x400)
Wilson Ng7e7aa352014-04-15 17:51:01 -070088 .setIfName("foo")
89 .build()
90 );