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