2 * Routines for snmp packet dissection
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
14 #define SNMP_REQ_GET 0
15 #define SNMP_REQ_GETNEXT 1
16 #define SNMP_REQ_SET 3
17 #define SNMP_REQ_GETBULK 5
18 #define SNMP_REQ_INFORM 6
20 #define SNMP_RES_GET 2
26 typedef struct _snmp_usm_key
{
31 typedef struct _snmp_ue_assoc_t snmp_ue_assoc_t
;
32 typedef struct _snmp_usm_params_t snmp_usm_params_t
;
34 typedef tvbuff_t
* (*snmp_usm_decoder_t
)(snmp_usm_params_t
*, tvbuff_t
* encryptedData
, packet_info
*pinfo
, char const** error
);
36 typedef enum _snmp_usm_auth_model_t
{
37 SNMP_USM_AUTH_MD5
= 0,
39 SNMP_USM_AUTH_SHA2_224
,
40 SNMP_USM_AUTH_SHA2_256
,
41 SNMP_USM_AUTH_SHA2_384
,
42 SNMP_USM_AUTH_SHA2_512
43 } snmp_usm_auth_model_t
;
45 typedef struct _snmp_user_t
{
46 snmp_usm_key_t userName
;
48 snmp_usm_auth_model_t authModel
;
49 snmp_usm_key_t authPassword
;
50 snmp_usm_key_t authKey
;
52 snmp_usm_decoder_t privProtocol
;
53 snmp_usm_key_t privPassword
;
54 snmp_usm_key_t privKey
;
62 struct _snmp_ue_assoc_t
{
64 snmp_engine_id_t engine
;
67 unsigned priv_key_exp
;
68 struct _snmp_ue_assoc_t
* next
;
71 struct _snmp_usm_params_t
{
74 unsigned start_offset
;
81 proto_item
* auth_item
;
85 snmp_ue_assoc_t
* user_assoc
;
90 typedef struct snmp_request_response
{
91 uint32_t request_frame_id
;
92 uint32_t response_frame_id
;
93 nstime_t request_time
;
95 unsigned request_procedure_id
;
96 } snmp_request_response_t
;
99 * Guts of the SNMP dissector - exported for use by protocols such as
102 extern unsigned dissect_snmp_pdu(tvbuff_t
*, int, packet_info
*, proto_tree
*tree
,
104 extern int dissect_snmp_engineid(proto_tree
*, packet_info
*, tvbuff_t
*, int, int);
106 /*#include "packet-snmp-exp.h"*/
108 #endif /* PACKET_SNMP_H */