blob: e56705fd33cb58970e3bb240b50980e23e0f47f3 [file] [log] [blame]
Rich Lanec9fc57d2013-05-16 16:39:12 -07001-- binary
204 0c # version, type
300 50 # length
412 34 56 78 # xid
502 # reason
600 00 00 00 00 00 00 # pad
700 00 00 04 # port_no
800 00 00 00 # pad
901 02 03 04 05 06 # hw_addr
1000 00 # pad
1166 6f 6f 00 00 00 00 00 # name
1200 00 00 00 00 00 00 00 # ...
1300 00 00 24 # config
1400 00 00 02 # state
1500 00 00 01 # curr
1600 00 00 02 # advertised
1700 00 00 04 # supported
1800 00 00 08 # peer
1900 00 00 0a # curr_speed
2000 00 00 14 # max_speed
21-- python
22ofp.message.port_status(
23 xid=0x12345678,
24 reason=ofp.OFPPR_MODIFY,
25 desc=ofp.port_desc(
26 port_no=4,
27 hw_addr=[1,2,3,4,5,6],
28 name="foo",
29 config=ofp.OFPPC_NO_FWD|ofp.OFPPC_NO_RECV,
30 state=ofp.OFPPS_BLOCKED,
31 curr=ofp.OFPPF_10MB_HD,
32 advertised=ofp.OFPPF_10MB_FD,
33 supported=ofp.OFPPF_100MB_HD,
34 peer=ofp.OFPPF_100MB_FD,
35 curr_speed=10,
36 max_speed=20))
Rich Lane20839732014-10-15 22:36:08 -070037-- c
38obj = of_port_status_new(OF_VERSION_1_3);
39of_port_status_xid_set(obj, 0x12345678);
40of_port_status_reason_set(obj, OF_PORT_CHANGE_REASON_MODIFY);
41{
42 of_object_t desc;
43 of_port_status_desc_bind(obj, &desc);
44 of_port_desc_port_no_set(&desc, 4);
45 of_mac_addr_t hw_addr = { { 1, 2, 3, 4, 5, 6 } };
46 of_port_desc_hw_addr_set(&desc, hw_addr);
47 of_port_name_t name = "foo";
48 of_port_desc_name_set(&desc, name);
49 of_port_desc_config_set(&desc, OF_PORT_CONFIG_FLAG_NO_FWD|OF_PORT_CONFIG_FLAG_NO_RECV);
50 of_port_desc_state_set(&desc, OF_PORT_STATE_FLAG_BLOCKED);
51 of_port_desc_curr_set(&desc, OF_PORT_FEATURE_FLAG_10MB_HD);
52 of_port_desc_advertised_set(&desc, OF_PORT_FEATURE_FLAG_10MB_FD);
53 of_port_desc_supported_set(&desc, OF_PORT_FEATURE_FLAG_100MB_HD);
54 of_port_desc_peer_set(&desc, OF_PORT_FEATURE_FLAG_100MB_FD);
55 of_port_desc_curr_speed_set(&desc, 10);
56 of_port_desc_max_speed_set(&desc, 20);
57}