Lines Matching defs:resp

474 table_check_response(struct tabwork *work, const struct snmp_pdu *resp)
479 if (resp->error_status != SNMP_ERR_NOERROR) {
481 resp->error_status == SNMP_ERR_NOSUCHNAME &&
482 resp->error_index ==
488 resp->error_status, resp->error_index);
492 for (b = resp->bindings; b < resp->bindings + resp->nbindings; b++) {
493 if (work->descr->last_change.len != 0 && b == resp->bindings) {
567 struct snmp_pdu resp;
589 if (snmp_dialog(&work.pdu, &resp)) {
593 if ((ret = table_check_response(&work, &resp)) == 0) {
594 snmp_pdu_free(&resp);
598 snmp_pdu_free(&resp);
603 snmp_pdu_free(&resp);
608 resp.bindings[resp.nbindings - 1].var;
610 snmp_pdu_free(&resp);
632 table_cb(struct snmp_pdu *req __unused, struct snmp_pdu *resp, void *arg)
637 if (resp == NULL) {
646 if ((ret = table_check_response(work, resp)) == 0) {
648 snmp_pdu_free(resp);
682 snmp_pdu_free(resp);
691 snmp_pdu_free(resp);
698 resp->bindings[resp->nbindings - 1].var;
700 snmp_pdu_free(resp);
1480 snmp_deliver_packet(struct snmp_pdu * resp)
1484 if (resp->type != SNMP_PDU_RESPONSE) {
1485 warn("ignoring snmp pdu %u", resp->type);
1490 if (listentry->reqid == resp->request_id)
1496 listentry->callback(listentry->pdu, resp, listentry->arg);
1510 struct snmp_pdu * resp;
1514 resp = malloc(sizeof(struct snmp_pdu));
1515 if (resp == NULL) {
1520 if ((ret = snmp_receive_packet(resp, blocking ? NULL : &tv)) <= 0) {
1521 free(resp);
1524 ret = snmp_deliver_packet(resp);
1525 snmp_pdu_free(resp);
1526 free(resp);
1539 ok_getnext(const struct snmp_pdu * req, const struct snmp_pdu * resp)
1543 if (resp->version != req->version) {
1548 if (resp->error_status == SNMP_ERR_NOSUCHNAME)
1551 if (resp->error_status != SNMP_ERR_NOERROR) {
1552 warnx("SNMP GETNEXT: error %d", resp->error_status);
1555 if (resp->nbindings != req->nbindings) {
1561 &resp->bindings[i].var)) {
1567 if (resp->version != SNMP_V1 &&
1568 resp->bindings[i].syntax == SNMP_SYNTAX_ENDOFMIBVIEW)
1571 if (resp->bindings[i].syntax != req->bindings[i].syntax) {
1586 ok_get(const struct snmp_pdu * req, const struct snmp_pdu * resp)
1590 if (resp->version != req->version) {
1595 if (resp->error_status == SNMP_ERR_NOSUCHNAME)
1598 if (resp->error_status != SNMP_ERR_NOERROR) {
1599 warnx("SNMP GET: error %d", resp->error_status);
1603 if (resp->nbindings != req->nbindings) {
1609 &resp->bindings[i].var) != 0) {
1614 (resp->bindings[i].syntax == SNMP_SYNTAX_NOSUCHOBJECT ||
1615 resp->bindings[i].syntax == SNMP_SYNTAX_NOSUCHINSTANCE))
1617 if (resp->bindings[i].syntax != req->bindings[i].syntax) {
1632 ok_set(const struct snmp_pdu * req, const struct snmp_pdu * resp)
1636 if (resp->version != req->version) {
1641 if (resp->error_status == SNMP_ERR_NOSUCHNAME) {
1642 warnx("SNMP SET: error %d", resp->error_status);
1645 if (resp->error_status != SNMP_ERR_NOERROR) {
1646 warnx("SNMP SET: error %d", resp->error_status);
1650 if (resp->nbindings != req->nbindings) {
1656 &resp->bindings[i].var) != 0) {
1660 if (resp->bindings[i].syntax != req->bindings[i].syntax) {
1674 const struct snmp_pdu *resp)
1676 if (resp == NULL)
1682 return (ok_get(req, resp));
1685 return (ok_set(req, resp));
1688 return (ok_getnext(req, resp));
1695 snmp_dialog(struct snmp_v1_pdu *req, struct snmp_v1_pdu *resp)
1725 if ((ret = snmp_receive_packet(resp, &tv)) == 0)
1730 if (reqid == resp->request_id)
1733 (void)snmp_deliver_packet(resp);
1751 struct snmp_pdu req, resp;
1769 if (snmp_dialog(&req, &resp) == -1)
1772 if (resp.version != req.version) {
1777 if (resp.error_status != SNMP_ERR_NOERROR) {
1778 seterr(&snmp_client, "Error %d in response", resp.error_status);
1782 snmp_client.engine.engine_len = resp.engine.engine_len;
1783 snmp_client.engine.max_msg_size = resp.engine.max_msg_size;
1784 memcpy(snmp_client.engine.engine_id, resp.engine.engine_id,
1785 resp.engine.engine_len);
1801 if (resp.engine.engine_boots != 0)
1802 snmp_client.engine.engine_boots = resp.engine.engine_boots;
1804 if (resp.engine.engine_time != 0) {
1805 snmp_client.engine.engine_time = resp.engine.engine_time;
1815 if (snmp_dialog(&req, &resp) == -1)
1818 if (resp.version != req.version) {
1823 if (resp.error_status != SNMP_ERR_NOERROR) {
1824 seterr(&snmp_client, "Error %d in response", resp.error_status);
1828 snmp_client.engine.engine_boots = resp.engine.engine_boots;
1829 snmp_client.engine.engine_time = resp.engine.engine_time;
1832 snmp_pdu_free(&resp);