Hi,
I am working with an access point which uses SNMP. In this access
point, it uses POMI-MOBILITY-MIB for anything that are related to the
access point such as txpower or getchannel.When I ran the snmpget
command:
*snmpget -v 2c -c public localhost POMI-MOBILITY-MIB::txpower.0*
I got
*POMI-MOBILITY-MIB::txpower.0 = STRING: -1*
However when I run the set command
*snmpset -v 2c -c public localhost POMI=MOBILITY-MIB::txpower.0 = "1"
I got
* Error in packet
* Reason : General failured occurred
This is the POMI-MOBILITY-MIB
+ txpower OBJECT-TYPE
+ SYNTAX SnmpAdminString
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "The current wifi IF transmission power."
+
+ DEFVAL { "So long, and thanks for all the fish!" }
+ ::= { wifi 2 }
This is the code for txpower for each every mode set request:
case MODE_SET_RESERVE1:
printf("txpower MODE_SET_RESERVE1\n");
/* or you could use netsnmp_check_vb_type_and_size instead */
ret = netsnmp_check_vb_type(requests->requestvb, ASN_OCTET_STR);
if ( ret != SNMP_ERR_NOERROR ) {
netsnmp_set_request_error(reqinfo, requests, ret );
}
break;
case MODE_SET_RESERVE2:
printf("txpower MODE_SET_RESERVE2\n");
/* malloc "undo" storage buffer */
if((skfd = iw_sockets_open()) < 0) {
netsnmp_set_request_error(reqinfo, requests,
SNMP_ERR_RESOURCEUNAVAILABLE);
}
break;
case MODE_SET_FREE:
printf("txpower MODE_SET_FREE\n");
/* free resources allocated in RESERVE1 and/or
RESERVE2. Something failed somewhere, and the states
below won't be called. */
if(skfd >= 0)
iw_sockets_close(skfd);
break;
case MODE_SET_ACTION:
printf("txpower MODE_SET_ACTION\n");
/* perform the value change here */
ret = set_txpower(skfd, INTERFACE,
(char**)&(requests->requestvb->val.string), 1);
if (ret <= 0) {
netsnmp_set_request_error(reqinfo, requests, ret);
}
break;
case MODE_SET_COMMIT:
printf("txpower MODE_SET_COMMIT\n");
/* delete temporary storage */
if(skfd >= 0)
iw_sockets_close(skfd);
break;
case MODE_SET_UNDO:
printf("txpower MODE_SET_UNDO\n");
break;
default:
/* we should never get here, so this is a really bad error */
snmp_log(LOG_ERR, "unknown mode (%d) in handle_txpower\n",
reqinfo->mode );
return SNMP_ERR_GENERR;
}
printf("txpower - return\n");
return SNMP_ERR_NOERROR;
}
I would really appreciate for any help.
Thanks.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users