?? snmp-faq-1.1.ascii
字號(hào):
SPR / PATCH:KEYWORDS:--------------------------------------------------------------------------14. TITLE: How is the cookie variable used. SCOPE DISCOVERED ON HOST: All ------------------- ------------------- ARCHITECTURE: All ------------------- ------------------- BSP: All ------------------- -------------------PRODUCT / REVISION: snmpv1/v2c 1.0 ------------------- -------------------DESCRIPTION OF PROBLEM:As the cookie variable can set to "the address of a variable", is this a good mechanism to set default values for non-volatile enterprise mib-specific DisplayString variables? --DEFAULT cookie cookieVariable ::= { myMib 3 }Also, in the snmpdTrapSend() discussion it states "pCookie is passed to this routine (i.e., my trapVarBindsRtn() function) as shown below: (*trapVarBindsRtn) (pPkt [I'm assuming this is a typo for "pktp"), pCookie)"Since the SNMP_Bind_<data type> functions do not take "cookie"as an argument, don't understand how cookie is to be used here.RESOLUTION:The cookie is optional, i.e. you can pass a null if you do not wantto use it. This is used for scalar variables and is conventionallyused as an address of the management variable. You could use table valuesbut you would need to take care of any indexing that is required for it.The cookie field can be used to keep data items which may be referred toin the method routines. You could for example keep the system group variablespointed to by these and get and set their values in their method routines.See macro VB_TO_COOKIE . You can put the cookie definitions in a ctrl. file by force-including itfrom the file that defines it. pPkt is not a typo. SPR / PATCH:KEYWORDS:--------------------------------------------------------------------------15. TITLE: Why would one want to use the -skel output format for the mibcompiler. SCOPE DISCOVERED ON HOST: All ------------------- ------------------- ARCHITECTURE: All ------------------- ------------------- BSP: All ------------------- -------------------PRODUCT / REVISION: snmpv1/v2c 1.0 ------------------- -------------------DESCRIPTION OF PROBLEM:What is the reason for using the -skel mibcomp option for the mib definitions. RESOLUTION: The -stub output format is most helpful in generating thestubs for the method routines. The -stub output is more helpful thanthe -skel option, with -skel you only get the function skeleton of methodroutines. In addition to this, the -start option would help focus theoutput to the subtree that you are trying to extend and not the wholemib. For example the following compile line :mibcomp -l $WIND_BASE/target/src/snmpv1/mibs -stub -start wrs -o demo.c \rfc1155.smi rfc1213.mib demo.mibwill have a stubs output starting from the module :wrs OBJECT IDENTIFIER ::= { enterprises 731 } -skel gives the empty method functions to start with, where as the -stubstarts with some of the method routines. Why someone would want touse -skel vs -stub is subjective i.e. if the user wants to startwriting method routines from scratch then -skel can be used. Theseoptions do not inter-rleate. NOTE You can use only one optput format eachrun of the mibcomp. The default option is -mib.cSee the SNMPv1/v2c Component Release Supplement for more details on how to use the mib compiler options.SPR / PATCH:KEYWORDS:--------------------------------------------------------------------------16. TITLE: How to add support for counters and MIB-II in custom network drivers such as token ring, ethernet etc. SCOPE DISCOVERED ON HOST: All ------------------- ------------------- ARCHITECTURE: All ------------------- ------------------- BSP: All ------------------- -------------------PRODUCT / REVISION: snmpv1/v2c ------------------- -------------------DESCRIPTION OF PROBLEM:The user is writing a token ring network driver for VxWorks.We would like our network driver to support the MIB2 Interfaceparameters. Is there a description on what our driver should expect,and what values we should return? What data structures are received by thenetwork drivers "ioctl" routine, and where is the the informationreturned? An example of another network drivers ioctl routine wouldcertainly help.RESOLUTION:The Ethernet drivers need counters added to support theMIB-II compliance for SNMP.This document specifies a MIB-II interface for vxWorks network drivers.Current drivers do not count errors, number of bytes received, output etc.These and other miscellaneous parameters need to be provided by the networkdrivers so that the current implementation of the MIB-II services can becompliant to MIB-II specifications.To address the restriction that not all the network drivers can be updatedsimultaneously to provide MIB-II services, and to keep the currentimplementation independent of the order in which drivers are updated thefollowing solution has been implemented. All MIB-II variables currently notsupported by the drivers will be accessed through the drivers'' ioctl function.The new ioctl commands will be kept private as it is an internal interfacebetween the MIB-II library and the drivers. This interface should only beadvertised to customers that write network drivers for their BSPs.Network Driver IOCTL Commands-------------------------------Drivers that support MIB-II must include the file <private/m2LibP.h>, and<m2Lib.h>. <The file private/m2LibP.h> contains the IOCTL commands andstructures that the driver needs to support.The ioctl SIOCGMIB2CNFG command and structure is only sent to the driver, eachtime the MIB-II library reads the list of network driver in the system. Inmost systems this should only happen once.#define SIOCGMIB2CNFG _IOR('m', 0, int) /* Get Configuration */typedef struct { long ifType; M2_OBJECTID ifSpecific; } M2_NETDRVCNFG;The ioctl SIOCGMIB2CNTRS allows the MIB-II library to retrieve driver variableswhich can only be computed by the driver. This command is sent to the drivereach time the interface entry is read by the SNMP agent.#define SIOCGMIB2CNTRS _IOR('m', 1, int) /* Get driver counters */typedef struct { unsigned long ifSpeed; unsigned long ifInOctets; unsigned long ifInNUcastPkts; unsigned long ifInDiscards; unsigned long ifInUnknownProtos; unsigned long ifOutOctets; unsigned long ifOutNUcastPkts; unsigned long ifOutDiscards; } M2_NETDRVCNTRS;MIB-II Variable Specifications--------------------------------This section presents the defintions for each of the variables that need to besupported by the network drivers.ifType:This field describes the type of hardware that the driver is using. The valueof this field must be in the range shown below. This values are defined inthe file <m2Lib.h>#define M2_ifType_other 1#define M2_ifType_regular1822 2#define M2_ifType_hdh1822 3#define M2_ifType_ddn_x25 4#define M2_ifType_rfc877_x25 5#define M2_ifType_ethernet_csmacd 6#define M2_ifType_iso88023_csmacd 7#define M2_ifType_iso88024_tokenBus 8#define M2_ifType_iso88025_tokenRing 9#define M2_ifType_iso88026_man 10#define M2_ifType_starLan 11#define M2_ifType_proteon_10Mbit 12#define M2_ifType_proteon_80Mbit 13#define M2_ifType_hyperchannel 14#define M2_ifType_fddi 15#define M2_ifType_lapb 16#define M2_ifType_sdlc 17#define M2_ifType_ds1 18#define M2_ifType_e1 19#define M2_ifType_basicISDN 20#define M2_ifType_primaryISDN 21#define M2_ifType_propPointToPointSerial 22#define M2_ifType_ppp 23#define M2_ifType_softwareLoopback 24#define M2_ifType_eon 25#define M2_ifType_ethernet_3Mbit 26#define M2_ifType_nsip 27#define M2_ifType_slip 28#define M2_ifType_ultra 29#define M2_ifType_ds3 30#define M2_ifType_sip 31#define M2_ifType_frame_relay 32ifSpecific:A reference to MIB definitions specific to the particular media being used torealize the interface. For example, if the interface is realized by anethernet, then the value of this object refers to a document defining objectsspecific to ethernet. If this information is not present, its value should be set to the OBJECT IDENTIFIER { 0 0 }, which is a syntactically valid objectidentifier.The current default value used is the zero OBJECT IDENTIFIERifSpeed:An estimate of the interface's current bandwidth in bits per second. Forinterfaces which do not vary in bandwidth or for those where no accurateestimation can be made, this object should contain the nominal bandwidth.The current default value used for ethernet is 10000000.fInOctets:The total number of octets received on the interface, including framingcharacters.ifInNUcastPkts:The number of non-unicast (i.e., subnetwork- broadcast or subnetwork-multicast)packets delivered to a higher-layer protocol.ifInDiscards:The number of inbound packets which were chosen to be discarded eventhough no errors had been detected to prevent their being deliverable to ahigher-layer protocol. One possible reason for discarding such a packetcould be to free up buffer space.ifInUnknownProtos:The number of packets received via the interface which were discarded becauseof an unknown or unsupported protocol.ifOutOctets:The total number of octets transmitted out of the interface, including framingcharacters.ifOutNUcastPkts:The total number of packets that higher-level protocols requested betransmitted to a non- unicast (i.e., a subnetwork-broadcast orsubnetwork-multicast) address, including those that were discarded or notsent.ifOutDiscards:The number of outbound packets which were chosen to be discarded eventhough no errors had been detected to prevent their being transmitted.One possible reason for discarding such a packet could be to free upbuffer space.SPR / PATCH: 3452KEYWORDS:--------------------------------------------------------------------------17. TITLE: How does the snmpdGroupByGetprocAndInstance() function work ? SCOPE DISCOVERED ON HOST: All ------------------- ------------------- ARCHITECTURE: All ------------------- ------------------- BSP: All ------------------- -------------------PRODUCT / REVISION: snmpv1/v2c 1.0 ------------------- -------------------DESCRIPTION OF PROBLEM:Can you explain to me how snmpdGroupByGetprocAndInstance() is supposed towork. It was my understanding that it should put the vbrs with the samelastmatch and instance id on the same linked list.Lastmatch is a terminology used throughout the wrs snmpv1/v2cdocument and snmpd agent code. And the header of snmpdGroupByGetprocAndInstance is not clear at all. What does "This routine gathers a set of similar variable bindings together "mean. I guess I don't understand what "similar" means. Does that mean the same object as what is contained in the vbr ?RESOLUTION:This function call is useful for tables, it needs to be used withinyour method routine and it allows you to process the method routinesfaster. Normally you will call a method routine for each object instance; What this funciton allows you to do is call only one methodroutine for all the instances that are grouped by getproc. For scalarsyou have only one instance therefore it is more efficient with table entries.Once this finds all the varbinds in the get request that have the same getproc and instances it links together all the varbinds so that within the same method routine they can be processed using a linked list.Example : In ipRouteTable you have ipRouteNextHop and ipRouteType. If you are doing a get request such as ...GET ipRouteNextHop.200.20.20.20 sysName.0 ipRouteType.200.20.20.20 then you are getting values from the same routing table entry. Ifyour routing interfaces are written to refer to complete entries thenit makes sense to do the above operation with a single call to thisrouting interface.Usually the method routines are invoked in sequence for each variable binding,so it will be faster if only one method routine is called to complete all the processing of the routing varbinds in the example. The two routing tablevarbinds will be linked together because they have the same get process andthe same instance, but sysName varbind does not get linked. Also see snmpSystem.c file, it uses snmpdGroupByGetprocAndInstanceSPR / PATCH:KEYWORDS:--------------------------------------------------------------------------
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -