---
title: "agentx协议格式"
author: "fanrey"
date: "2014-04-22T22:23:54Z"
tags: []
categories: ["开源软件"]
slug: "agentx"
draft: false
lastmod: "2014-04-22T22:23:54Z"
id: 2052891
url: "https://fanrey.iteye.com/blog/2052891"
---

agentx协议格式： AgentX PDU Header +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | h.version | h.type | h.flags | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | h.sessionID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | h.transactionID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | h.packetID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | h.payload\_length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 如下为对应的实际数据包 0: 0101 0000 0000 0000 0000 0000 012d 4865 .............-He 16: 3c00 0000 0000 0000 0504 0000 0100 0000 &lt;............... 32: 881f 0000 0300 0000 0200 0000 0300 0000 ?.............. 48: 1900 0000 4e65 742d 534e 4d50 2041 6765 ....Net-SNMP Age 64: 6e74 5820 7375 622d 6167 656e 7400 0000 ntX sub-agent... 01--h.version 01--h.type 3c--h.payload\_length h.type The PDU type; one of the following values: agentx-Open-PDU (1), agentx-Close-PDU (2), agentx-Register-PDU (3), agentx-Unregister-PDU (4), agentx-Get-PDU (5), agentx-GetNext-PDU (6), agentx-GetBulk-PDU (7), agentx-TestSet-PDU (8), agentx-CommitSet-PDU (9), agentx-UndoSet-PDU (10), agentx-CleanupSet-PDU (11), agentx-Notify-PDU (12), agentx-Ping-PDU (13), agentx-IndexAllocate-PDU (14), agentx-IndexDeallocate-PDU (15), agentx-AddAgentCaps-PDU (16), agentx-RemoveAgentCaps-PDU (17), agentx-Response-PDU (18) 关于agentx协议的具体格式和说明可以查rfc2257文档