The \fBnutscan_scan_snmp()\fR function try to detect NUT compatible SNMP devices\&. It tries SNMP queries on every IP ranging from \fIstart_ip\fR to \fIstop_ip\fR\&. Those IP may be either IPv4 or IPv6 addresses or host names\&.
This function waits up to \fItimeout\fR microseconds before considering an IP address does not respond to SNMP queries\&.
.sp
A valid nutscan_snmp_t structure must be passed to this function\&.
.sp
The nutscan_snmp_t structure contains the following members which must be filled as described below:
.sp
.ifn\{\
.RS4
.\}
.nf
char * \*(Aqcommunity\*(Aq;
char * \*(AqsecLevel\*(Aq;
char * \*(AqsecName\*(Aq;
char * \*(AqauthPassword\*(Aq;
char * \*(AqprivPassword\*(Aq;
char * \*(AqauthProtocol\*(Aq;
char * \*(AqprivProtocol\*(Aq;
.fi
.ifn\{\
.RE
.\}
.sp
If \fIcommunity\fR is not NULL, SNMP v1 request are sent using this \fIcommunity\fR\&.
.sp
If \fIcommunity\fR is NULL and \fIsecLevel\fR is NULL, SNMP v1 is selected and \fIcommunity\fR is set to "public"\&.
.sp
In the other cases, SNMP v3 is used\&. \fIsecLevel\fR may be one of SNMP_SEC_LEVEL_NOAUTH, SNMP_SEC_LEVEL_AUTHNOPRIV or SNMP_SEC_LEVEL_AUTHPRIV\&. \fIsecName\fR is the security name and must be non NULL\&.
.sp
If \fIsecLevel\fR is set to SNMP_SEC_LEVEL_AUTHNOPRIV, \fIauthPassword\fR must be non NULL\&.
.sp
If \fIsecLevel\fR is set to SNMP_SEC_LEVEL_AUTHPRIV, \fIauthPassword\fR and \fIprivPassword\fR must be non NULL\&.
.sp
If \fIauthProtocol\fR is NULL, MD5 protocol is used\&. Else you can set \fIauthProtocol\fR to either "MD5" or "SHA"\&.
.sp
If \fIprivProtocol\fR is NULL, DES protocol is used\&. Else you can set \fIprivProtocol\fR to either "AES" or "DES"\&.
.sp
\fIpeername\fR and \fIhandle\fR are used internally and do not need any initialization\&.
.SH"RETURN VALUE"
.sp
The \fBnutscan_scan_snmp()\fR function returns a pointer to a nutscan_device_t structure containing all found devices or NULL if an error occurs or no device is found\&.