]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - doc/html/ref/net-snmp-configuring-ecos.html
RedBoot TX53 Release 2012-02-15
[karo-tx-redboot.git] / doc / html / ref / net-snmp-configuring-ecos.html
1 <!-- Copyright (C) 2003 Red Hat, Inc.                                -->
2 <!-- This material may be distributed only subject to the terms      -->
3 <!-- and conditions set forth in the Open Publication License, v1.0  -->
4 <!-- or later (the latest version is presently available at          -->
5 <!-- http://www.opencontent.org/openpub/).                           -->
6 <!-- Distribution of the work or derivative of the work in any       -->
7 <!-- standard (paper) book form is prohibited unless prior           -->
8 <!-- permission is obtained from the copyright holder.               -->
9 <HTML
10 ><HEAD
11 ><TITLE
12 >Configuring eCos</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
14 <META
15 NAME="GENERATOR"
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
17 "><LINK
18 REL="HOME"
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
21 REL="UP"
22 TITLE="SNMP for eCos"
23 HREF="net-snmp-ecos-port.html"><LINK
24 REL="PREVIOUS"
25 TITLE="Starting the SNMP Agent"
26 HREF="net-snmp-starting-the-snmp-agent.html"><LINK
27 REL="NEXT"
28 TITLE="Test cases"
29 HREF="net-snmp-test-cases.html"></HEAD
30 ><BODY
31 CLASS="SECT1"
32 BGCOLOR="#FFFFFF"
33 TEXT="#000000"
34 LINK="#0000FF"
35 VLINK="#840084"
36 ALINK="#0000FF"
37 ><DIV
38 CLASS="NAVHEADER"
39 ><TABLE
40 SUMMARY="Header navigation table"
41 WIDTH="100%"
42 BORDER="0"
43 CELLPADDING="0"
44 CELLSPACING="0"
45 ><TR
46 ><TH
47 COLSPAN="3"
48 ALIGN="center"
49 >eCos Reference Manual</TH
50 ></TR
51 ><TR
52 ><TD
53 WIDTH="10%"
54 ALIGN="left"
55 VALIGN="bottom"
56 ><A
57 HREF="net-snmp-starting-the-snmp-agent.html"
58 ACCESSKEY="P"
59 >Prev</A
60 ></TD
61 ><TD
62 WIDTH="80%"
63 ALIGN="center"
64 VALIGN="bottom"
65 >Chapter 47. SNMP for <SPAN
66 CLASS="emphasis"
67 ><I
68 CLASS="EMPHASIS"
69 >eCos</I
70 ></SPAN
71 ></TD
72 ><TD
73 WIDTH="10%"
74 ALIGN="right"
75 VALIGN="bottom"
76 ><A
77 HREF="net-snmp-test-cases.html"
78 ACCESSKEY="N"
79 >Next</A
80 ></TD
81 ></TR
82 ></TABLE
83 ><HR
84 ALIGN="LEFT"
85 WIDTH="100%"></DIV
86 ><DIV
87 CLASS="SECT1"
88 ><H1
89 CLASS="SECT1"
90 ><A
91 NAME="NET-SNMP-CONFIGURING-ECOS">Configuring eCos</H1
92 ><P
93 >To use the SNMP agent, the SNMP library and agent packages must be
94 included in your configuration. To incorporate the stack into your
95 configuration select the SNMP library and SNMP agent packages in the
96 eCos Configuration Tool, or at the command line type:
97 <TABLE
98 BORDER="5"
99 BGCOLOR="#E0E0F0"
100 WIDTH="70%"
101 ><TR
102 ><TD
103 ><PRE
104 CLASS="SCREEN"
105 >$ <TT
106 CLASS="USERINPUT"
107 ><B
108 >ecosconfig add snmplib snmpagent</B
109 ></TT
110 ></PRE
111 ></TD
112 ></TR
113 ></TABLE
114 ></P
115 ><P
116 >After adding the networking, common ethernet device drivers,
117 snmp library and snmp agent packages, there is no configuration
118 required. However there are a number of configuration options
119 that can be set such as some details for the System MIB, and
120 disabling SNMPv3 support (see below).</P
121 ><P
122 >Starting the SNMP agent is not integrated into network
123 tests other than <TT
124 CLASS="FILENAME"
125 >snmpping</TT
126 > below, nor is it
127 started automatically in normal eCos startup -
128 it is up to the application to start the agent when it is ready,
129 at least after the network interfaces are both &#8216;up&#8217;.</P
130 ><DIV
131 CLASS="SECT2"
132 ><H2
133 CLASS="SECT2"
134 ><A
135 NAME="NET-SNMP-VERSION-USAGE">Version usage (v1, v2 or v3)</H2
136 ><P
137 >The default build supports all three versions of the SNMP protocol, but without
138 any dispatcher functionality (rfc 2571, section 3.1.1.2). This has the
139 following implications :</P
140 ><P
141 > 1. There is no community authentication for v1 and v2c.</P
142 ><P
143 >2. Security provided by v3 can be bypassed by using v1/v2c protocol.</P
144 ><P
145 >To provide the dispatcher with rfc 2571 type functionality, it is required to
146 set up security models and access profiles. This can be provided in the normal
147 Unix style by writing the required configurations in <TT
148 CLASS="LITERAL"
149 >snmpd.conf</TT
150
151 file. Application code may setup profiles in <TT
152 CLASS="LITERAL"
153 >snmpd.conf</TT
154 > and 
155 optionally set the environment variable <TT
156 CLASS="LITERAL"
157 >SNMPCONFPATH</TT
158 > to 
159 point to the file if it is not in the usual location. The whole concept works
160 in the usual way as with the standard UCD-SNMP distribution.</P
161 ></DIV
162 ><DIV
163 CLASS="SECT2"
164 ><H2
165 CLASS="SECT2"
166 ><A
167 NAME="TRAPS">Traps</H2
168 ><P
169 >The support of the <TT
170 CLASS="LITERAL"
171 >trapsink</TT
172 > command in the
173 <A
174 HREF="net-snmp-agent-manpages-snmpd.conf.html"
175 >snmpd.conf</A
176 > file is not tested 
177 and there may be problems for it working as expected. Moreover, in systems that do not 
178 have filesystem support, there is no way to configure a trap-session in the
179 conventional way.</P
180 ><P
181 >For reasons mentioned above, applications need to initialize their own trap
182 sessions and pass it the details of trap-sink. The following is a small sample
183 for initializing a v1 trap session :</P
184 ><TABLE
185 BORDER="5"
186 BGCOLOR="#E0E0F0"
187 WIDTH="70%"
188 ><TR
189 ><TD
190 ><PRE
191 CLASS="PROGRAMLISTING"
192 >typedef struct trap {
193         unsigned char ip [4];
194         unsigned int  port;
195         unsigned char community [256];
196 }
197
198 trap            trapsink;
199 unsinged char   sink [16]; 
200
201 ...
202 ...
203
204 if (trapsink.ip != 0) {
205         sprintf (sink, "%d.%d.%d.%d",
206                  trapsink[0], trapsink[1], trapsink[2], trapsink[3]);
207         if (create_trap_session (sink,
208                 trapsink.port,
209                 (char *)trapsink.community,
210                 SNMP_VERSION_1,
211                 SNMP_MSG_TRAP) == 0) {
212                 log_error ("Creation of trap session failed \n");
213         }
214 }</PRE
215 ></TD
216 ></TR
217 ></TABLE
218 ></DIV
219 ><DIV
220 CLASS="SECT2"
221 ><H2
222 CLASS="SECT2"
223 ><A
224 NAME="NET-SNMP-SNMPD-CONF"><TT
225 CLASS="LITERAL"
226 >snmpd.conf</TT
227 > file</H2
228 ><P
229 >Using snmpd.conf requires the inclusion of one of the file-system packages
230 (eg. CYGPKG_RAMFS) and CYGPKG_FILEIO. With these two packages included, the
231 SNMP sub-system will read the snmpd.conf file from the location specified in
232 <TT
233 CLASS="LITERAL"
234 >SNMPCONFPATH</TT
235 >, or the standard builtin locations, and use
236 these profiles. Only the profiles specified in the <TT
237 CLASS="LITERAL"
238 >ACCESS-CONTROL</TT
239 >
240 section of <A
241 HREF="net-snmp-agent-manpages-snmpd.conf.html"
242 >snmpd.conf</A
243 > file have 
244 been tested and shown to work. Other profiles which have been implemented in 
245 <TT
246 CLASS="LITERAL"
247 >UCD-SNMP-4.1.2</TT
248 >'s <TT
249 CLASS="LITERAL"
250 >snmpd.conf</TT
251 > may not work
252 because the sole purpose of adding support for the snmpd.conf file has been to
253 set up <TT
254 CLASS="LITERAL"
255 >ACCESS-CONTROL</TT
256 > models.</P
257 ><P
258 >At startup, the SNMP module tries to look for file <TT
259 CLASS="FILENAME"
260 >snmp.conf</TT
261 >. 
262 If this file is not available, the module successively looks for files
263 <TT
264 CLASS="FILENAME"
265 >snmpd.conf</TT
266 >, <TT
267 CLASS="FILENAME"
268 >snmp.local.conf</TT
269 > and 
270 <TT
271 CLASS="FILENAME"
272 >snmpd.local.conf</TT
273 > at the locations pointed to by <TT
274 CLASS="LITERAL"
275 >SNMPCONFPATH</TT
276 > environment variable. In case <TT
277 CLASS="LITERAL"
278 >SNMPCONFPATH</TT
279 > is not defined, the search sequence is carried out in default directories.
280 The default directories are :<TT
281 CLASS="FILENAME"
282 >/usr/share/snmp</TT
283 >, <TT
284 CLASS="FILENAME"
285 >/usr/local/share/snmp</TT
286 > and <TT
287 CLASS="FILENAME"
288 >$(HOME)/.snmp</TT
289 >.
290 The configurations read from these files are used to control both, SNMP 
291 applications and the SNMP agent; in the usual UNIX fashion.</P
292 ><P
293 >The inclusion of snmpd.conf support is enabled by default when suitable 
294 filesystems and FILEIO packages are active.</P
295 ></DIV
296 ></DIV
297 ><DIV
298 CLASS="NAVFOOTER"
299 ><HR
300 ALIGN="LEFT"
301 WIDTH="100%"><TABLE
302 SUMMARY="Footer navigation table"
303 WIDTH="100%"
304 BORDER="0"
305 CELLPADDING="0"
306 CELLSPACING="0"
307 ><TR
308 ><TD
309 WIDTH="33%"
310 ALIGN="left"
311 VALIGN="top"
312 ><A
313 HREF="net-snmp-starting-the-snmp-agent.html"
314 ACCESSKEY="P"
315 >Prev</A
316 ></TD
317 ><TD
318 WIDTH="34%"
319 ALIGN="center"
320 VALIGN="top"
321 ><A
322 HREF="ecos-ref.html"
323 ACCESSKEY="H"
324 >Home</A
325 ></TD
326 ><TD
327 WIDTH="33%"
328 ALIGN="right"
329 VALIGN="top"
330 ><A
331 HREF="net-snmp-test-cases.html"
332 ACCESSKEY="N"
333 >Next</A
334 ></TD
335 ></TR
336 ><TR
337 ><TD
338 WIDTH="33%"
339 ALIGN="left"
340 VALIGN="top"
341 >Starting the SNMP Agent</TD
342 ><TD
343 WIDTH="34%"
344 ALIGN="center"
345 VALIGN="top"
346 ><A
347 HREF="net-snmp-ecos-port.html"
348 ACCESSKEY="U"
349 >Up</A
350 ></TD
351 ><TD
352 WIDTH="33%"
353 ALIGN="right"
354 VALIGN="top"
355 >Test cases</TD
356 ></TR
357 ></TABLE
358 ></DIV
359 ></BODY
360 ></HTML
361 >