Reconstructing OpenFlow Packets in Matlab

Hello Matlab Community
I am new to using Matlab. I am actually having hard time writing codes that are written in C and converting them to Matlab. I have heard about MEX files, that makes C codes work in Matlab. However, I don't know if this will be of any use to my needs.
I am building certain types of packets used in OpenFlow Protocol (related to SDN) using Matlab, I am in need to know how should I build Structs written in C into Matlab?
An example
/* Header on all OpenFlow packets. */
struct ofp_header {
uint8_t version; /* OFP_VERSION. */
uint8_t type; /* One of the OFPT_ constants. */
uint16_t length; /* Length including this ofp_header. */
uint32_t xid; /* Transaction id associated with this packet. Replies use the same id as was in the request to facilitate pairing. */
};
How should I construct such a packet then call a function/method to create it with desired payloads and such?
I am not asking someone to do my work. All in need is a bit of help to keep moving forward.
Thank you!

Answers (0)

Categories

Find more on Language Fundamentals in Help Center and File Exchange

Asked:

on 19 Jun 2017

Edited:

on 19 Jun 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!