Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-snmp.h
1/* Do not modify this file. Changes will be overwritten. */
2/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3/* packet-snmp.h */
4/* asn2wrs.py -b -q -L -p snmp -c ./snmp.cnf -s ./packet-snmp-template -D . -O ../.. snmp.asn */
5
6/* packet-snmp.h
7 * Routines for snmp packet dissection
8 *
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <[email protected]>
11 * Copyright 1998 Gerald Combs
12 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
14 */
15
16#ifndef PACKET_SNMP_H
17#define PACKET_SNMP_H
18
19#define SNMP_REQ_GET 0
20#define SNMP_REQ_GETNEXT 1
21#define SNMP_REQ_SET 3
22#define SNMP_REQ_GETBULK 5
23#define SNMP_REQ_INFORM 6
24
25#define SNMP_RES_GET 2
26
27#define SNMP_TRAP 4
28#define SNMP_TRAPV2 7
29#define SNMP_REPORT 8
30
31typedef struct _snmp_usm_key {
32 uint8_t* data;
33 unsigned len;
35
38
39typedef tvbuff_t* (*snmp_usm_decoder_t)(snmp_usm_params_t*, tvbuff_t* encryptedData, packet_info *pinfo, char const** error);
40
41typedef enum _snmp_usm_auth_model_t {
42 SNMP_USM_AUTH_MD5 = 0,
43 SNMP_USM_AUTH_SHA1,
44 SNMP_USM_AUTH_SHA2_224,
45 SNMP_USM_AUTH_SHA2_256,
46 SNMP_USM_AUTH_SHA2_384,
47 SNMP_USM_AUTH_SHA2_512
48} snmp_usm_auth_model_t;
49
50typedef struct _snmp_user_t {
51 snmp_usm_key_t userName;
52
53 snmp_usm_auth_model_t authModel;
54 snmp_usm_key_t authPassword;
55 snmp_usm_key_t authKey;
56
57 snmp_usm_decoder_t privProtocol;
58 snmp_usm_key_t privPassword;
59 snmp_usm_key_t privKey;
61
62typedef struct {
63 uint8_t* data;
64 unsigned len;
66
68 snmp_user_t user;
69 snmp_engine_id_t engine;
70 unsigned auth_model;
71 unsigned priv_proto;
72 unsigned priv_key_exp;
73 struct _snmp_ue_assoc_t* next;
74};
75
77 bool authenticated;
78 bool encrypted;
79 unsigned start_offset;
80 unsigned auth_offset;
81
82 uint32_t boots;
83 uint32_t snmp_time;
84 tvbuff_t* engine_tvb;
85 tvbuff_t* user_tvb;
86 proto_item* auth_item;
87 tvbuff_t* auth_tvb;
88 tvbuff_t* priv_tvb;
89 tvbuff_t* msg_tvb;
90 snmp_ue_assoc_t* user_assoc;
91
92 bool authOK;
93};
94
95typedef struct snmp_request_response {
96 uint32_t request_frame_id;
97 uint32_t response_frame_id;
98 nstime_t request_time;
99 unsigned requestId;
100 unsigned request_procedure_id;
102
103/*
104 * Guts of the SNMP dissector - exported for use by protocols such as
105 * ILMI.
106 */
107extern unsigned dissect_snmp_pdu(tvbuff_t *, int, packet_info *, proto_tree *tree,
108 int, int, bool);
109extern int dissect_snmp_engineid(proto_tree *, packet_info *, tvbuff_t *, int, int);
110
111/*#include "packet-snmp-exp.h"*/
112
113#endif /* PACKET_SNMP_H */
Definition packet_info.h:43
Definition proto.h:901
Definition packet-snmp.h:67
Definition packet-snmp.h:50
Definition packet-snmp.h:31
Definition packet-snmp.h:76
Definition nstime.h:26
Definition packet-snmp.h:62
Definition packet-snmp.h:95
Definition tvbuff-int.h:35