标识域(tag)的编码规则
标识域指明数据的类型,占用1个字节,常见的类型有:
BOOL(0x01);INT(0x02);OCTSTR(0x04);NULL(0x05);
OBJID(0x06);ENUM(0x0A);SEQ(0x30);SETOF(0x31);
IPADDR(0x40);COUNTER(0x41);GAUGE(0x42);
TIMETICKS(0x43);OPAQUE(0x44)。
UDP 数据部分
综述:30 2e(t=30[seq],len=2e[46],v=)
版本: 02 01 00 (t=02[数字],len=1,value=version)
团体: 04 07 70 72 69 76 61 74 65 (t=04[str],len=7,value=community)
PDU类型 a1 20(t=a1=get-next-requext,len=20[32],v=
request-id 02 02 06 59 (t=数字,len=2,v=06 59:request-id=1625)
error-stat 02 01 00 (t=数字,len=1,v=1:error-status=0)
error-idx 02 01 00 (t=数字,len=1,v=1:error-index=0)
var-binds 30 14 (t=30[seq],len=14[20],v=
30 12 (t=30[seq],len=12[18,v=
06 0e (t=06[obj],len=0e[14],v=
2b 06 01 04 01 81 c7 22 02 0c 01 01 01 01
1.3 .6 .1 .4 .1 .25506 .2.12 .1 .1 .1 .1
(40x+y=2b)
05 00 (表示seq中的null成员)
25506=1x128^2(16384)+9122=1x128^2(16384)+71*128(9088)+34
=[1,71,34]
+=128=[129,199,34]//除最后一byte外,前者高位置1(+=128)
hex =[81,c7,22]
笔记-SNMP
最新推荐文章于 2024-10-12 10:14:53 发布