From 76ee57e223f75d5fdc0c8ad56135a02666c2bbd0 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 22 Sep 2021 14:28:54 -0700 Subject: [PATCH] shared/mgmt: Add mgmt_get_mtu This adds mgmt_get_mtu function which can be used to query the transport MTU. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- src/shared/mgmt.c | 8 ++++++++ src/shared/mgmt.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c index cec8993..41457b4 100755 --- a/src/shared/mgmt.c +++ b/src/shared/mgmt.c @@ -963,3 +963,11 @@ bool mgmt_unregister_all(struct mgmt *mgmt) return true; } + +uint16_t mgmt_get_mtu(struct mgmt *mgmt) +{ + if (!mgmt) + return 0; + + return mgmt->mtu; +} diff --git a/src/shared/mgmt.h b/src/shared/mgmt.h index 808bf4c..56add61 100755 --- a/src/shared/mgmt.h +++ b/src/shared/mgmt.h @@ -76,3 +76,5 @@ unsigned int mgmt_register(struct mgmt *mgmt, uint16_t event, uint16_t index, bool mgmt_unregister(struct mgmt *mgmt, unsigned int id); bool mgmt_unregister_index(struct mgmt *mgmt, uint16_t index); bool mgmt_unregister_all(struct mgmt *mgmt); + +uint16_t mgmt_get_mtu(struct mgmt *mgmt); -- 2.7.4