[unisog] SNMP question : The data type returned by querying a CISCO switch for MacAddress.

PaulFM paulfm at me.umn.edu
Sun Oct 23 14:58:03 GMT 2005


Well, It takes 6 bytes (0xFF is one byte) to represent A MAC address as 
integer, And of course on any port there may be several MAC addresses, so it 
either is a character representation of the macs (with delimiters) or an 
array of 6 or 8 byte integers.  I would try reading it as a string of 
characters and see what it looks like (if it is really integer you will know 
when you check the values).

Have you tried the program snmpget on the OID to see what it returns?


Coby_Cai at DELL.com wrote:
> Hi, greetings,
> 
> Can anyone tell me which data type is returned when querying a CISCO
> switch for the MacAddress of the system connected to it?
> 
> The OID is .1.3.6.1.2.1.17.4.3.1.2. And use getnext query type. I use
> below command to get result in C#.
> Result = SnmpInterface.SnmpGetVb(vbl, 1, ref rgetOid, ref rgetValue);
> 
> Here rgetOid is a point to structure 
> public struct smiOID
> 		{
> 			public int len; // object identifier length in
> bytes
> 			public int ptr; // object identifier address
> 		}
> 
> and rgetValue is a point to structure
> public struct smiVALUEOCTET
> 		{
> 			// Also BITS, OPAQUE, IPADDR & NSAPADDR
> 			public int syntax;// syntax type
> 			public smiOCTET octetv;// value of type
> 		}
> 
> 		// Also: BITS, IPADDR, OPAQUE & NSAPADDR
> 		public struct smiOCTET
> 		{
> 			public int len; // octet value length in bytes
> 			public int ptr; // octet value address
> 		}
> 
> Please help me to get the MacAddress by this. Thanks for your attension.
> 
> Thanks.
> coby
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> unisog mailing list
> unisog at lists.sans.org
> http://www.dshield.org/mailman/listinfo/unisog

-- 
---------------------------------------------------------------------
The views and opinions expressed above are strictly
those of the author(s).  The content of this message has
not been reviewed nor approved by any entity whatsoever.
---------------------------------------------------------------------
Paul F. Markfort   Info/Web: http://www.menet.umn.edu/~paulfm
---------------------------------------------------------------------


More information about the unisog mailing list