Witness: enum witness_notifyResponse_type
[wireshark-wip.git] / asn1 / snmp / packet-snmp-template.h
blob6e2e4e816584b58a7dd7846b5b34351fb90ebbfb
1 /* packet-snmp.h
2 * Routines for snmp packet dissection
4 * $Id$
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #ifndef PACKET_SNMP_H
26 #define PACKET_SNMP_H
28 typedef struct _snmp_usm_key {
29 guint8* data;
30 guint len;
31 } snmp_usm_key_t;
33 typedef struct _snmp_ue_assoc_t snmp_ue_assoc_t;
34 typedef struct _snmp_usm_params_t snmp_usm_params_t;
36 typedef gboolean (*snmp_usm_authenticator_t)(snmp_usm_params_t*, guint8** calc_auth, guint* calc_auth_len, gchar const** error);
37 typedef tvbuff_t* (*snmp_usm_decoder_t)(snmp_usm_params_t*, tvbuff_t* encryptedData, gchar const** error);
38 typedef void (*snmp_usm_password_to_key_t)(const guint8 *password, guint passwordlen, const guint8 *engineID, guint engineLength, guint8 *key);
40 typedef struct _snmp_usm_auth_model_t {
41 snmp_usm_password_to_key_t pass2key;
42 snmp_usm_authenticator_t authenticate;
43 guint key_size;
44 } snmp_usm_auth_model_t;
46 typedef struct _snmp_user_t {
47 snmp_usm_key_t userName;
49 snmp_usm_auth_model_t* authModel;
50 snmp_usm_key_t authPassword;
51 snmp_usm_key_t authKey;
53 snmp_usm_decoder_t privProtocol;
54 snmp_usm_key_t privPassword;
55 snmp_usm_key_t privKey;
56 } snmp_user_t;
58 typedef struct {
59 guint8* data;
60 guint len;
61 } snmp_engine_id_t;
63 struct _snmp_ue_assoc_t {
64 snmp_user_t user;
65 snmp_engine_id_t engine;
66 guint auth_model;
67 guint priv_proto;
68 struct _snmp_ue_assoc_t* next;
71 struct _snmp_usm_params_t {
72 gboolean authenticated;
73 gboolean encrypted;
74 guint start_offset;
75 guint auth_offset;
77 guint32 boots;
78 guint32 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 gboolean authOK;
91 * Guts of the SNMP dissector - exported for use by protocols such as
92 * ILMI.
94 extern guint dissect_snmp_pdu(tvbuff_t *, int, packet_info *, proto_tree *tree,
95 int, gint, gboolean);
96 extern int dissect_snmp_engineid(proto_tree *, tvbuff_t *, int, int);
98 /*#include "packet-snmp-exp.h"*/
100 #endif /* PACKET_SNMP_H */