Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / ASNMP / asnmp-overview.html
blob6100a4d0b5e83c377b3afca5e0cecdcdc11ef647
1 <html>
2 <!-- -->
3 <! by Michael R. MacFaden mrm@cisco.com >
4 <title>ASNMP Overview</title>
6 <h1>ASNMP Overview</h1>
8 <p>The Another SNMP class library is an Object Oriented programming
9 toolkit for using IETF standard network management protocols in the
10 Internet. The SNMP protocol is perhaps the most ubiquitous management
11 protocol running on most very device or application deployed in the
12 modern network today.
14 <p>ASNMP is targeted to programmers that want to write command and
15 control (C&C) applications. C&C Applications communicate with
16 a variety of objects:
17 <sl>
18 <li>network devices such as ATM switches, Internet routers,
19 LAN bridges and LAN printers
20 <li>Routing protocols such as OSPF
21 <li>database servers such as ORACLE or Informix.
23 <p>ASNMP Version 1 implements a blocking SNMP Version 1 with some
24 Version 2c additions (Counter32, Counter64 SMI values). See
25 SNMP Version 1 as defined in the IETF Request for Comments (RFC)
26 <sl>
27 <li>1155
28 <li>1157
29 <li>1213
30 <li>1215
31 <sl>
32 <p>Also see the RFC 1902 spec for new SMI datatypes such as Counter64.
34 <p>ASNMP is built using the CMU SNMP and HP SNMP++ as the base
35 classes then modified for use in the ACE framework. About 10% of the API
36 changed during code rework. See ASNMP/asnmp/ChangeLog for details.
38 <p>ASNMP can be used for either manager applications or agent applications.
39 The <i>Snmp</i> class contains the interface for manager applications. The
40 <i>sagent</i> class contains the interface for agent applications. A
41 trivial agent that implements the mib II system group per rfc1213 is
42 in the agents/ directory.
44 <h2>Class Hierarchy</h2>
46 <pre>
47 UdpTarget - Defines a collection of attributes needed to define a
48 communications session with an SNMP agent
49 This includes network address, response timeout, etc.
51 Snmp - A logical session between NM app and agent. Provides the
52 commands get, get_next, trap. Manages transactions between app and
53 server.
55 Pdu - A container object that represents an SNMP Protocol Data Unit.
56 A Pdu contains a command (get,getnext,trap) Varbind List list,
57 a community string.
59 Vb - Aka Varbind or Variable Binding. A pdu can have zero,
60 one or more of these. A Vb consists of an Oid to identify
61 the variable and a value corresponding to one of the SMI values.
62 The oid/value binding is defined in a MIB file (RFC 1155)
63 Agents hava a MIB file that defines what each variable means.
64 Most agents implement MIB II as defined in RFC 1156.
66 <p>The Structure of Management Information (SMI) datatypes
67 and related types are:
68 <ul>
69 <li>Address->IpAddress->UdpAddress as well as MAC, IPX, IPXSOCK, Netbios
70 <li>Unsigned Integer
71 <li>Gauge32
72 <li>Integer32
73 <li>Counter32
74 <li>Counter64
75 <li>TimeTicks
76 <li>OctetStr
77 <li>Oid
78 </ul>
80 <hr>
82 <h2>Sample program</h2>
83 <p>A sample Object to get obtain an Agent's Systems' Description
84 given an network address and a community string.
86 class system_id {
87 public:
88 system_id(UdpAddress addr, OctetStr read_community_string)
90 UdpTarget tgt;
91 Snmp snmp;
92 Pdu pdu;
93 Oid oid("1.3.6.1.2.1.1.1.0");
94 Vb vb(oid);
95 tgt.set_address(addr);
96 tgt.set_read_community(read_community_string);
97 pdu += vb;
99 if (snmp.get(pdu, tgt) == 0) {
100 pdu.get_vb(vb, 0);
101 vb.get_value(desc_);
103 else
104 desc_ = "<error - no value set>"
107 int get_description(OctetStr& description) {
108 description = desc_;
109 return 0;
112 private:
113 OctetStr desc_;
116 <h1>Future Directions</h1>
117 <p>Here are some areas for further work
118 <sl>
119 <li>Add OO mib parser and mib code generator
120 <li>Collapse the CMU/HP code into one set of classes.
121 <li>Add full V2c support.
122 <li>Size/Speed improvements
123 </sl>
125 <h1>References</h1>
126 <ul>
127 <li><a href="http://www.ece.ucdavis.edu/ucd-snmp/">UCD SNMP</a>
128 <li><a href="news://comp.protocols.snmp">comp.protocols.snmp</a>
129 <li><a href="http://snmp.cs.utwente.nl">University of Twente</a>
130 <li><a href="http://www.cis.ohio-state.edu/hypertext/faq/bngusenet/comp/protocols/snmp/top.html">SNMP FAQ</a>
131 <li><a href="http://www.adventnet.com/">Java based SNMP tools from Ardent</a>
132 <li><a href="http://misa.zurich.ibm.com/Webbin/">IBM SNMP/CMIP research</a>
133 </ul>
134 </html>