snmpext.3n
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3N 代码 · 共 169 行
3N
169 行
.TH snmpext 3n.SH Namesnmpextregister, snmpextgetreq, snmpextrespond, snmpexterror \- library routines available for building the Extended ULTRIX SNMP Agent (Extended Agent).SH Syntax.nf.B #include <protocols/snmp.h>.B #include <protocols/snmperrs.h>struct objident {.ta .5i 1.5i 3i short ncmp; /* number of components */ unsigned long cmp[SNMPMXID]; /* components */};struct snmpareg { short oidtype; /* object id type */ objident oid; /* object id/*};struct snmparspdat { short type; /* response data type */ short octets; /* number of octets in response data */ char *rspdat; /* response data */};.B snmpextregister(\fIreg, community\fP).B struct snmpareg *\fIreg\fP;.B char *\fIcommunity\fP;.B snmpextgetreq(\fIreqoid, reqinst\fP).B objident *\fIreqoid\fP;.B objident *\fIreqinst\fP;.B snmpextrespond(\fIreqoid, rspinst, rspdat\fP).B objident *\fIreqoid\fP;.B objident *\fIrspinst\fP;.B struct snmparspdat *\fIrspdat\fP;.B snmpexterror(\fIerror\fP).B long \fIerror\fP;.fi.SH Description.PPThe following library routines are available for building the Extended Agent:.IP snmpextregister 5.NXR "snmpext" "library routines"Used to register the Extended Agent's Management Information Base(MIB) to the ULTRIX SNMP Agent (Agent). The.I regparameter is provided by the caller with the object identifiers to beregistered. The .I communityparameter is provided by the caller with the community name(a null-terminated string)..IP.ne 3This library routine waits for a registration confirmation fromthe Agent. The process is blocked until the confirmation arrives.When the confirmation arrives, the routine returns the status of theregistration..IPThe program issues this call before any other Extended SNMPLibrary calls. It does this because the.PN snmpextregisterlibrary routine creates a UNIXdomain socket to the Agent on behalf of the caller..PP.IP snmpextgetreq 5Used to receive a request for a MIB variable fromthe Agent. If there is no outstanding request from the Agent, the processis blocked until a request arrives from the Agent..IPWhen the Extended Agent receives a request from the Agent, the.I reqoidparameter contains the object identifier for the requested variable.The.I reqinstparameter contains the object instance identifier for the requestedvariable. If the request does not contains an object instance, the.I reqinst->ncmprecord contains a zero..PP.IP snmpextrespond 5Used to return the requested variable to the Agent. The.I reqoidparameter is the object identifier from the.PN snmpextgetreqlibrary call. The.I rspinstparameter is the object instance associated with thereturning variable. If there is no object instance associated withthe returning variable, a null parameter must be supplied. The.I rspdatparameter is the returning variable..IPNote that the Agent maintains a configurable timerfor outstanding requests to the Extended Agent.Therefore, the Extended Agent must be able to respond within the Agent's timeout interval inorder to prevent a premature timeout in the Agent..IPSee the .PN /etc/snmpd.conffile for your system's default timeout value..IP snmpexterror 5Used to return an error to the Agent. The.I errorparameter is the error code to be returned to the Agent.The error code is one of the following:.IPNOERR\(emsuccessful SNMP.I get-next-request end-of-table. Thishappens when the requested instance does not exist..IPNOSUCH\(emUnknown requested object identifier..IPGENERRS\(emGeneric error..IPBADVAL\(emBad variable value..SH RestrictionsFor the .PN snmpextregisterroutine, the object identifier must have the prefix1.3.6.1 to be registered. If it does not, the registration isrejected..SH Return ValuesIf an error occurs, a negative value is returned..\".SH Diagnostics.TP 15[BADVERSION]Bad or obsolete protocol version.TP 15[BINDERR]Failed to bind the socket.TP 15 [GENSUC] MIB successfully registered.TP 15[NOSOCK]Socket does not exist.TP 15[NOSVC] MIB registration was rejected.TP 15[PKTLENERR]Maximum size message exceeded or community name is too large.TP 15[RCV_ERR]Reception failed.TP 15[SND_ERR]Transmission failed.SH Files.TP 20.PN /etc/snmpd.confSNMP configuration file.SH See Also.\" Other ULTRIX documents.\" Italize the names of books as followssnmpd.conf(5n), snmpd(8n), snmpsetup(8n).br.I Guide to Network Programming
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?