git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
[sliver-openvswitch.git]
/
lib
/
ofp-msgs.c
diff --git
a/lib/ofp-msgs.c
b/lib/ofp-msgs.c
index
00e1a84
..
47d7615
100644
(file)
--- a/
lib/ofp-msgs.c
+++ b/
lib/ofp-msgs.c
@@
-1,5
+1,5
@@
/*
/*
- * 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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-16,7
+16,6
@@
#include <config.h>
#include "ofp-msgs.h"
#include <config.h>
#include "ofp-msgs.h"
-#include <assert.h>
#include "byte-order.h"
#include "dynamic-string.h"
#include "hash.h"
#include "byte-order.h"
#include "dynamic-string.h"
#include "hash.h"
@@
-253,7
+252,7
@@
ofphdrs_decode_assert(struct ofphdrs *hdrs,
const struct ofp_header *oh, size_t length)
{
enum ofperr error = ofphdrs_decode(hdrs, oh, length);
const struct ofp_header *oh, size_t length)
{
enum ofperr error = ofphdrs_decode(hdrs, oh, length);
- assert(!error);
+
ovs_
assert(!error);
}
static bool
}
static bool
@@
-265,6
+264,7
@@
ofphdrs_is_stat(const struct ofphdrs *hdrs)
hdrs->type == OFPT10_STATS_REPLY);
case OFP11_VERSION:
case OFP12_VERSION:
hdrs->type == OFPT10_STATS_REPLY);
case OFP11_VERSION:
case OFP12_VERSION:
+ case OFP13_VERSION:
return (hdrs->type == OFPT11_STATS_REQUEST ||
hdrs->type == OFPT11_STATS_REPLY);
}
return (hdrs->type == OFPT11_STATS_REQUEST ||
hdrs->type == OFPT11_STATS_REPLY);
}
@@
-291,6
+291,7
@@
ofphdrs_len(const struct ofphdrs *hdrs)
case OFP11_VERSION:
case OFP12_VERSION:
case OFP11_VERSION:
case OFP12_VERSION:
+ case OFP13_VERSION:
if (hdrs->type == OFPT11_STATS_REQUEST ||
hdrs->type == OFPT11_STATS_REPLY) {
return (hdrs->stat == OFPST_VENDOR
if (hdrs->type == OFPT11_STATS_REQUEST ||
hdrs->type == OFPT11_STATS_REPLY) {
return (hdrs->stat == OFPST_VENDOR
@@
-414,7
+415,7
@@
ofpraw_pull_assert(struct ofpbuf *msg)
enum ofpraw raw;
error = ofpraw_pull(&raw, msg);
enum ofpraw raw;
error = ofpraw_pull(&raw, msg);
- assert(!error);
+
ovs_
assert(!error);
return raw;
}
return raw;
}
@@
-523,10
+524,10
@@
ofpraw_alloc_stats_reply(const struct ofp_header *request,
error = ofpraw_decode_partial(&request_raw, request,
ntohs(request->length));
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);
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);
}
return ofpraw_alloc_reply(reply_raw, request, extra_tailroom);
}
@@
-593,10
+594,10
@@
ofpraw_put_stats_reply(const struct ofp_header *request, struct ofpbuf *buf)
enum ofpraw raw;
error = ofpraw_decode_partial(&raw, request, ntohs(request->length));
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);
raw = ofpraw_stats_request_to_reply(raw, request->version);
- assert(raw);
+
ovs_
assert(raw);
ofpraw_put__(raw, request->version, request->xid, 0, buf);
}
ofpraw_put__(raw, request->version, request->xid, 0, buf);
}
@@
-624,7
+625,7
@@
ofpraw_put__(enum ofpraw raw, uint8_t version, ovs_be32 xid,
if (hdrs->type == OFPT_VENDOR) {
struct nicira_header *nh = buf->l2;
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
nh->vendor = htonl(hdrs->vendor);
nh->subtype = htonl(hdrs->subtype);
} else if (version == OFP10_VERSION
@@
-699,12
+700,13
@@
ofpraw_stats_request_to_reply(enum ofpraw raw, uint8_t version)
hdrs = instance->hdrs;
switch ((enum ofp_version)hdrs.version) {
case 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:
hdrs.type = OFPT10_STATS_REPLY;
break;
case OFP11_VERSION:
case OFP12_VERSION:
- assert(hdrs.type == OFPT11_STATS_REQUEST);
+ case OFP13_VERSION:
+ ovs_assert(hdrs.type == OFPT11_STATS_REQUEST);
hdrs.type = OFPT11_STATS_REPLY;
break;
default:
hdrs.type = OFPT11_STATS_REPLY;
break;
default:
@@
-712,7
+714,7
@@
ofpraw_stats_request_to_reply(enum ofpraw raw, uint8_t version)
}
error = ofpraw_from_ofphdrs(&reply_raw, &hdrs);
}
error = ofpraw_from_ofphdrs(&reply_raw, &hdrs);
- assert(!error);
+
ovs_
assert(!error);
return reply_raw;
}
return reply_raw;
}
@@
-863,7
+865,7
@@
ofpmp_postappend(struct list *replies, size_t start_ofs)
{
struct ofpbuf *msg = ofpbuf_from_list(list_back(replies));
{
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),
if (msg->size > UINT16_MAX) {
size_t len = msg->size - start_ofs;
memcpy(ofpmp_append(replies, len),
@@
-880,6
+882,7
@@
ofpmp_flags__(const struct ofp_header *oh)
return &((struct ofp10_stats_msg *) oh)->flags;
case OFP11_VERSION:
case OFP12_VERSION:
return &((struct ofp10_stats_msg *) oh)->flags;
case OFP11_VERSION:
case OFP12_VERSION:
+ case OFP13_VERSION:
return &((struct ofp11_stats_msg *) oh)->flags;
default:
NOT_REACHED();
return &((struct ofp11_stats_msg *) oh)->flags;
default:
NOT_REACHED();
@@
-912,14
+915,14
@@
raw_info_get(enum ofpraw raw)
{
ofpmsgs_init();
{
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)
{
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];
}
return &info->instances[version - info->min_version];
}