Improve RecordVal JSON formatting

No need to create a record introspection table each time when all
the required information can be obtained directly in the RecordVal
and RecordType objects.  Besides the additional overhead, using such
a table will re-order the fields arbitrarily instead of using the
order in which they're defined.
This commit is contained in:
Jon Siwek 2019-09-30 19:04:55 -07:00
parent d258ebe5ca
commit a34ade4876
4 changed files with 25 additions and 24 deletions

View file

@ -1,22 +1,22 @@
http://127.0.0.1:8080/stats/flowentry/clear/42
http://127.0.0.1:8080/stats/flowentry/add
{"priority":0,"idle_timeout":0,"hard_timeout":0,"match":{},"actions":[{"port":3,"type":"OUTPUT"},{"port":7,"type":"OUTPUT"}],"cookie":4398046511105,"flags":0,"dpid":42}
{"dpid":42,"cookie":4398046511105,"idle_timeout":0,"hard_timeout":0,"priority":0,"flags":0,"match":{},"actions":[{"type":"OUTPUT","port":3},{"type":"OUTPUT","port":7}]}
Flow_mod_success
http://127.0.0.1:8080/stats/flowentry/add
{"priority":5,"idle_timeout":30,"hard_timeout":0,"match":{"nw_dst":"74.53.140.153/32","tp_dst":25,"tp_src":1470,"nw_proto":6,"dl_type":2048,"nw_src":"10.10.1.4/32"},"actions":[],"cookie":4398046511146,"flags":0,"dpid":42}
{"dpid":42,"cookie":4398046511146,"idle_timeout":30,"hard_timeout":0,"priority":5,"flags":0,"match":{"dl_type":2048,"nw_proto":6,"nw_src":"10.10.1.4/32","nw_dst":"74.53.140.153/32","tp_src":1470,"tp_dst":25},"actions":[]}
http://127.0.0.1:8080/stats/flowentry/add
{"priority":5,"idle_timeout":30,"hard_timeout":0,"match":{"nw_dst":"10.10.1.4/32","tp_dst":1470,"tp_src":25,"nw_proto":6,"dl_type":2048,"nw_src":"74.53.140.153/32"},"actions":[],"cookie":4398046511146,"flags":0,"dpid":42}
{"dpid":42,"cookie":4398046511146,"idle_timeout":30,"hard_timeout":0,"priority":5,"flags":0,"match":{"dl_type":2048,"nw_proto":6,"nw_src":"74.53.140.153/32","nw_dst":"10.10.1.4/32","tp_src":25,"tp_dst":1470},"actions":[]}
Flow_mod_success
Flow_mod_success
http://127.0.0.1:8080/stats/flowentry/add
{"priority":5,"idle_timeout":30,"hard_timeout":0,"match":{"nw_dst":"192.168.133.102/32","tp_dst":25,"tp_src":49648,"nw_proto":6,"dl_type":2048,"nw_src":"192.168.133.100/32"},"actions":[],"cookie":4398046511146,"flags":0,"dpid":42}
{"dpid":42,"cookie":4398046511146,"idle_timeout":30,"hard_timeout":0,"priority":5,"flags":0,"match":{"dl_type":2048,"nw_proto":6,"nw_src":"192.168.133.100/32","nw_dst":"192.168.133.102/32","tp_src":49648,"tp_dst":25},"actions":[]}
http://127.0.0.1:8080/stats/flowentry/add
{"priority":5,"idle_timeout":30,"hard_timeout":0,"match":{"nw_dst":"192.168.133.100/32","tp_dst":49648,"tp_src":25,"nw_proto":6,"dl_type":2048,"nw_src":"192.168.133.102/32"},"actions":[],"cookie":4398046511146,"flags":0,"dpid":42}
{"dpid":42,"cookie":4398046511146,"idle_timeout":30,"hard_timeout":0,"priority":5,"flags":0,"match":{"dl_type":2048,"nw_proto":6,"nw_src":"192.168.133.102/32","nw_dst":"192.168.133.100/32","tp_src":25,"tp_dst":49648},"actions":[]}
Flow_mod_success
Flow_mod_success
http://127.0.0.1:8080/stats/flowentry/add
{"priority":5,"idle_timeout":30,"hard_timeout":0,"match":{"nw_dst":"17.167.150.73/32","tp_dst":443,"tp_src":49655,"nw_proto":6,"dl_type":2048,"nw_src":"192.168.133.100/32"},"actions":[],"cookie":4398046511146,"flags":0,"dpid":42}
{"dpid":42,"cookie":4398046511146,"idle_timeout":30,"hard_timeout":0,"priority":5,"flags":0,"match":{"dl_type":2048,"nw_proto":6,"nw_src":"192.168.133.100/32","nw_dst":"17.167.150.73/32","tp_src":49655,"tp_dst":443},"actions":[]}
http://127.0.0.1:8080/stats/flowentry/add
{"priority":5,"idle_timeout":30,"hard_timeout":0,"match":{"nw_dst":"192.168.133.100/32","tp_dst":49655,"tp_src":443,"nw_proto":6,"dl_type":2048,"nw_src":"17.167.150.73/32"},"actions":[],"cookie":4398046511146,"flags":0,"dpid":42}
{"dpid":42,"cookie":4398046511146,"idle_timeout":30,"hard_timeout":0,"priority":5,"flags":0,"match":{"dl_type":2048,"nw_proto":6,"nw_src":"17.167.150.73/32","nw_dst":"192.168.133.100/32","tp_src":443,"tp_dst":49655},"actions":[]}
Flow_mod_success
Flow_mod_success