blob: 7589eae44f73e0a6fbd8baf0bd51a3c018f8fea4 [file] [log] [blame]
Rich Laneb1f347d2013-05-16 16:39:12 -07001-- binary
201 0c # version / type
300 40 # length
400 00 00 04 # xid
501 # reason
600 00 00 00 00 00 00 # pad
7ff fd # desc.port_no
801 02 03 04 05 06 # desc.hw_addr
966 6f 6f 00 00 00 00 00 # desc.name
1000 00 00 00 00 00 00 00 # ...
1100 00 00 10 # desc.config
1200 00 02 00 # desc.state
1300 00 00 01 # desc.curr
1400 00 00 20 # desc.advertised
1500 00 02 00 # desc.supported
1600 00 08 00 # desc.peer
17-- python
18ofp.message.port_status(
19 xid=4,
20 reason=ofp.OFPPR_DELETE,
21 desc=ofp.port_desc(
22 port_no=ofp.OFPP_CONTROLLER,
23 hw_addr=[1,2,3,4,5,6],
24 name="foo",
25 config=ofp.OFPPC_NO_FLOOD,
26 state=ofp.OFPPS_STP_FORWARD,
27 curr=ofp.OFPPF_10MB_HD,
28 advertised=ofp.OFPPF_1GB_FD,
29 supported=ofp.OFPPF_AUTONEG,
30 peer=ofp.OFPPF_PAUSE_ASYM))
Rich Laneccae0312013-07-21 23:34:13 -070031-- c
32obj = of_port_status_new(OF_VERSION_1_0);
33{
34 of_object_t *desc = of_port_desc_new(OF_VERSION_1_0);
35 of_port_desc_advertised_set(desc, 32);
36 of_port_desc_config_set(desc, 16);
37 of_port_desc_curr_set(desc, 1);
38 {
39 of_mac_addr_t hw_addr = { { 1, 2, 3, 4, 5, 6 } };
40 of_port_desc_hw_addr_set(desc, hw_addr);
41 }
42 {
43 of_port_name_t name = "foo";
44 of_port_desc_name_set(desc, name);
45 }
46 of_port_desc_peer_set(desc, 2048);
47 of_port_desc_port_no_set(desc, 65533);
48 of_port_desc_state_set(desc, 512);
49 of_port_desc_supported_set(desc, 512);
50 of_port_status_desc_set(obj, desc);
51 of_object_delete(desc);
52}
53of_port_status_reason_set(obj, 1);
54of_port_status_xid_set(obj, 4);