blob: f813dcd2b690fd459b4de06d1c9500ff4e971ee8 [file] [log] [blame]
Rich Lane1ac43002013-12-03 12:56:35 -08001-- binary
204 04 # version, type
300 48 # length
412 34 56 78 # xid
500 5c 16 c7 # experimenter
600 00 00 2e # subtype
700 14 # table_id
800 12 # key_length
9fe dc ba 98 76 54 32 10 ff ee cc bb aa 99 88 77 # checksum
10
1100 00 # key[0].type
1200 08 # key[0].length
1300 00 00 05 # key[0].value
14
1500 01 # key[1].type
1600 0a # key[1].length
1701 23 45 67 89 ab # key[1].value
18
1900 00 # value[0].type
2000 08 # value[0].length
2100 00 00 06 # value[0].value
22
2300 01 # value[1].type
2400 0a # value[1].length
25ff ee dd cc bb aa # value[1].value
26-- python
27ofp.message.bsn_gentable_entry_add(
28 xid=0x12345678,
29 checksum=0xFEDCBA9876543210FFEECCBBAA998877,
30 table_id=20,
31 key=[
32 ofp.bsn_tlv.port(5),
33 ofp.bsn_tlv.mac([0x01, 0x23, 0x45, 0x67, 0x89, 0xab]),
34 ],
35 value=[
36 ofp.bsn_tlv.port(6),
37 ofp.bsn_tlv.mac([0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa]),
38 ])
39-- java
40builder.setXid(0x12345678)
Andreas Wundsam7c15b172014-04-24 19:02:40 -070041 .setChecksum(U128.of(0xFEDCBA9876543210L, 0xFFEECCBBAA998877L))
Andreas Wundsamd4b22692014-01-14 14:17:26 -080042 .setTableId(GenTableId.of(20))
Rich Lane1ac43002013-12-03 12:56:35 -080043 .setKey(
44 ImmutableList.<OFBsnTlv>of(
Andreas Wundsamd4b22692014-01-14 14:17:26 -080045 factory.bsnTlvs().port(OFPort.of(5)),
46 factory.bsnTlvs().mac(MacAddress.of("01:23:45:67:89:ab"))
Rich Lane1ac43002013-12-03 12:56:35 -080047 )
48 )
49 .setValue(
50 ImmutableList.<OFBsnTlv>of(
Andreas Wundsamd4b22692014-01-14 14:17:26 -080051 factory.bsnTlvs().port(OFPort.of(6)),
52 factory.bsnTlvs().mac(MacAddress.of("ff:ee:dd:cc:bb:aa"))
Rich Lane1ac43002013-12-03 12:56:35 -080053 )
54 )
55-- c
56obj = of_bsn_gentable_entry_add_new(OF_VERSION_1_3);
57of_bsn_gentable_entry_add_xid_set(obj, 0x12345678);
58of_bsn_gentable_entry_add_table_id_set(obj, 20);
59{
60 of_checksum_128_t checksum = { 0xFEDCBA9876543210L, 0xFFEECCBBAA998877L };
61 of_bsn_gentable_entry_add_checksum_set(obj, checksum);
62}
63{
64 of_object_t *list = of_list_bsn_tlv_new(OF_VERSION_1_3);
65 {
66 of_object_t *tlv = of_bsn_tlv_port_new(OF_VERSION_1_3);
67 of_bsn_tlv_port_value_set(tlv, 5);
68 of_list_append(list, tlv);
69 of_object_delete(tlv);
70 }
71 {
72 of_mac_addr_t mac = { { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab } };
73 of_object_t *tlv = of_bsn_tlv_mac_new(OF_VERSION_1_3);
74 of_bsn_tlv_mac_value_set(tlv, mac);
75 of_list_append(list, tlv);
76 of_object_delete(tlv);
77 }
78 of_bsn_gentable_entry_add_key_set(obj, list);
79 of_object_delete(list);
80}
81{
82 of_object_t *list = of_list_bsn_tlv_new(OF_VERSION_1_3);
83 {
84 of_object_t *tlv = of_bsn_tlv_port_new(OF_VERSION_1_3);
85 of_bsn_tlv_port_value_set(tlv, 6);
86 of_list_append(list, tlv);
87 of_object_delete(tlv);
88 }
89 {
90 of_mac_addr_t mac = { { 0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa } };
91 of_object_t *tlv = of_bsn_tlv_mac_new(OF_VERSION_1_3);
92 of_bsn_tlv_mac_value_set(tlv, mac);
93 of_list_append(list, tlv);
94 of_object_delete(tlv);
95 }
96 of_bsn_gentable_entry_add_value_set(obj, list);
97 of_object_delete(list);
98}