15 #include "rofl/common/croflexception.h"
16 #include "rofl/common/cmemory.h"
17 #include "rofl/common/openflow/cofmatch.h"
87 #define ofs_body ofs_ofsu.ofsu_body
90 #define ofs_desc_reply ofs_ofsu.ofsu_desc_reply
91 #define ofs_flow_stats_request ofs_ofsu.ofsu_flow_stats_request
92 #define ofs_flow_stats ofs_ofsu.ofsu_flow_stats_reply
93 #define ofs_aggr_stats_request ofs_ofsu.ofsu_aggr_stats_request
94 #define ofs_aggr_stats ofs_ofsu.ofsu_aggr_stats_reply
96 #define ofs_table_stats ofs_ofsu.ofsu_table_stats_reply
97 #define ofs_port_stats_request ofs_ofsu.ofsu_port_stats_request
98 #define ofs_port_stats ofs_ofsu.ofsu_port_stats_reply
99 #define ofs_queue_stats_request ofs_ofsu.ofsu_queue_stats_request
100 #define ofs_queue_stats ofs_ofsu.ofsu_queue_stats_reply
101 #define ofs_group_stats_request ofs_ofsu.ofsu_group_stats_request
102 #define ofs_group_stats ofs_ofsu.ofsu_group_stats_reply
104 #define ofs_group_desc_stats ofs_ofsu.ofsu_group_desc_stats_reply
106 #define ofs_group_features_stats ofs_ofsu.ofsu_group_features_stats_reply
108 #define ofs_experimenter_stats ofs_ofsu.ofsu_expr_stats_header
111 #define OFS_FLOW_STATS_STATIC_HDR_LEN 32 // without struct ofp_match
112 #define OFS_AGGR_STATS_STATIC_HDR_LEN 32 // without struct ofp_match
171 cofstats(OFS_FLOW_STATS_STATIC_HDR_LEN)
186 return (body.
memlen() + match.length());
196 match.pack(packed.
somem() + body.
memlen(), match.length());
211 cofstats(sizeof(struct openflow12::ofp_flow_stats))
236 cofstats(OFS_AGGR_STATS_STATIC_HDR_LEN)
241 cofstats(OFS_AGGR_STATS_STATIC_HDR_LEN)
256 return (body.
memlen() + match.length());
266 match.pack(packed.
somem() + body.
memlen(), match.length());
273 unpack(uint8_t *buf,
size_t buflen)
throw (eOFstatsTooShort)
275 if (buflen <
sizeof(
struct openflow12::ofp_aggregate_stats_request))
277 throw eOFstatsTooShort();
279 body.
assign(buf, OFS_AGGR_STATS_STATIC_HDR_LEN);
280 ofs_aggr_stats_request = (
struct openflow12::ofp_aggregate_stats_request*)body.
somem();
282 match.unpack(buf + OFS_AGGR_STATS_STATIC_HDR_LEN,
283 buflen - OFS_AGGR_STATS_STATIC_HDR_LEN);
292 std::stringstream ss;
293 info.assign(vas(
"cofstats_aggregate_request(%p) table-id: %d out_port: 0x%x out_group: 0x%x "
294 "cookie: 0x%llx cookie-mask: 0x%llx ",
296 ofs_aggr_stats_request->table_id,
297 be32toh(ofs_aggr_stats_request->out_port),
298 be32toh(ofs_aggr_stats_request->out_group),
299 be64toh(ofs_aggr_stats_request->cookie),
300 be64toh(ofs_aggr_stats_request->cookie_mask)));
317 cofstats(sizeof(struct openflow12::ofp_aggregate_stats_reply))
cofstats_aggregate_request()
Definition: cofstats.h:235
Definition: openflow12.h:1391
cofstats_aggregate_reply()
Definition: cofstats.h:316
Definition: cofstats.h:26
Definition: openflow12.h:1466
cofstats_flow_request()
Definition: cofstats.h:170
Definition: openflow12.h:1491
cofstats_flow_reply()
Definition: cofstats.h:210
virtual ~cofstats_aggregate_request()
Definition: cofstats.h:249
Definition: openflow12.h:1649
size_t memlen() const
Returns length of allocated memory area.
Definition: cmemory.cc:109
Definition: openflow12.h:1426
Definition: cofstats.h:23
uint8_t * somem() const
Returns pointer to start of allocated memory area.
Definition: cmemory.cc:101
Definition: openflow12.h:1505
Definition: cofmatch.h:35
Definition: openflow12.h:1529
virtual ~cofstats_flow_reply()
Definition: cofstats.h:219
Definition: openflow12.h:1370
Definition: openflow12.h:1328
virtual uint8_t * resize(size_t len)
Resizes allocated memory area by calling C-function realloc().
Definition: cmemory.cc:253
Definition: cofstats.h:225
Definition: openflow12.h:1349
Definition: cofstats.h:163
Definition: cofstats.h:203
C++ abstraction for malloc'ed memory areas.
Definition: cmemory.h:44
Definition: openflow12.h:1318
Definition: cofstats.h:309
Definition: openflow12.h:1519
virtual void assign(uint8_t *buf, size_t buflen)
Overwrites memory area with plain buffer specified. Resizes internal memory as necessary.
Definition: cmemory.cc:241
Definition: cofstats.h:22
Definition: openflow12.h:1655
virtual ~cofstats_flow_request()
Definition: cofstats.h:179
Definition: openflow12.h:1455
virtual ~cofstats_aggregate_reply()
Definition: cofstats.h:325
Definition: croflexception.h:27