Wireshark  2.9.0-477-g68ec514b
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 -p snmp -c ./snmp.cnf -s ./packet-snmp-template -D . -O ../.. snmp.asn */
5 
6 /* Input file: packet-snmp-template.h */
7 
8 #line 1 "./asn1/snmp/packet-snmp-template.h"
9 /* packet-snmp.h
10  * Routines for snmp packet dissection
11  *
12  * Wireshark - Network traffic analyzer
13  * By Gerald Combs <gerald@wireshark.org>
14  * Copyright 1998 Gerald Combs
15  *
16  * SPDX-License-Identifier: GPL-2.0-or-later
17  */
18 
19 #ifndef PACKET_SNMP_H
20 #define PACKET_SNMP_H
21 
22 typedef struct _snmp_usm_key {
23  guint8* data;
24  guint len;
26 
27 typedef struct _snmp_ue_assoc_t snmp_ue_assoc_t;
29 
30 typedef tvbuff_t* (*snmp_usm_decoder_t)(snmp_usm_params_t*, tvbuff_t* encryptedData, packet_info *pinfo, gchar const** error);
31 
32 typedef enum _snmp_usm_auth_model_t {
33  SNMP_USM_AUTH_MD5 = 0,
34  SNMP_USM_AUTH_SHA1,
35  SNMP_USM_AUTH_SHA2_224,
36  SNMP_USM_AUTH_SHA2_256,
37  SNMP_USM_AUTH_SHA2_384,
38  SNMP_USM_AUTH_SHA2_512
39 } snmp_usm_auth_model_t;
40 
41 typedef struct _snmp_user_t {
42  snmp_usm_key_t userName;
43 
44  snmp_usm_auth_model_t authModel;
45  snmp_usm_key_t authPassword;
46  snmp_usm_key_t authKey;
47 
48  snmp_usm_decoder_t privProtocol;
49  snmp_usm_key_t privPassword;
50  snmp_usm_key_t privKey;
51 } snmp_user_t;
52 
53 typedef struct {
54  guint8* data;
55  guint len;
57 
58 struct _snmp_ue_assoc_t {
59  snmp_user_t user;
60  snmp_engine_id_t engine;
61  guint auth_model;
62  guint priv_proto;
63  struct _snmp_ue_assoc_t* next;
64 };
65 
66 struct _snmp_usm_params_t {
67  gboolean authenticated;
68  gboolean encrypted;
69  guint start_offset;
70  guint auth_offset;
71 
72  guint32 boots;
73  guint32 snmp_time;
74  tvbuff_t* engine_tvb;
75  tvbuff_t* user_tvb;
76  proto_item* auth_item;
77  tvbuff_t* auth_tvb;
78  tvbuff_t* priv_tvb;
79  tvbuff_t* msg_tvb;
80  snmp_ue_assoc_t* user_assoc;
81 
82  gboolean authOK;
83 };
84 
85 /*
86  * Guts of the SNMP dissector - exported for use by protocols such as
87  * ILMI.
88  */
89 extern guint dissect_snmp_pdu(tvbuff_t *, int, packet_info *, proto_tree *tree,
90  int, gint, gboolean);
91 extern int dissect_snmp_engineid(proto_tree *, packet_info *, tvbuff_t *, int, int);
92 
93 /*#include "packet-snmp-exp.h"*/
94 
95 #endif /* PACKET_SNMP_H */
Definition: packet-snmp-template.h:45
Definition: packet-snmp-template.h:50
Definition: packet_info.h:44
Definition: packet-snmp-template.h:14
Definition: tvbuff-int.h:35
Definition: packet-snmp-template.h:58
Definition: packet-snmp-template.h:33
Definition: proto.h:759