Wireshark  4.3.0
The Wireshark network protocol analyzer
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 <gerald@wireshark.org>
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 
31 typedef struct _snmp_usm_key {
32  guint8* data;
33  guint len;
35 
36 typedef struct _snmp_ue_assoc_t snmp_ue_assoc_t;
38 
39 typedef tvbuff_t* (*snmp_usm_decoder_t)(snmp_usm_params_t*, tvbuff_t* encryptedData, packet_info *pinfo, gchar const** error);
40 
41 typedef 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 
50 typedef 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;
60 } snmp_user_t;
61 
62 typedef struct {
63  guint8* data;
64  guint len;
66 
68  snmp_user_t user;
69  snmp_engine_id_t engine;
70  guint auth_model;
71  guint priv_proto;
72  struct _snmp_ue_assoc_t* next;
73 };
74 
76  gboolean authenticated;
77  gboolean encrypted;
78  guint start_offset;
79  guint auth_offset;
80 
81  guint32 boots;
82  guint32 snmp_time;
83  tvbuff_t* engine_tvb;
84  tvbuff_t* user_tvb;
85  proto_item* auth_item;
86  tvbuff_t* auth_tvb;
87  tvbuff_t* priv_tvb;
88  tvbuff_t* msg_tvb;
89  snmp_ue_assoc_t* user_assoc;
90 
91  gboolean authOK;
92 };
93 
94 typedef struct snmp_request_response {
95  guint32 request_frame_id;
96  guint32 response_frame_id;
97  nstime_t request_time;
98  guint requestId;
99  guint request_procedure_id;
101 
102 /*
103  * Guts of the SNMP dissector - exported for use by protocols such as
104  * ILMI.
105  */
106 extern guint dissect_snmp_pdu(tvbuff_t *, int, packet_info *, proto_tree *tree,
107  int, gint, gboolean);
108 extern int dissect_snmp_engineid(proto_tree *, packet_info *, tvbuff_t *, int, int);
109 
110 /*#include "packet-snmp-exp.h"*/
111 
112 #endif /* PACKET_SNMP_H */
Definition: packet_info.h:44
Definition: proto.h:904
Definition: packet-snmp.h:67
Definition: packet-snmp.h:50
Definition: packet-snmp.h:31
Definition: packet-snmp.h:75
Definition: nstime.h:26
Definition: packet-snmp.h:62
Definition: packet-snmp.h:94
Definition: tvbuff-int.h:35