1

I tried the following code in OPNET Modeler 14.5

Objid addr_info_attr_objid;
char address_string[128];
addr_info_attr_objid = op_id_self();
op_ima_obj_attr_get(addr_info_attr_objid, "Address", address_string);

to get the node IP Address but it gives this error message:

<<<Recoverable Error>>>
Attribute name(Address) is unrecognizzed for object(542)
General Failure
  • 2,421
  • 4
  • 23
  • 49
ELMasry
  • 11
  • 1
  • Also, i tried to use op_ima_obj_attr_get_str ( Objid_node , "Address", IPC_OBJTYPE_MOB , node_address); – ELMasry Jan 21 '16 at 05:31

1 Answers1

0

You have to find the proper IP interface First. Based on your code, it is not right way to get IP address of one-interface node, such as Server/Client model.

Here is sample code

op_ima_obj_attr_get(ip_moudle_objid, "IP Router Parameters [0].Interface Information [3].Address", &address_str);
Allen Kim
  • 71
  • 2