/*
- * Copyright (c) 2012 Nicira, Inc.
+ * Copyright (c) 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <config.h>
#include "ofp-msgs.h"
-#include <assert.h>
#include "byte-order.h"
#include "dynamic-string.h"
#include "hash.h"
const struct ofp_header *oh, size_t length)
{
enum ofperr error = ofphdrs_decode(hdrs, oh, length);
- assert(!error);
+ ovs_assert(!error);
}
static bool
enum ofpraw raw;
error = ofpraw_pull(&raw, msg);
- assert(!error);
+ ovs_assert(!error);
return raw;
}
error = ofpraw_decode_partial(&request_raw, request,
ntohs(request->length));
- assert(!error);
+ ovs_assert(!error);
reply_raw = ofpraw_stats_request_to_reply(request_raw, request->version);
- assert(reply_raw);
+ ovs_assert(reply_raw);
return ofpraw_alloc_reply(reply_raw, request, extra_tailroom);
}
enum ofpraw raw;
error = ofpraw_decode_partial(&raw, request, ntohs(request->length));
- assert(!error);
+ ovs_assert(!error);
raw = ofpraw_stats_request_to_reply(raw, request->version);
- assert(raw);
+ ovs_assert(raw);
ofpraw_put__(raw, request->version, request->xid, 0, buf);
}
if (hdrs->type == OFPT_VENDOR) {
struct nicira_header *nh = buf->l2;
- assert(hdrs->vendor == NX_VENDOR_ID);
+ ovs_assert(hdrs->vendor == NX_VENDOR_ID);
nh->vendor = htonl(hdrs->vendor);
nh->subtype = htonl(hdrs->subtype);
} else if (version == OFP10_VERSION
hdrs = instance->hdrs;
switch ((enum ofp_version)hdrs.version) {
case OFP10_VERSION:
- assert(hdrs.type == OFPT10_STATS_REQUEST);
+ ovs_assert(hdrs.type == OFPT10_STATS_REQUEST);
hdrs.type = OFPT10_STATS_REPLY;
break;
case OFP11_VERSION:
case OFP12_VERSION:
case OFP13_VERSION:
- assert(hdrs.type == OFPT11_STATS_REQUEST);
+ ovs_assert(hdrs.type == OFPT11_STATS_REQUEST);
hdrs.type = OFPT11_STATS_REPLY;
break;
default:
}
error = ofpraw_from_ofphdrs(&reply_raw, &hdrs);
- assert(!error);
+ ovs_assert(!error);
return reply_raw;
}
{
struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
- assert(start_ofs <= UINT16_MAX);
+ ovs_assert(start_ofs <= UINT16_MAX);
if (msg->size > UINT16_MAX) {
size_t len = msg->size - start_ofs;
memcpy(ofpmp_append(replies, len),
{
ofpmsgs_init();
- assert(raw < ARRAY_SIZE(raw_infos));
+ ovs_assert(raw < ARRAY_SIZE(raw_infos));
return &raw_infos[raw];
}
static struct raw_instance *
raw_instance_get(const struct raw_info *info, uint8_t version)
{
- assert(version >= info->min_version && version <= info->max_version);
+ ovs_assert(version >= info->min_version && version <= info->max_version);
return &info->instances[version - info->min_version];
}