Skip to content

Commit 02150d8

Browse files
authored
Added support for openflow 1.5. (#13)
* Added package openflow15 which implements the Openflow 1.5 protocol Marshal and Unmarshal functions. * Added the unit test (openflow15_test.go) file to test the Marshal/ Unmarshal of every Openflow 1.5 message. * Modified the README.md file to include support of Openflow 1.5. * Updated the VERSION file. Signed-off-by: Ashish Varma <[email protected]>
1 parent 673ded7 commit 02150d8

23 files changed

+18361
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# libOpenflow
22

3-
This library implements Openflow 1.3 protocol encapsulation and decapsulation.
3+
This library implements Openflow 1.3 and Openflow 1.5 protocol encapsulation and decapsulation.
44

55
This repository is a fork of
66
[contiv/libOpenflow](https://github.com/contiv/libOpenflow), used by Antrea, as

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.7.1
1+
v0.8.0

common/header.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"sync/atomic"
99

1010
"antrea.io/libOpenflow/util"
11+
12+
log "github.com/sirupsen/logrus"
1113
)
1214

1315
var messageXid uint32 = 1
@@ -60,6 +62,8 @@ func (h *Header) UnmarshalBinary(data []byte) error {
6062
h.Type = data[1]
6163
h.Length = binary.BigEndian.Uint16(data[2:4])
6264
h.Xid = binary.BigEndian.Uint32(data[4:8])
65+
66+
log.Debugf("Header: %+v", h)
6367
return nil
6468
}
6569

@@ -118,8 +122,8 @@ func NewHelloElemVersionBitmap() *HelloElemVersionBitmap {
118122
h := new(HelloElemVersionBitmap)
119123
h.HelloElemHeader = *NewHelloElemHeader()
120124
h.Bitmaps = make([]uint32, 0)
121-
// 10010 meaning openflow 1.0 & 1.3 support
122-
h.Bitmaps = append(h.Bitmaps, uint32(1<<4)|uint32(1<<1))
125+
// 0100 0010 meaning openflow 1.0 & 1.5 support
126+
h.Bitmaps = append(h.Bitmaps, uint32(1<<6)|uint32(1<<1))
123127
h.Length = h.Length + uint16(len(h.Bitmaps)*4)
124128
return h
125129
}

openflow13/action.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"antrea.io/libOpenflow/util"
88
)
99

10-
// ofp_action_type 1.3
10+
// ofp_action_type
1111
const (
1212
ActionType_Output = 0
1313
ActionType_CopyTtlOut = 11

0 commit comments

Comments
 (0)