Wilson Ng | d618188 | 2014-04-14 16:28:35 -0700 | [diff] [blame^] | 1 | -- binary |
| 2 | 04 04 # version, type |
| 3 | 00 44 # len |
| 4 | 01 02 03 04 # xid |
| 5 | 00 5c 16 c7 # experimenter |
| 6 | 00 00 00 0f # subtype |
| 7 | 00 01 # vport type |
| 8 | 00 34 # vport len |
| 9 | 00 00 00 01 # vport port no |
| 10 | 0a 0b 0c 0d 0e 0f # local mac |
| 11 | 01 02 03 04 05 06 # next hop mac |
| 12 | c0 00 00 02 # src ip |
| 13 | c0 00 10 02 # dst ip |
| 14 | 00 01 40 00 # dscp mode, dscp, ttl, pad |
| 15 | 00 00 be ef # vpn |
| 16 | 66 6f 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 # vport if name |
| 17 | -- python |
| 18 | ofp.message.bsn_virtual_port_create_request( |
| 19 | xid=0x01020304, vport=ofp.bsn_vport_l2gre( |
| 20 | port_no=1, |
| 21 | local_mac=[0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f], |
| 22 | nh_mac=[0x01, 0x02, 0x03, 0x04, 0x05, 0x06], |
| 23 | src_ip=0xc0000002, |
| 24 | dst_ip=0xc0001002, |
| 25 | dscp_mode=0, |
| 26 | dscp=1, |
| 27 | ttl=64, |
| 28 | vpn=0xbeef, |
| 29 | if_name="foo" |
| 30 | )) |
| 31 | -- c |
| 32 | obj = of_bsn_virtual_port_create_request_new(OF_VERSION_1_3); |
| 33 | of_bsn_virtual_port_create_request_xid_set(obj, 0x01020304); |
| 34 | { |
| 35 | of_object_t *vport = of_bsn_vport_l2gre_new(OF_VERSION_1_3); |
| 36 | { |
| 37 | of_port_name_t if_name = "foo"; |
| 38 | of_mac_addr_t local_mac = { { 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f } }; |
| 39 | of_mac_addr_t nh_mac = { { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 } }; |
| 40 | of_bsn_vport_l2gre_port_no_set(vport, 1); |
| 41 | of_bsn_vport_l2gre_local_mac_set(vport, local_mac); |
| 42 | of_bsn_vport_l2gre_nh_mac_set(vport, nh_mac); |
| 43 | of_bsn_vport_l2gre_src_ip_set(vport, 0xc0000002); |
| 44 | of_bsn_vport_l2gre_dst_ip_set(vport, 0xc0001002); |
| 45 | of_bsn_vport_l2gre_dscp_mode_set(vport, 0); |
| 46 | of_bsn_vport_l2gre_dscp_set(vport, 1); |
| 47 | of_bsn_vport_l2gre_ttl_set(vport, 64); |
| 48 | of_bsn_vport_l2gre_vpn_set(vport, 0xbeef); |
| 49 | of_bsn_vport_l2gre_if_name_set(vport, if_name); |
| 50 | } |
| 51 | of_bsn_virtual_port_create_request_vport_set(obj, vport); |
| 52 | of_object_delete(vport); |
| 53 | } |