⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 net-snmp-configuring-ecos.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
字号:
<!-- Copyright (C) 2003 Red Hat, Inc.                                --><!-- This material may be distributed only subject to the terms      --><!-- and conditions set forth in the Open Publication License, v1.0  --><!-- or later (the latest version is presently available at          --><!-- http://www.opencontent.org/openpub/).                           --><!-- Distribution of the work or derivative of the work in any       --><!-- standard (paper) book form is prohibited unless prior           --><!-- permission is obtained from the copyright holder.               --><HTML><HEAD><TITLE>Configuring eCos</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="SNMP for eCos"HREF="net-snmp-ecos-port.html"><LINKREL="PREVIOUS"TITLE="Starting the SNMP Agent"HREF="net-snmp-starting-the-snmp-agent.html"><LINKREL="NEXT"TITLE="Test cases"HREF="net-snmp-test-cases.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="net-snmp-starting-the-snmp-agent.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 47. SNMP for <SPANCLASS="emphasis"><ICLASS="EMPHASIS">eCos</I></SPAN></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="net-snmp-test-cases.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="NET-SNMP-CONFIGURING-ECOS">Configuring eCos</H1><P>To use the SNMP agent, the SNMP library and agent packages must beincluded in your configuration. To incorporate the stack into yourconfiguration select the SNMP library and SNMP agent packages in theeCos Configuration Tool, or at the command line type:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="USERINPUT"><B>ecosconfig add snmplib snmpagent</B></TT></PRE></TD></TR></TABLE></P><P>After adding the networking, common ethernet device drivers,snmp library and snmp agent packages, there is no configurationrequired. However there are a number of configuration optionsthat can be set such as some details for the System MIB, anddisabling SNMPv3 support (see below).</P><P>Starting the SNMP agent is not integrated into networktests other than <TTCLASS="FILENAME">snmpping</TT> below, nor is itstarted automatically in normal eCos startup -it is up to the application to start the agent when it is ready,at least after the network interfaces are both &#8216;up&#8217;.</P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="NET-SNMP-VERSION-USAGE">Version usage (v1, v2 or v3)</H2><P>The default build supports all three versions of the SNMP protocol, but withoutany dispatcher functionality (rfc 2571, section 3.1.1.2). This has thefollowing implications :</P><P> 1. There is no community authentication for v1 and v2c.</P><P>2. Security provided by v3 can be bypassed by using v1/v2c protocol.</P><P>To provide the dispatcher with rfc 2571 type functionality, it is required toset up security models and access profiles. This can be provided in the normalUnix style by writing the required configurations in <TTCLASS="LITERAL">snmpd.conf</TT> file. Application code may setup profiles in <TTCLASS="LITERAL">snmpd.conf</TT> and optionally set the environment variable <TTCLASS="LITERAL">SNMPCONFPATH</TT> to point to the file if it is not in the usual location. The whole concept worksin the usual way as with the standard UCD-SNMP distribution.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="TRAPS">Traps</H2><P>The support of the <TTCLASS="LITERAL">trapsink</TT> command in the<AHREF="net-snmp-agent-manpages-snmpd.conf.html">snmpd.conf</A> file is not tested and there may be problems for it working as expected. Moreover, in systems that do not have filesystem support, there is no way to configure a trap-session in theconventional way.</P><P>For reasons mentioned above, applications need to initialize their own trapsessions and pass it the details of trap-sink. The following is a small samplefor initializing a v1 trap session :</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">typedef struct trap {        unsigned char ip [4];        unsigned int  port;        unsigned char community [256];}trap            trapsink;unsinged char   sink [16]; ......if (trapsink.ip != 0) {        sprintf (sink, "%d.%d.%d.%d",                 trapsink[0], trapsink[1], trapsink[2], trapsink[3]);        if (create_trap_session (sink,                trapsink.port,                (char *)trapsink.community,                SNMP_VERSION_1,                SNMP_MSG_TRAP) == 0) {                log_error ("Creation of trap session failed \n");        }}</PRE></TD></TR></TABLE></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="NET-SNMP-SNMPD-CONF"><TTCLASS="LITERAL">snmpd.conf</TT> file</H2><P>Using snmpd.conf requires the inclusion of one of the file-system packages(eg. CYGPKG_RAMFS) and CYGPKG_FILEIO. With these two packages included, theSNMP sub-system will read the snmpd.conf file from the location specified in<TTCLASS="LITERAL">SNMPCONFPATH</TT>, or the standard builtin locations, and usethese profiles. Only the profiles specified in the <TTCLASS="LITERAL">ACCESS-CONTROL</TT>section of <AHREF="net-snmp-agent-manpages-snmpd.conf.html">snmpd.conf</A> file have been tested and shown to work. Other profiles which have been implemented in <TTCLASS="LITERAL">UCD-SNMP-4.1.2</TT>'s <TTCLASS="LITERAL">snmpd.conf</TT> may not workbecause the sole purpose of adding support for the snmpd.conf file has been toset up <TTCLASS="LITERAL">ACCESS-CONTROL</TT> models.</P><P>At startup, the SNMP module tries to look for file <TTCLASS="FILENAME">snmp.conf</TT>. If this file is not available, the module successively looks for files<TTCLASS="FILENAME">snmpd.conf</TT>, <TTCLASS="FILENAME">snmp.local.conf</TT> and <TTCLASS="FILENAME">snmpd.local.conf</TT> at the locations pointed to by <TTCLASS="LITERAL">SNMPCONFPATH</TT> environment variable. In case <TTCLASS="LITERAL">SNMPCONFPATH</TT> is not defined, the search sequence is carried out in default directories.The default directories are :<TTCLASS="FILENAME">/usr/share/snmp</TT>, <TTCLASS="FILENAME">/usr/local/share/snmp</TT> and <TTCLASS="FILENAME">$(HOME)/.snmp</TT>.The configurations read from these files are used to control both, SNMP applications and the SNMP agent; in the usual UNIX fashion.</P><P>The inclusion of snmpd.conf support is enabled by default when suitable filesystems and FILEIO packages are active.</P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="net-snmp-starting-the-snmp-agent.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="net-snmp-test-cases.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Starting the SNMP Agent</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="net-snmp-ecos-port.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Test cases</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -