[AGENT++] Configurable OID - templates

Pierre Pacchioni ppacch at yahoo.com
Fri Jul 21 15:55:17 CEST 2006


Hello,

Based on Frank's answer we made the two templates (based on the existing
templates/agent++v3.5.17: h_code.vm and cpp_code.vm)
Basically for the .h the result should look like to:

// Scalars
extern Oid oidUnemTrapSequenceNumber;
extern Oid oidNeNumber;
...
// Columns
extern Oid oidNeFamily;
extern Oid colNeFamily;
extern Oid oidNeIndex;
...
// Tables
extern Oid oidNeEntry;
extern int nNeFamily;
extern int cNeFamily;
...
// Notifications
extern Oid oidAlarmRaisedTrap;
extern Oid oidAlarmAckedTrap;

class UNEM_MIB_DECL InitOid
{
 public:
  static void init_oid();
};

And for the cpp file:

// Scalars
Oid oidUnemTrapSequenceNumber;
Oid oidNeNumber;
Oid oidCardNumber;
...
// Columns
Oid oidNeFamily;
Oid colNeFamily("1");
Oid oidNeIndex;
...
// Tables
Oid oidNeEntry;
int nNeFamily=0;
int cNeFamily=1;
...
// Notifications
Oid oidAlarmRaisedTrap;
Oid oidAlarmAckedTrap;


void
InitOid::init_oid()
{
  Oid rootOid("1.3.6.1.4.1.21696.93.1");
  
//--AgentGen BEGIN=InitOid::init_oid
//--AgentGen END

// Scalars
  oidUnemTrapSequenceNumber = rootOid + "1.4.0";
  oidNeNumber = rootOid + "2.2.0";
  oidCardNumber = rootOid + "3.2.0";

// Columns
  oidNeFamily = rootOid + "2.1.1.1";
  ...
}

Of course it is necessary to call this init method inside the agent.cpp main.
The dft rootOid is set to the OID of the MODULE-IDENTITY,

Also to keep think clean we created a new directory under the templates
directory: agent++v3.5.17_conf_oid and we also created a new project.

Feel free to use these templates if you need to and give us some feedback,
Thanks and Regards,
Pierre.


More information about the AGENTPP mailing list