Rich Lane | 9a3f1fd | 2013-05-10 16:29:17 -0700 | [diff] [blame] | 1 | -- binary |
| 2 | ff fd # port_no |
| 3 | 01 02 03 04 05 06 # hw_addr |
| 4 | 66 6f 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 # name |
| 5 | 00 00 00 10 # config |
| 6 | 00 00 02 00 # state |
| 7 | 00 00 00 01 # curr |
| 8 | 00 00 00 20 # advertised |
| 9 | 00 00 02 00 # supported |
| 10 | 00 00 08 00 # peer |
| 11 | -- python |
| 12 | ofp.port_desc( |
| 13 | port_no=ofp.OFPP_CONTROLLER, |
| 14 | hw_addr=[1,2,3,4,5,6], |
| 15 | name="foo", |
| 16 | config=ofp.OFPPC_NO_FLOOD, |
| 17 | state=ofp.OFPPS_STP_FORWARD, |
| 18 | curr=ofp.OFPPF_10MB_HD, |
| 19 | advertised=ofp.OFPPF_1GB_FD, |
| 20 | supported=ofp.OFPPF_AUTONEG, |
| 21 | peer=ofp.OFPPF_PAUSE_ASYM) |
Rich Lane | ccae031 | 2013-07-21 23:34:13 -0700 | [diff] [blame^] | 22 | -- c |
| 23 | obj = of_port_desc_new(OF_VERSION_1_0); |
| 24 | of_port_desc_advertised_set(obj, 32); |
| 25 | of_port_desc_config_set(obj, 16); |
| 26 | of_port_desc_curr_set(obj, 1); |
| 27 | { |
| 28 | of_mac_addr_t hw_addr = { { 1, 2, 3, 4, 5, 6 } }; |
| 29 | of_port_desc_hw_addr_set(obj, hw_addr); |
| 30 | } |
| 31 | { |
| 32 | of_port_name_t name = "foo"; |
| 33 | of_port_desc_name_set(obj, name); |
| 34 | } |
| 35 | of_port_desc_peer_set(obj, 2048); |
| 36 | of_port_desc_port_no_set(obj, 65533); |
| 37 | of_port_desc_state_set(obj, 512); |
| 38 | of_port_desc_supported_set(obj, 512); |