/*
* '_cupsSNMPClose()' - Close a SNMP socket.
- *
- * @since CUPS 1.4@
*/
void
* '_cupsSNMPCopyOID()' - Copy an OID.
*
* The array pointed to by "src" is terminated by the value -1.
- *
- * @since CUPS 1.4@
*/
int * /* O - New OID */
*
* The default community name is the first community name found in the
* snmp.conf file. If no community name is defined there, "public" is used.
- *
- * @since CUPS 1.4@
*/
const char * /* O - Default community name */
* '_cupsSNMPIsOID()' - Test whether a SNMP response contains the specified OID.
*
* The array pointed to by "oid" is terminated by the value -1.
- *
- * @since CUPS 1.4@
*/
int /* O - 1 if equal, 0 if not equal */
* OID prefix.
*
* The array pointed to by "prefix" is terminated by the value -1.
- *
- * @since CUPS 1.4@
*/
int /* O - 1 if prefixed, 0 if not prefixed */
/*
* '_cupsSNMPOIDToString()' - Convert an OID to a string.
- *
- * @since CUPS 1.4@
*/
/*
* '_cupsSNMPOpen()' - Open a SNMP socket.
- *
- * @since CUPS 1.4@
*/
int /* O - SNMP socket file descriptor */
*
* If "timeout" is negative, @code _cupsSNMPRead@ will wait for a response
* indefinitely.
- *
- * @since CUPS 1.4@
*/
cups_snmp_t * /* O - SNMP packet or @code NULL@ if none */
/*
* '_cupsSNMPSetDebug()' - Enable/disable debug logging to stderr.
- *
- * @since CUPS 1.4@
*/
void
*
* @code NULL@ is returned if the array is not large enough or the string is
* not a valid OID number.
- *
- * @since CUPS 1.4@
*/
int * /* O - Pointer to OID array or @code NULL@ on error */
*
* If "timeout" is negative, @code _cupsSNMPWalk@ will wait for a response
* indefinitely.
- *
- * @since CUPS 1.4@
*/
int /* O - Number of OIDs found or -1 on error */
* '_cupsSNMPWrite()' - Send an SNMP query packet.
*
* The array pointed to by "oid" is terminated by the value -1.
- *
- * @since CUPS 1.4@
*/
int /* O - 1 on success, 0 on error */
unsigned char buffer[CUPS_SNMP_MAX_PACKET];
/* SNMP message buffer */
int bytes; /* Size of message */
+ http_addr_t temp; /* Copy of address */
/*
* Send the message...
*/
+ temp = *address;
+
#ifdef AF_INET6
- if (address->addr.sa_family == AF_INET6)
- address->ipv6.sin6_port = htons(CUPS_SNMP_PORT);
+ if (temp.addr.sa_family == AF_INET6)
+ temp.ipv6.sin6_port = htons(CUPS_SNMP_PORT);
else
#endif /* AF_INET6 */
- address->ipv4.sin_port = htons(CUPS_SNMP_PORT);
+ temp.ipv4.sin_port = htons(CUPS_SNMP_PORT);
- return (sendto(fd, buffer, bytes, 0, (void *)address,
- httpAddrLength(address)) == bytes);
+ return (sendto(fd, buffer, bytes, 0, (void *)&temp,
+ httpAddrLength(&temp)) == bytes);
}