Fix a spelling error pointed out by Noam Rathaus.
[metze/wireshark/wip.git] / epan / dissectors / packet-snmp.h
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler   */
3 /* packet-snmp.h                                                              */
4 /* ../../tools/asn2wrs.py -b -p snmp -c ./snmp.cnf -s ./packet-snmp-template -D . snmp.asn */
5
6 /* Input file: packet-snmp-template.h */
7
8 #line 1 "packet-snmp-template.h"
9 /* packet-snmp.h
10  * Routines for snmp packet dissection
11  *
12  * $Id$
13  *
14  * Wireshark - Network traffic analyzer
15  * By Gerald Combs <gerald@wireshark.org>
16  * Copyright 1998 Gerald Combs
17  *
18  * This program is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU General Public License
20  * as published by the Free Software Foundation; either version 2
21  * of the License, or (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
31  */
32
33 #ifndef PACKET_SNMP_H
34 #define PACKET_SNMP_H
35
36 typedef struct _snmp_usm_key {
37         guint8* data;
38         guint len;
39 } snmp_usm_key_t;
40
41 typedef struct _snmp_ue_assoc_t snmp_ue_assoc_t;
42 typedef struct _snmp_usm_params_t snmp_usm_params_t;
43
44 typedef gboolean (*snmp_usm_authenticator_t)(snmp_usm_params_t*, guint8** calc_auth, guint* calc_auth_len, gchar const** error);
45 typedef tvbuff_t* (*snmp_usm_decoder_t)(snmp_usm_params_t*, tvbuff_t* encryptedData, gchar const** error);
46 typedef void (*snmp_usm_password_to_key_t)(const guint8 *password, guint passwordlen, const guint8 *engineID, guint engineLength, guint8 *key);
47
48 typedef struct _snmp_usm_auth_model_t {
49         snmp_usm_password_to_key_t pass2key;
50         snmp_usm_authenticator_t authenticate;
51         guint key_size;
52 } snmp_usm_auth_model_t;
53
54 typedef struct _snmp_user_t {
55         snmp_usm_key_t userName;
56         
57         snmp_usm_auth_model_t* authModel;
58         snmp_usm_key_t authPassword;
59         snmp_usm_key_t authKey;
60
61         snmp_usm_decoder_t privProtocol;
62         snmp_usm_key_t privPassword;
63         snmp_usm_key_t privKey;
64 } snmp_user_t;
65
66 typedef struct {
67         guint8* data;
68         guint len;
69 } snmp_engine_id_t;
70
71 struct _snmp_ue_assoc_t {
72         snmp_user_t user;
73         snmp_engine_id_t engine;
74         guint   auth_model;
75         guint   priv_proto;
76         struct _snmp_ue_assoc_t* next;
77 };
78
79 struct _snmp_usm_params_t {
80         gboolean authenticated;
81         gboolean encrypted;
82         guint start_offset;
83         guint auth_offset;
84         
85         guint32 boots;
86         guint32 time;
87         tvbuff_t* engine_tvb;
88         tvbuff_t* user_tvb;
89         proto_item* auth_item;
90         tvbuff_t* auth_tvb;
91         tvbuff_t* priv_tvb;
92         tvbuff_t* msg_tvb;
93         snmp_ue_assoc_t* user_assoc;
94
95         gboolean authOK;
96 };
97
98 /*
99  * Guts of the SNMP dissector - exported for use by protocols such as
100  * ILMI.
101  */
102 extern guint dissect_snmp_pdu(tvbuff_t *, int, packet_info *, proto_tree *tree,
103     int, gint, gboolean);
104 extern int dissect_snmp_engineid(proto_tree *, tvbuff_t *, int, int);
105
106 /*#include "packet-snmp-exp.h"*/
107
108 #endif  /* PACKET_SNMP_H */