From 19f632896d0eb434db8bd476bbd9f1b726f13b52 Mon Sep 17 00:00:00 2001 From: Hongliang Liu Date: Tue, 6 Feb 2024 14:23:06 +0800 Subject: [PATCH] Add const OFP_MESSAGE_MAX_SIZE, the max size of Openflow message 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..b561134 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.13.0 +v0.13.1 diff --git a/openflow15/openflow15.go b/openflow15/openflow15.go index 8395969..3ec6fcb 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 = 64 * 1024 +) + // Returns a new OpenFlow header with version field set to v1.5. var NewOfp15Header func() common.Header = common.NewHeaderGenerator(VERSION)