package org.snmp4j.agent;

import org.snmp4j.CommandResponderEvent;
import org.snmp4j.PDU;
import org.snmp4j.agent.mo.snmp.CoexistenceInfo;
import org.snmp4j.agent.request.SnmpRequest;
import org.snmp4j.smi.OctetString;

/* JADX INFO: loaded from: classes.dex */
public class ProxyForwardRequest {
    private CoexistenceInfo coexistenceInfo;
    private CommandResponderEvent commandEvent;
    private int proxyType;
    private PDU responsePDU;

    public ProxyForwardRequest(CommandResponderEvent commandResponderEvent, CoexistenceInfo coexistenceInfo) {
        this.commandEvent = commandResponderEvent;
        this.coexistenceInfo = coexistenceInfo;
        setProxyType();
    }

    private void setProxyType() {
        int viewType = SnmpRequest.getViewType(this.commandEvent.getPDU().getType());
        if (viewType != 0) {
            if (viewType != 2) {
                this.proxyType = 1;
                return;
            } else {
                this.proxyType = 2;
                return;
            }
        }
        if (this.commandEvent.getPDU().getType() == -90) {
            this.proxyType = 4;
        } else {
            this.proxyType = 3;
        }
    }

    public CoexistenceInfo getCoexistenceInfo() {
        return this.coexistenceInfo;
    }

    public CommandResponderEvent getCommandEvent() {
        return this.commandEvent;
    }

    public OctetString getContext() {
        return this.coexistenceInfo.getContextName();
    }

    public OctetString getContextEngineID() {
        return this.coexistenceInfo.getContextEngineID();
    }

    public int getProxyType() {
        return this.proxyType;
    }

    public PDU getResponsePDU() {
        return this.responsePDU;
    }

    public OctetString getSecurityName() {
        return this.coexistenceInfo.getSecurityName();
    }

    public void setResponsePDU(PDU pdu) {
        this.responsePDU = pdu;
    }

    public String toString() {
        return ProxyForwardRequest.class.getName() + "[coexistenceInfo=" + this.coexistenceInfo + ",proxyType=" + this.proxyType + ",commandEvent=" + this.commandEvent + "]";
    }
}
