set network byte order for master-subagent communication

I can’t find a way with the latest sources to set the network byte order.

If I look at the agentx++ subagent.cpp example, the earliest moment I can set the network byte order is after the call of “mib-init()”, but that’s too late since in this call, data is already sent with the default network byte order.

Temporarily, I added a “bool sessionNetworkByteOrder” and the method “set_session_byte_order(bool)” to the class SubAgentXMib. This bool is initialized in the contructors to false. In “AgentXSession* SubAgentXMib::create_session()”, I added “s->set_byte_order(sessionNetworkByteOrder);” In the subagent example, I call “mib->set_session_byte_order(false);” after “mib = new SubAgentXMib();”, so before “mib->init()”.

I don’t know if there is another solution or this doesn’t cover everything, but this seems to work.

The idea of the SubAgentX MIB class was, that if you want to modify the network-byte-order you overwrite the create_session() method in a subclass.
Which operating system are you using so that the default order isn’t optimal?

Thank you for the suggestion to subclass (didn’t think of that).

Our master and subagent run on different boards, both linux as OS.
In the agentx RFC documents, it seems they recommend the default order only when master and subagent run on the same OS.