shared/mgmt: Add mgmt_get_mtu
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 22 Sep 2021 21:28:54 +0000 (14:28 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:37 +0000 (19:08 +0530)
This adds mgmt_get_mtu function which can be used to query the
transport MTU.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/shared/mgmt.c
src/shared/mgmt.h

index cec8993..41457b4 100755 (executable)
@@ -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;
+}
index 808bf4c..56add61 100755 (executable)
@@ -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);