Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-snmp.h
blob7b0997ea70003e3ea864eb23186fda58498c8944
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 */
6 /* packet-snmp.h
7 * Routines for snmp packet dissection
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
16 #ifndef PACKET_SNMP_H
17 #define PACKET_SNMP_H
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
25 #define SNMP_RES_GET 2
27 #define SNMP_TRAP 4
28 #define SNMP_TRAPV2 7
29 #define SNMP_REPORT 8
31 typedef struct _snmp_usm_key {
32 uint8_t* data;
33 unsigned len;
34 } snmp_usm_key_t;
36 typedef struct _snmp_ue_assoc_t snmp_ue_assoc_t;
37 typedef struct _snmp_usm_params_t snmp_usm_params_t;
39 typedef tvbuff_t* (*snmp_usm_decoder_t)(snmp_usm_params_t*, tvbuff_t* encryptedData, packet_info *pinfo, char const** error);
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;
50 typedef struct _snmp_user_t {
51 snmp_usm_key_t userName;
53 snmp_usm_auth_model_t authModel;
54 snmp_usm_key_t authPassword;
55 snmp_usm_key_t authKey;
57 snmp_usm_decoder_t privProtocol;
58 snmp_usm_key_t privPassword;
59 snmp_usm_key_t privKey;
60 } snmp_user_t;
62 typedef struct {
63 uint8_t* data;
64 unsigned len;
65 } snmp_engine_id_t;
67 struct _snmp_ue_assoc_t {
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;
76 struct _snmp_usm_params_t {
77 bool authenticated;
78 bool encrypted;
79 unsigned start_offset;
80 unsigned auth_offset;
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;
92 bool authOK;
95 typedef 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;
101 } snmp_request_response_t;
104 * Guts of the SNMP dissector - exported for use by protocols such as
105 * ILMI.
107 extern unsigned dissect_snmp_pdu(tvbuff_t *, int, packet_info *, proto_tree *tree,
108 int, int, bool);
109 extern int dissect_snmp_engineid(proto_tree *, packet_info *, tvbuff_t *, int, int);
111 /*#include "packet-snmp-exp.h"*/
113 #endif /* PACKET_SNMP_H */