From f8e71bfb83160a95d2ec6ca53bf55e6f821593e9 Mon Sep 17 00:00:00 2001 From: Hongliang Liu <75655411+hongliangl@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:36:44 +0800 Subject: [PATCH] Add const MSG_MAX_LEN, the max size of Openflow message (#56) This constant represents the maximum size of an OpenFlow message in bytes. It can be utilized by other projects using this library. Signed-off-by: Hongliang Liu --- VERSION | 2 +- openflow15/openflow15.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6345c21..4a29f93 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.13.0 +v0.14.0 diff --git a/openflow15/openflow15.go b/openflow15/openflow15.go index 8395969..fd58f47 100644 --- a/openflow15/openflow15.go +++ b/openflow15/openflow15.go @@ -23,6 +23,12 @@ const ( VERSION = 6 ) +const ( + // Referring to page 43 in https://opennetworking.org/wp-content/uploads/2014/10/openflow-switch-v1.5.1.pdf, + // an OpenFlow message size can reach up to 64KB. + MSG_MAX_LEN = 0xffff +) + // Returns a new OpenFlow header with version field set to v1.5. var NewOfp15Header func() common.Header = common.NewHeaderGenerator(VERSION)