Esa_Main()

Abstract

Performs low-level initialization and optionally starts the cosimulation code.

Syntax

Esa_Main (argc, argv, options)
Argument Type Description
argc int size of argv array
argv char ** array of string arguments, typically as provided to main() entry point.
options int one of:
- ESAC_OPTS_NONE—no special options
- ESAC_MAIN_OPTS_CALL—look for and invoke esa_main (see Details)

Return Type

int

Cosim-defined value returned by esa_main(), if invoked, or 1 if esa_main() is not invoked.

esa.h

Details

This function is a pre-initialization routine used to do immediate actions while leaving the bulk of the initialization to Esa_Init().

A Riverbed analysis software simulation can run in either “dynamic” mode (using op_runsim to load a repository) or “static” mode (using op_mksim to create an executable). The same applies to a cosimulation. In addition, we also have the relationship between the Riverbed analysis software and the cosimulation code. One provides the main() entry point and will thus somehow invoke the other.

Case 1—main() supplied by Riverbed Modeler

In this case, Esa_Main() is invoked with options set to ESAC_MAIN_OPTS_CALL. The cosimulation code should be linked in. A function named esa_main() is looked for and invoked after a set of low-level Riverbed Modeler initializations.

Case 2—main() supplied by cosimulation

In this case, the main() function should invoke Esa_Main() as early as possible. After the core ESA initializations are performed, one of two things happens:

  • If options is set to ESAC_MAIN_OPTS_CALL, a function named esa_main() is looked for and, if found, invoked. Esa_Main() will return only after esa_main() returns.
  • If options is set to ESAC_OPTS_NONE, Esa_Main() returns immediately after the initialization is complete.

If an esa_main() routine is invoked, it should call Esa_Init(), Esa_Load(), and so on. If no esa_main() routine is invoked, the code that called Esa_Main() must then call Esa_Init(), Esa_Load(), and so on.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com