Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / asn1 / snmp / packet-snmp-template.h
blob2a7ffc561f8d0d540dbc65d2a9c35ffcad79a6f9
1 /* packet-snmp.h
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
9 */
11 #ifndef PACKET_SNMP_H
12 #define PACKET_SNMP_H
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
22 #define SNMP_TRAP 4
23 #define SNMP_TRAPV2 7
24 #define SNMP_REPORT 8
26 typedef struct _snmp_usm_key {
27 uint8_t* data;
28 unsigned len;
29 } snmp_usm_key_t;
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,
38 SNMP_USM_AUTH_SHA1,
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;
55 } snmp_user_t;
57 typedef struct {
58 uint8_t* data;
59 unsigned len;
60 } snmp_engine_id_t;
62 struct _snmp_ue_assoc_t {
63 snmp_user_t user;
64 snmp_engine_id_t engine;
65 unsigned auth_model;
66 unsigned priv_proto;
67 unsigned priv_key_exp;
68 struct _snmp_ue_assoc_t* next;
71 struct _snmp_usm_params_t {
72 bool authenticated;
73 bool encrypted;
74 unsigned start_offset;
75 unsigned auth_offset;
77 uint32_t boots;
78 uint32_t snmp_time;
79 tvbuff_t* engine_tvb;
80 tvbuff_t* user_tvb;
81 proto_item* auth_item;
82 tvbuff_t* auth_tvb;
83 tvbuff_t* priv_tvb;
84 tvbuff_t* msg_tvb;
85 snmp_ue_assoc_t* user_assoc;
87 bool authOK;
90 typedef struct snmp_request_response {
91 uint32_t request_frame_id;
92 uint32_t response_frame_id;
93 nstime_t request_time;
94 unsigned requestId;
95 unsigned request_procedure_id;
96 } snmp_request_response_t;
99 * Guts of the SNMP dissector - exported for use by protocols such as
100 * ILMI.
102 extern unsigned dissect_snmp_pdu(tvbuff_t *, int, packet_info *, proto_tree *tree,
103 int, int, bool);
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 */