aboutsummaryrefslogtreecommitdiff
path: root/lib/stream.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-07-19 23:23:17 -0700
committerBen Pfaff <blp@nicira.com>2012-07-30 21:09:12 -0700
commit982697a4d24caa0a3bdaf85db67619338b382e50 (patch)
tree028e7fd69f9f836f2785b5096d78eb8046568a80 /lib/stream.c
parent4b3b8d8fa14bbe4000c6591eef74e0a0d51a3929 (diff)
ofp-msgs: New approach to encoding and decoding OpenFlow headers.
OpenFlow headers are not as uniform as they could be, with size, alignment, and numbering changes from one version to another and across varieties (e.g. ordinary messages vs. "stats" messages). Until now the Open vSwitch internal APIs haven't done a good job of abstracting those differences in header formats. This commit changes that; from this commit forward very little code actually needs to understand the header format or numbering. Instead, it can just encode or decode, or pull or put, the header using a more abstract API using the ofpraw_, ofptype_, and other APIs in the new ofp-msgs module. Signed-off-by: Ben Pfaff <blp@nicira.com> Tested-by: Simon Horman <horms@verge.net.au> Reviewed-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'lib/stream.c')
-rw-r--r--lib/stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/stream.c b/lib/stream.c
index 271f16b9..2c7bfc3a 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -778,7 +778,7 @@ stream_guess_content(const uint8_t *data, ssize_t size)
return STREAM_SSL;
case PAIR('{', '"'):
return STREAM_JSONRPC;
- case PAIR(OFP10_VERSION, OFPT_HELLO):
+ case PAIR(OFP10_VERSION, 0 /* OFPT_HELLO */):
return STREAM_OPENFLOW;
}
}