[SNMP4J] Question about MacAddress
Doug Fischer
dgf at dfischer.com
Thu May 24 17:46:14 CEST 2007
Ok, I understand much better now. So here is my issue now, basically
what I am doing is splitting the OctetString and then reading each
one (by just doing a simple toString() on it) and appending that to a
StringBuffer. What I am seeing is that this works for the first 5
elements of the MacAddress, but the 6th is not correct (shows up as
something like 30:30:00 instead of 00, or 46:43:00 instead of FC).
Why is that? Maybe this is not the correct approach.
Thanks,
Doug
On May 23, 2007, at 1:22 PM, snmpguru wrote:
> MacAddress is a TEXTUAL-CONVENTION, not a "native" variable type.
> It is
> defined in SNMPV2-TC:
>
> MacAddress ::= TEXTUAL-CONVENTION
> DISPLAY-HINT "1x:"
> STATUS current
> DESCRIPTION
> "Represents an 802 MAC address represented in the
> `canonical' order defined by IEEE 802.1a, i.e., as if it
> were transmitted least significant bit first, even though
> 802.5 (in contrast to other 802.x protocols) requires MAC
> addresses to be transmitted most significant bit first."
> SYNTAX OCTET STRING (SIZE (6))
>
> As you can see, a MacAddress is an OCTET STRING that is comprised of 6
> octets. At the PDU level SNMP only knows this is an OCTET STRING,
> it the
> responsibility of an SNMP manager (this is the piece you are
> writing) to
> determine that this is in fact a respresentation of a MAC address
> (usually
> from some form of loaded and compilied MIB, but it could be
> hardcoded).
>
> Rob
>
>
> -----Original Message-----
> From: snmp4j-bounces at agentpp.org [mailto:snmp4j-
> bounces at agentpp.org] On
> Behalf Of Doug Fischer
> Sent: Wednesday, May 23, 2007 12:30 PM
> To: snmp4j at agentpp.org
> Subject: [SNMP4J] Question about MacAddress
>
> I am making a request to get the mac address of a device. When
> this is
> returned it is of type OctetString, in the mib file, its syntax is
> MacAddress. Why does this come to me as an OctetString? Why is
> there no
> MacAddress variable type in SNMP4J? How can I deal with this?
>
> Thank you,
> Doug
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
>
>
More information about the SNMP4J
mailing list