Fix for bug 5422:
[obnox/wireshark/wip.git] / epan / dissectors / packet-pw-atm.h
1 /* packet-pw-atm.h
2  * Interface of pw-atm module
3  * Copyright 2009, Artem Tamazov <artem.tamazov@tellabs.com>
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24  */
25
26 #ifndef PACKET_PW_ATM_H
27 #define PACKET_PW_ATM_H
28
29 #include "packet-pw-common.h"
30
31 typedef enum {
32         PWATM_MODE_UNKNOWN = 0
33         ,PWATM_MODE_N1_NOCW
34         ,PWATM_MODE_N1_CW
35         ,PWATM_MODE_11_VCC
36         ,PWATM_MODE_11_VPC
37         ,PWATM_MODE_AAL5_SDU
38         ,PWATM_MODE_AAL5_PDU
39 } pwatm_mode_t;
40
41 typedef enum {
42         PWATM_SUBMODE_DEFAULT = 0
43         ,PWATM_SUBMODE_ADMIN_CELL /*used in aal5_sdu dissector only*/
44 } pwatm_submode_t;
45
46 typedef struct {
47         int pw_cell_number;
48         pwc_packet_properties_t props;
49         gint packet_size;
50         pwatm_mode_t mode;
51         pwatm_submode_t submode;
52         struct {
53                 /*
54                  * ATM-specific attributes which remain the same
55                  * across all the cells in the pw packet. Values are filled
56                  * by sub-dissectors and read by upper-level dissector.
57                  * Meanings of values:
58                  *   (-1)       - value is unknown 
59                  *   (-2)       - value is different among cells
60                  *   positive   - value is the same in all cells
61                  * Machinery is implemented in the UPDATE_CUMULATIVE_VALUE macro.
62                  */
63                 gint32 vpi;
64                 gint32 vci;
65                 gint32 clp;
66                 gint32 pti;
67         } cumulative;
68         gint32 vpi; /*-1 if unknown*/
69         gint32 vci; /*-1 if unknown*/
70         gint32 pti; /*-1 if unknown*/
71         struct {
72                 /* 
73                  * Some fields from 3rd byte of CW. Filled by cell_header dissector.
74                  * In in AAL5 PDU mode, this allows control_word dissector to print
75                  * these values in the CW heading line in the tree.
76                  * Meanings of values:
77                  *   (-1)       - value is unknown 
78                  */
79                 gint32 m;
80                 gint32 v;
81                 gint32 rsv;
82                 gint32 u;
83                 gint32 e;
84                 gint32 clp;
85         } cwb3; 
86         gboolean aal5_sdu_frame_relay_cr_bit; /*see rfc4717 10.1*/
87         gboolean cell_mode_oam; /*atm admin cell*/
88         gboolean enable_fill_columns_by_atm_dissector;
89 } pwatm_private_data_t;
90
91
92 #define PWATM_PRIVATE_DATA_T_INITIALIZER {              \
93         0, PWC_PACKET_PROPERTIES_T_INITIALIZER, 0       \
94         ,PWATM_MODE_UNKNOWN, PWATM_SUBMODE_DEFAULT      \
95         ,{-1, -1, -1, -1 }                              \
96         ,-1, -1, -1                                     \
97         ,{-1, -1, -1, -1, -1, -1 }                      \
98         ,FALSE, FALSE, TRUE                             \
99         }
100
101 #endif /*PACKET_PW_ATM_H*/