blob: b5fd5fa86372cc998d5b9a93e8d3cd7a9074866c [file] [log] [blame]
Wilson Ngd6181882014-04-14 16:28:35 -07001-- binary
204 04 # version, type
Wilson Ng8c9d9572014-04-15 16:27:53 -0700300 48 # 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 Ng8c9d9572014-04-15 16:27:53 -0700800 38 # vport len
900 00 00 03 # vport flags
Wilson Ngd6181882014-04-14 16:28:35 -07001000 00 00 01 # vport port no
110a 0b 0c 0d 0e 0f # local mac
1201 02 03 04 05 06 # next hop mac
13c0 00 00 02 # src ip
14c0 00 10 02 # dst ip
Wilson Ng8c9d9572014-04-15 16:27:53 -07001501 40 00 00 # dscp, ttl, pad(2)
Wilson Ngd6181882014-04-14 16:28:35 -07001600 00 be ef # vpn
1766 6f 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 # vport if name
18-- python
19ofp.message.bsn_virtual_port_create_request(
20xid=0x01020304, vport=ofp.bsn_vport_l2gre(
Wilson Ng8c9d9572014-04-15 16:27:53 -070021flags=ofp.OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID | ofp.OF_BSN_VPORT_L2GRE_DSCP_ASSIGN,
Wilson Ngd6181882014-04-14 16:28:35 -070022port_no=1,
23local_mac=[0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f],
24nh_mac=[0x01, 0x02, 0x03, 0x04, 0x05, 0x06],
25src_ip=0xc0000002,
26dst_ip=0xc0001002,
Wilson Ngd6181882014-04-14 16:28:35 -070027dscp=1,
28ttl=64,
29vpn=0xbeef,
30if_name="foo"
31))
32-- c
33obj = of_bsn_virtual_port_create_request_new(OF_VERSION_1_3);
34of_bsn_virtual_port_create_request_xid_set(obj, 0x01020304);
35{
36 of_object_t *vport = of_bsn_vport_l2gre_new(OF_VERSION_1_3);
37 {
38 of_port_name_t if_name = "foo";
39 of_mac_addr_t local_mac = { { 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f } };
40 of_mac_addr_t nh_mac = { { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 } };
Wilson Ng8c9d9572014-04-15 16:27:53 -070041 of_bsn_vport_l2gre_flags_set(vport,
42 OF_BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID |
43 OF_BSN_VPORT_L2GRE_DSCP_ASSIGN);
Wilson Ngd6181882014-04-14 16:28:35 -070044 of_bsn_vport_l2gre_port_no_set(vport, 1);
45 of_bsn_vport_l2gre_local_mac_set(vport, local_mac);
46 of_bsn_vport_l2gre_nh_mac_set(vport, nh_mac);
47 of_bsn_vport_l2gre_src_ip_set(vport, 0xc0000002);
48 of_bsn_vport_l2gre_dst_ip_set(vport, 0xc0001002);
Wilson Ngd6181882014-04-14 16:28:35 -070049 of_bsn_vport_l2gre_dscp_set(vport, 1);
50 of_bsn_vport_l2gre_ttl_set(vport, 64);
51 of_bsn_vport_l2gre_vpn_set(vport, 0xbeef);
52 of_bsn_vport_l2gre_if_name_set(vport, if_name);
53 }
54 of_bsn_virtual_port_create_request_vport_set(obj, vport);
55 of_object_delete(vport);
56}
Wilson Ng7e7aa352014-04-15 17:51:01 -070057-- java
58builder.setXid(0x01020304)
59 .setVport(
60 factory.buildBsnVportL2Gre()
61 .setFlags(
62 ImmutableSet.<OFBsnVportL2GreFlags>of(
63 OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_LOCAL_MAC_IS_VALID,
64 OFBsnVportL2GreFlags.BSN_VPORT_L2GRE_DSCP_ASSIGN
65 )
66 )
67 .setPortNo(OFPort.of(1))
68 .setLocalMac(MacAddress.of("0a:0b:0c:0d:0e:0f"))
69 .setNhMac(MacAddress.of("01:02:03:04:05:06"))
70 .setSrcIp(IPv4Address.of("192.0.0.2"))
71 .setDstIp(IPv4Address.of("192.0.16.2"))
72 .setDscp((short)1)
73 .setTtl((short)64)
74 .setVpn(0xbeef)
75 .setIfName("foo")
76 .build()
77 );