Rev 154 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 154 | Rev 155 | ||
|---|---|---|---|
| Line 125... | Line 125... | ||
| 125 | 125 | ||
| 126 | static SnmpObject snmpCommunityName[MaxCommunities]; |
126 | static SnmpObject snmpCommunityName[MaxCommunities]; |
| 127 | 127 | ||
| 128 | //static double snmpSetDouble(HSNMP session, const SnmpObject &object, double value); |
128 | //static double snmpSetDouble(HSNMP session, const SnmpObject &object, double value); |
| 129 | static double snmpSetDouble(HSNMP session, const SnmpObject *object, double value); |
129 | static double snmpSetDouble(HSNMP session, const SnmpObject *object, double value); |
| 130 | double snmpGetDouble(HSNMP session, const SnmpObject *object); |
130 | static double snmpGetDouble(HSNMP session, const SnmpObject *object); |
| 131 | static int snmpSetInt(HSNMP session, const SnmpObject *object, int value); |
131 | static int snmpSetInt(HSNMP session, const SnmpObject *object, int value); |
| 132 | int snmpGetInt(HSNMP session, const SnmpObject *object); |
132 | static int snmpGetInt(HSNMP session, const SnmpObject *object); |
| 133 | static char *snmpGetString(HSNMP session, const SnmpObject *object); |
133 | static char *snmpGetString(HSNMP session, const SnmpObject *object); |
| 134 | 134 | ||
| 135 | char snmpStringBuffer[1024]; |
135 | char snmpStringBuffer[1024]; |
| 136 | char snmpLastErrorBuffer[1024]; |
136 | char snmpLastErrorBuffer[1024]; |
| 137 | 137 | ||
| Line 182... | Line 182... | ||
| 182 | * @param node e.g. "sysMainSwitch" |
182 | * @param node e.g. "sysMainSwitch" |
| 183 | * @param object the resolved OID |
183 | * @param object the resolved OID |
| 184 | * @return true on success, false otherwise |
184 | * @return true on success, false otherwise |
| 185 | */ |
185 | */ |
| 186 | //static int getNode(const char * const node, SnmpObject *object) |
186 | //static int getNode(const char * const node, SnmpObject *object) |
| 187 | int getNode(const char * const node, SnmpObject *object) |
187 | static int getNode(const char * const node, SnmpObject *object) |
| 188 | { |
188 | { |
| 189 | object->len = MAX_OID_LEN; |
189 | object->len = MAX_OID_LEN; |
| 190 | if (!get_node(node, object->id, &object->len)) { |
190 | if (!get_node(node, object->id, &object->len)) { |
| 191 | snmp_log(LOG_ERR, "OID %s not found!\n", node); |
191 | snmp_log(LOG_ERR, "OID %s not found!\n", node); |
| 192 | return false; |
192 | return false; |
| Line 1742... | Line 1742... | ||
| 1742 | struct snmp_pdu *pdu = snmp_pdu_create(SNMP_MSG_GET); |
1742 | struct snmp_pdu *pdu = snmp_pdu_create(SNMP_MSG_GET); |
| 1743 | 1743 | ||
| 1744 | return pdu; |
1744 | return pdu; |
| 1745 | } |
1745 | } |
| 1746 | 1746 | ||
| 1747 | int snmpGetInt(HSNMP session, const SnmpObject *object) |
1747 | static int snmpGetInt(HSNMP session, const SnmpObject *object) |
| 1748 | { |
1748 | { |
| 1749 | int value = 0; |
1749 | int value = 0; |
| 1750 | 1750 | ||
| 1751 | struct snmp_pdu *pdu = prepareGetRequestPdu(); |
1751 | struct snmp_pdu *pdu = prepareGetRequestPdu(); |
| 1752 | 1752 | ||
| Line 1788... | Line 1788... | ||
| 1788 | 1788 | ||
| 1789 | snmp_free_pdu(response); |
1789 | snmp_free_pdu(response); |
| 1790 | return result; |
1790 | return result; |
| 1791 | } |
1791 | } |
| 1792 | 1792 | ||
| 1793 | double snmpGetDouble(HSNMP session, const SnmpObject *object) |
1793 | static double snmpGetDouble(HSNMP session, const SnmpObject *object) |
| 1794 | { |
1794 | { |
| 1795 | double value = 0.0; |
1795 | double value = 0.0; |
| 1796 | 1796 | ||
| 1797 | struct snmp_pdu *pdu = prepareGetRequestPdu(); |
1797 | struct snmp_pdu *pdu = prepareGetRequestPdu(); |
| 1798 | 1798 | ||