#include "in-band.h"
#include "odp-util.h"
#include "ofp-actions.h"
+#include "ofp-msgs.h"
#include "ofp-util.h"
#include "ofpbuf.h"
#include "ofproto-provider.h"
static struct vlog_rate_limit err_rl = VLOG_RATE_LIMIT_INIT(10, 10);
if (!VLOG_DROP_INFO(&err_rl)) {
- const struct ofputil_msg_type *type;
const char *type_name;
size_t request_len;
+ enum ofpraw raw;
request_len = ntohs(request->length);
- type_name = (!ofputil_decode_msg_type_partial(request,
- MIN(64, request_len),
- &type)
- ? ofputil_msg_type_name(type)
+ type_name = (!ofpraw_decode_partial(&raw, request,
+ MIN(64, request_len))
+ ? ofpraw_get_name(raw)
: "invalid");
VLOG_INFO("%s: sending %s error reply to %s message",
ofconn_send(const struct ofconn *ofconn, struct ofpbuf *msg,
struct rconn_packet_counter *counter)
{
- update_openflow_length(msg);
+ ofpmsg_update_length(msg);
rconn_send(ofconn->rconn, msg, counter);
}
\f
COVERAGE_INC(ofmonitor_pause);
ofconn->monitor_paused = monitor_seqno++;
- make_nxmsg_xid(sizeof(struct nicira_header),
- NXT_FLOW_MONITOR_PAUSED, htonl(0), &pause);
+ pause = ofpraw_alloc_xid(OFPRAW_NXT_FLOW_MONITOR_PAUSED,
+ OFP10_VERSION, htonl(0), 0);
ofconn_send(ofconn, pause, ofconn->monitor_counter);
}
}
static void
ofmonitor_resume(struct ofconn *ofconn)
{
- struct ofpbuf *resume;
+ struct ofpbuf *resumed;
struct ofmonitor *m;
struct list rules;
struct list msgs;
list_init(&msgs);
ofmonitor_compose_refresh_updates(&rules, &msgs);
- make_nxmsg_xid(sizeof(struct nicira_header),
- NXT_FLOW_MONITOR_RESUMED, htonl(0), &resume);
- list_push_back(&msgs, &resume->list_node);
+ resumed = ofpraw_alloc_xid(OFPRAW_NXT_FLOW_MONITOR_RESUMED, OFP10_VERSION,
+ htonl(0), 0);
+ list_push_back(&msgs, &resumed->list_node);
ofconn_send_replies(ofconn, &msgs);
ofconn->monitor_paused = 0;