[SNMP4J] problem with BITS type

Tzahi Bergman tzahi at alcarmel.com
Mon Oct 20 10:24:17 CEST 2008


I've implemented the BITS like regular OctetString(i wrote that if it's
BITS then cast it into OctetString).

I also used agenPro to create java files from the mib definition.
In the class that represent this table the BITS was implemented like
this:
 
public static final class WmanIf2BsQoSReqTxPolicyEnum {
    public static final int noBroadcastBwReq = 0;
    public static final int reserved1 = 1;
    public static final int noPiggybackReq = 2;
    public static final int noFragmentData = 3;
    public static final int noPHS = 4;
    public static final int noSduPacking = 5;
    public static final int noCrc = 6;
    public static final int reserved2 = 7;
  } 

ValueConstraint wmanIf2BsQoSReqTxPolicyVC = new EnumerationConstraint(
      new int[] { WmanIf2BsQoSReqTxPolicyEnum.noBroadcastBwReq,
                  WmanIf2BsQoSReqTxPolicyEnum.reserved1,
                  WmanIf2BsQoSReqTxPolicyEnum.noPiggybackReq,
                  WmanIf2BsQoSReqTxPolicyEnum.noFragmentData,
                  WmanIf2BsQoSReqTxPolicyEnum.noPHS,
                  WmanIf2BsQoSReqTxPolicyEnum.noSduPacking,
                  WmanIf2BsQoSReqTxPolicyEnum.noCrc,
                  WmanIf2BsQoSReqTxPolicyEnum.reserved2 });


((MOMutableColumn)wmanIf2BsServiceClassEntryColumns[idxWmanIf2BsQoSReqTxPolicy]).
      addMOValueValidationListener(new
ValueConstraintValidator(wmanIf2BsQoSReqTxPolicyVC));


On Thu, 2008-10-16 at 22:53 +0200, Frank Fock wrote:
> OK, and how did you implement the BITS type
> in the agent?
> 
> Best regards,
> Frank
> 
> Tzahi Bergman wrote:
> > That's exactly what i did, and it didn't work.
> > 
> > 
> > On Thu, 2008-10-16 at 00:07 +0200, Frank Fock wrote:
> >> Hi,
> >>
> >> You need to send an OCTET STRING with a single
> >> byte (length = 1).
> >>
> >> Best regards,
> >> Frank
> >>
> >> Tzahi Bergman wrote:
> >>> I've tried to insert many combinations in order for it to work for
> >>> example: 
> >>> 1. I tried to insert byte array with single value(like 0x1 and values
> >>> like that).
> >>> 2. I've tried to insert String like 0000001 or 1000000.
> >>> 3. And of course the regular values like 1 or 2....
> >>>
> >>> As for the agent i use the latest version of snmp4j agent.
> >>>
> >>> Thanks,
> >>> Tzahi Bergman
> >>>
> >>>
> >>>  
> >>> On Tue, 2008-10-14 at 09:49 +0200, Frank Fock wrote:
> >>>> Hi Tzahi,
> >>>>
> >>>> how does the string you are trying to set looks like?
> >>>> What kind of agent is used?
> >>>>
> >>>> Best regards,
> >>>> Frank
> >>>>
> >>>> Tzahi Bergman wrote:
> >>>>> Hi,
> >>>>> I got a problem when I'm trying to do a "set" for object that is type
> >>>>> BITS.
> >>>>> I have read the discussion about BITS that the BITS is OCTET STRING and
> >>>>> this is how i should treat it, but it doesn't work.
> >>>>> the error that i got while trying to do the "set" is:
> >>>>>  errorStatus=Request PDU has incorrect length(8)
> >>>>>
> >>>>> in my last mail you told me that without the mib definition it's hard to
> >>>>> tell what is the problem, so I'm pasting the mib definition of that
> >>>>> table in hope that someone can help me with this.
> >>>>>
> >>>>> Mib Definition:
> >>>>> ===============
> >>>>>
> >>>>> WmanIf2BsServiceClassEntry ::= SEQUENCE {
> >>>>>         wmanIf2BsQoSProfileIndex                INTEGER,
> >>>>>         wmanIf2BsQosServiceClassName            WmanIf2ServClassName,
> >>>>>         wmanIf2BsQoSTrafficPriority             INTEGER,
> >>>>>         wmanIf2BsQoSMaxSustainedRate            Unsigned32,
> >>>>>         wmanIf2BsQoSMaxTrafficBurst             Unsigned32,
> >>>>>         wmanIf2BsQoSMinReservedRate             Unsigned32,
> >>>>>         wmanIf2BsQoSToleratedJitter             Unsigned32,
> >>>>>         wmanIf2BsQoSMaxLatency                  Unsigned32,
> >>>>>         wmanIf2BsQoSFixedVsVariableSduInd       INTEGER,            
> >>>>>         wmanIf2BsQoSSduSize                     Unsigned32,
> >>>>>         wmanIf2BsQosScSchedulingType            WmanIf2SfSchedulingType,
> >>>>>         wmanIf2BsQosScArqEnable                 TruthValue,
> >>>>>         wmanIf2BsQosScArqWindowSize             INTEGER,
> >>>>>         wmanIf2BsQosScArqBlockLifetime          INTEGER,
> >>>>>         wmanIf2BsQosScArqSyncLossTimeout        INTEGER,
> >>>>>         wmanIf2BsQosScArqDeliverInOrder         TruthValue,
> >>>>>         wmanIf2BsQosScArqRxPurgeTimeout         INTEGER,
> >>>>>         wmanIf2BsQosScArqBlockSize              INTEGER,
> >>>>>         wmanIf2BsQosSCMinRsvdTolerableRate      Unsigned32,
> >>>>>         wmanIf2BsQoSReqTxPolicy                 BITS,
> >>>>>         wmanIf2BsQoSServiceClassRowStatus       RowStatus}
> >>>>>
> >>>>>
> >>>>> wmanIf2BsQoSReqTxPolicy OBJECT-TYPE
> >>>>>         SYNTAX      BITS {noBroadcastBwReq(0),
> >>>>>                           reserved1(1),
> >>>>>                           noPiggybackReq(2),
> >>>>>                           noFragmentData(3),
> >>>>>                           noPHS(4),
> >>>>>                           noSduPacking(5),
> >>>>>                           noCrc(6),
> >>>>>                           reserved2(7)} 
> >>>>>         MAX-ACCESS  read-create
> >>>>>         STATUS      current
> >>>>>         DESCRIPTION
> >>>>>             "The value of this parameter provides the capability to
> >>>>>              specify certain attributes for the associated service
> >>>>>              flow. An attribute is enabled by setting the
> >>>>>              corresponding bit position to 1."
> >>>>>         REFERENCE   "Subclause 11.13.12 in IEEE Std 802.16-2004"
> >>>>>         ::= { wmanIf2BsServiceClassEntry 20 }
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> SNMP4J mailing list
> >>>>> SNMP4J at agentpp.org
> >>>>> http://lists.agentpp.org/mailman/listinfo/snmp4j
> > 
> 




More information about the SNMP4J mailing list