corba.idl
上传用户:aonuowh
上传日期:2021-05-23
资源大小:35390k
文件大小:10k
源码类别:

SNMP编程

开发平台:

C/C++

  1. /* $Id: corba.idl,v 1.5 2002/05/01 10:29:21 mahesh Exp $ */
  2. /*
  3.  * @(#) corba.idl 
  4.  * Copyright (c) 1999 Adventnet, Inc. All Rights Reserved.
  5.  * Please read the associated COPYRIGHTS file for more details.
  6.  *
  7.  * ADVENTNET, INC. MAKES NO REPRESENTATIONS OR WARRANTIES  ABOUT THE
  8.  * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
  9.  BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
  10.  * FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.  ADVENTNET, INC. SHALL
  11.  * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF
  12.  * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE  OR ITS DERIVATIVES.
  13.  */                                
  14. #pragma javaPackage "com.adventnet.snmp"
  15. module corba
  16. {
  17. typedef sequence<string> stringSeq;
  18. typedef sequence<stringSeq> stringMatrix;
  19. typedef sequence<octet> octetSeq;
  20. exception SnmpException
  21. {
  22. string reason;
  23. };
  24. struct RequestEvent
  25. {
  26. stringSeq values;
  27. stringSeq objectNames;
  28. octet requestType;
  29. long reqid;
  30. stringSeq varBinds;
  31. string error;
  32. };
  33. struct ResultEvent
  34. {
  35. stringSeq response;
  36. string error;
  37. };
  38. struct TableEvent
  39. {
  40. long startRow;
  41. long endRow;
  42. long Type;
  43. long column;
  44. string error;
  45. };
  46. struct TrapEvent
  47. {
  48. string remoteHost;
  49. string enterprise;
  50. long trapType;
  51. long specificType;
  52. string error;
  53. string trapName;
  54. string trapDescr;
  55. };
  56. interface SnmpTableEvent
  57. {
  58. };
  59. interface ResultListener
  60. {
  61. void setResult( in ResultEvent e );
  62. void setNumericResult( in long j );
  63. void setStringResult( in string s );
  64. };
  65. interface SnmpTarget
  66. {
  67. boolean getDebug();
  68. long getErrorCode();
  69. void setAttemptComplete( in boolean completeState );
  70. void setVarBindCount(in long count);
  71. long getVarBindCount();
  72. boolean getAttemptComplete();
  73.           
  74. // get the name by which this object is identified
  75. string getName();
  76. void loadMibs( in string mibs ) raises (SnmpException);
  77. // SNMP operations
  78. string snmpGet();
  79. stringSeq snmpGetList();
  80. string snmpGetNext();
  81. stringSeq snmpGetNextList();
  82. string snmpSet( in string val ) raises ( SnmpException );
  83. string snmpSetWithType(in string val, in octet type )
  84. raises (SnmpException);
  85. stringSeq snmpSetList( in stringSeq val )
  86. raises (SnmpException);
  87. void snmpSendTrap( in string enterprise, in string agenthost,
  88.  in long genericType, in long specificType, in long uptime, in stringSeq values ) raises (SnmpException);
  89. // operations on the variable list
  90. long addObjectID( in string oid );
  91. string getObjectID( in long index );
  92. void setObjectID( in string oid );
  93. stringSeq getObjectIDList();
  94. void setObjectIDAtIndex( in long index, in string oid );
  95. void setObjectIDList( in stringSeq oidList );
  96. void setDebug( in boolean debug );
  97. void setMibModules( in string mibs );
  98. string getMibModules();
  99. // operations on the Target object
  100. string getTargetHost();
  101. void setTargetHost( in string host );
  102. long getTargetPort();
  103. void setTargetPort( in long port );
  104. string getCommunity();
  105. void setCommunity( in string community );
  106. string getWriteCommunity();
  107. void setWriteCommunity( in string community );
  108. long getTimeout();
  109. void setTimeout( in long timeoutval );
  110. long getRetries();
  111. void setRetries( in long retryVal );
  112. long getMaxRepetitions();
  113. void setMaxRepetitions( in long maxVal );
  114. long getNonRepeaters( );
  115. void setNonRepeaters( in long maxVal );
  116. stringMatrix snmpGetBulkList();
  117. long getSnmpVersion( );
  118. void setSnmpVersion( in long version );
  119. string getErrorString( );
  120. boolean getAttemptPartial( );
  121. void setAttemptPartial( in boolean partialState );
  122. boolean getSendTimeoutEvents();
  123. void setSendTimeoutEvents( in boolean flag );
  124. void addResultListener( in ResultListener l );
  125. void removeResultListener( in ResultListener l );
  126. stringMatrix snmpGetAllList();
  127.   long getMaxNumRows();
  128.    void setMaxNumRows(in long maxRows);
  129. // Some SNMPv3 related API methods.
  130. void create_v3_tables();
  131. string getContextName();
  132. void setContextName( in string cName);
  133. string getContextID();
  134. void setContextID( in string ctxtID);
  135. string getPrincipal();
  136. void setPrincipal(in string s);
  137. long getAuthProtocol();
  138. void setAuthProtocol(in long protocol);
  139. string getAuthPassword();
  140. void setAuthPassword(in string password);
  141. string getPrivPassword();
  142. void setPrivPassword(in string password);
  143. void initSecurityProvider () raises (SnmpException);
  144. long getSecurityModel ();
  145. void setSecurityModel (in long securityModel);
  146. boolean isSupportedSecurityModel (in long securityModel);
  147. };
  148. interface SnmpTarget;
  149. interface SnmpTableListener;
  150. interface SnmpTable : corba::SnmpTarget
  151. {
  152. long getRowCount();
  153. long getColumnCount();
  154. string getColumnName( in long index );
  155. boolean isCellEditable( in long row, in long col );
  156. string getValueAt( in long row, in long col );
  157. void setValueAt( in any obj, in long row, in long col );
  158. void addSnmpTableListener( in SnmpTableListener l );
  159. void removeSnmpTableListener( in SnmpTableListener l );
  160. string getTableOID();
  161. void setTableOID( in string oid ) raises (SnmpException);
  162. long getDataType();
  163. void setDataType( in long type );
  164. long getPollInterval();
  165. void setPollInterval( in long i );
  166. boolean getPerformSets();
  167. void getPerformSetsActivate( in boolean allowSets );
  168. const long STRING_DATA = 1;
  169. const long SNMP_VARIABLE_DATA = 3;
  170. const long SNMP_VARIABLE_BINDING_DATA = 3;
  171. stringMatrix getNotAccessibleIndex();
  172. stringSeq getNotAccessibleIndexColumns();
  173. };
  174. interface TrapListener
  175. {
  176. void receivedTrap( in TrapEvent e );
  177. };
  178. interface SnmpTrapReceiver
  179. {
  180. string getName();
  181. void loadMibs( in string mibs ) raises (SnmpException);
  182. void addTrapListener( in TrapListener l );
  183. void removeTrapListener( in TrapListener l );
  184. void setDebug( in boolean debug );
  185. string getMibModules();
  186. void setMibModules( in string mibs );
  187. stringSeq getLocalAddresses();
  188. void setLocalAddresses( in stringSeq addresses );
  189. long getPort( );
  190. void setPort( in long port );
  191. string getCommunity();
  192. void setCommunity( in string community );
  193. long getSnmpVersion();
  194. void setSnmpVersion( in long version );
  195. void setPrincipal(in string principal);
  196. void setAuthProtocol(in long protocol);
  197. void setAuthPassword(in string passwd);
  198. void setPrivPassword(in string passwd);
  199. void createUserEntry(in octetSeq engineID, in octet secLevel);
  200. void initSecurityProvider () raises (SnmpException);
  201. long getSecurityModel ();
  202. void setSecurityModel (in long securityModel);
  203. boolean isSupportedSecurityModel (in long securityModel);
  204. };
  205. interface SnmpTableListener
  206. {
  207. void tableChanged( in TableEvent e );
  208. };
  209. interface SnmpPoller : corba::SnmpTarget
  210. {
  211. //string getName();
  212. boolean getPollingStatus();
  213. void stopPolling();
  214. void restartPolling();
  215. long getPollInterval();
  216. void setPollInterval( in long i );
  217. void setAbsoluteCounters( in boolean absoluteCounters );
  218. };
  219. interface ResultListener;
  220. interface SnmpRequestServer
  221. {
  222. string getName();
  223. void loadMibs( in string mibs ) raises (SnmpException);
  224. void addResultListener( in ResultListener l );
  225. void removeResultListener( in ResultListener l );
  226. long addObjectID( in string s );
  227. string getObjectIDAtIndex( in long index );
  228. string getObjectID( );
  229. void setObjectID( in string s );
  230. void setObjectIDAtIndex( in long index, in string s );
  231. stringSeq getObjectIDList();
  232. void setObjectIDList( in stringSeq OIDlist );
  233. string getTargetHost( );
  234. void setTargetHost( in string hostname );
  235. long getTargetPort();
  236. void setTargetPort( in long index );
  237. string getCommunity();
  238. void setCommunity( in string s );
  239. string getWriteCommunity();
  240. void setWriteCommunity( in string s );
  241. long getTimeout();
  242. void setTimeout( in long timeoutVal );
  243. long getRetries();
  244. void setRetries( in long numRetries );
  245. long getMaxRepetitions( );
  246. void setMaxRepetitions( in long numMaxRepetitions );
  247. long getNonRepeaters( );
  248. void setNonRepeaters( in long numMaxRepetitions );
  249. long sendGetBulkRequestList();
  250. long getSnmpVersion();
  251. void setSnmpVersion( in long version );
  252. // Some SNMP V3 methods.
  253. string getPrincipal();
  254. void setPrincipal(in string uName);
  255. long getAuthProtocol();
  256. void setAuthProtocol(in long protocol);
  257. string getAuthPassword();  
  258. void setAuthPassword(in string password);
  259. string getPrivPassword();
  260. void setPrivPassword(in string password);
  261. octetSeq getEngineID();
  262. void setEngineID(in octetSeq engID);
  263. string getSecurityLevel();
  264. void setSecurityLevel(in octet sLevel);
  265. long create_v3_tables();
  266. void initSecurityProvider () raises (SnmpException);
  267. long getSecurityModel ();
  268. void setSecurityModel (in long securityModel);
  269. string getErrorString();
  270. boolean getAttemptPartial();
  271. void setAttemptPartial( in boolean b );
  272. boolean getSendTimeoutEvents( );
  273. void setSendTimeoutEvents( in boolean b );
  274. void setDebug( in boolean debug );
  275. string getMibModules();
  276. void setMibModules( in string mibs );
  277. // NOTE: RequestEvent is com.adventnet.snmp.beans.RequestEvent
  278. long addRequest( in RequestEvent e );
  279. long sendGetRequest();
  280. long sendGetRequestList();
  281. long sendGetNextRequest();
  282. long sendGetNextRequestList();
  283. long sendSetRequestOfType( in string value, in octet type ) raises (SnmpException);
  284. long sendSetRequest( in string value ) raises (SnmpException);
  285. long sendSetRequestList( in stringSeq valueList ) raises (SnmpException);
  286. void sendTrap( in string enterprise, in string agenthost,
  287. in long genericType, in long specificType, in long uptime,
  288. in stringSeq values ) raises (SnmpException);
  289. };
  290. interface SnmpFactory
  291. {
  292. SnmpTarget createTarget();
  293. void destroyTarget(in string name );
  294. SnmpRequestServer createRequestServer();
  295. void destroyRequestServer( in string name );
  296. SnmpPoller createPoller();
  297. void destroyPoller( in string name );
  298. SnmpTrapReceiver createTrapReceiver();
  299. void destroyTrapReceiver( in string name );
  300. SnmpTable createTable();
  301. void destroyTable( in string name );
  302. };
  303. };