~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to ntpq/ntpq-opts.h

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2009-01-05 21:10:03 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090105211003-mh6zc3um4k1uhsj7
Tags: 1:4.2.4p4+dfsg-8
It did not properly check the return value of EVP_VerifyFinal
which results in an malformed DSA signature being treated as
a good signature rather than as an error.  (CVE-2009-0021)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*   -*- buffer-read-only: t -*- vi: set ro:
 
2
 *  
 
3
 *  DO NOT EDIT THIS FILE   (ntpq-opts.h)
 
4
 *  
 
5
 *  It has been AutoGen-ed  Monday September 10, 2007 at 08:38:18 PM EDT
 
6
 *  From the definitions    ntpq-opts.def
 
7
 *  and the template file   options
 
8
 *
 
9
 * Generated from AutoOpts 29:0:4 templates.
 
10
 */
 
11
 
 
12
/*
 
13
 *  This file was produced by an AutoOpts template.  AutoOpts is a
 
14
 *  copyrighted work.  This header file is not encumbered by AutoOpts
 
15
 *  licensing, but is provided under the licensing terms chosen by the
 
16
 *  ntpq author or copyright holder.  AutoOpts is licensed under
 
17
 *  the terms of the LGPL.  The redistributable library (``libopts'') is
 
18
 *  licensed under the terms of either the LGPL or, at the users discretion,
 
19
 *  the BSD license.  See the AutoOpts and/or libopts sources for details.
 
20
 *
 
21
 * This source file is copyrighted and licensed under the following terms:
 
22
 *
 
23
 * ntpq copyright 1970-2007 David L. Mills and/or others - all rights reserved
 
24
 *
 
25
 * see html/copyright.html
 
26
 */
 
27
/*
 
28
 *  This file contains the programmatic interface to the Automated
 
29
 *  Options generated for the ntpq program.
 
30
 *  These macros are documented in the AutoGen info file in the
 
31
 *  "AutoOpts" chapter.  Please refer to that doc for usage help.
 
32
 */
 
33
#ifndef AUTOOPTS_NTPQ_OPTS_H_GUARD
 
34
#define AUTOOPTS_NTPQ_OPTS_H_GUARD
 
35
#include "config.h"
 
36
#include <autoopts/options.h>
 
37
 
 
38
/*
 
39
 *  Ensure that the library used for compiling this generated header is at
 
40
 *  least as new as the version current when the header template was released
 
41
 *  (not counting patch version increments).  Also ensure that the oldest
 
42
 *  tolerable version is at least as old as what was current when the header
 
43
 *  template was released.
 
44
 */
 
45
#define AO_TEMPLATE_VERSION 118784
 
46
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
 
47
 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 
48
# error option template version mismatches autoopts/options.h header
 
49
  Choke Me.
 
50
#endif
 
51
 
 
52
/*
 
53
 *  Enumeration of each option:
 
54
 */
 
55
typedef enum {
 
56
        INDEX_OPT_IPV4             =  0,
 
57
        INDEX_OPT_IPV6             =  1,
 
58
        INDEX_OPT_COMMAND          =  2,
 
59
        INDEX_OPT_DEBUG_LEVEL      =  3,
 
60
        INDEX_OPT_SET_DEBUG_LEVEL  =  4,
 
61
        INDEX_OPT_PEERS            =  5,
 
62
        INDEX_OPT_INTERACTIVE      =  6,
 
63
        INDEX_OPT_NUMERIC          =  7,
 
64
        INDEX_OPT_VERSION          = 8,
 
65
        INDEX_OPT_HELP             = 9,
 
66
        INDEX_OPT_MORE_HELP        = 10,
 
67
        INDEX_OPT_SAVE_OPTS        = 11,
 
68
        INDEX_OPT_LOAD_OPTS        = 12
 
69
} teOptIndex;
 
70
 
 
71
#define OPTION_CT    13
 
72
#define NTPQ_VERSION       "4.2.4p4"
 
73
#define NTPQ_FULL_VERSION  "ntpq - standard NTP query program - Ver. 4.2.4p4"
 
74
 
 
75
/*
 
76
 *  Interface defines for all options.  Replace "n" with the UPPER_CASED
 
77
 *  option name (as in the teOptIndex enumeration above).
 
78
 *  e.g. HAVE_OPT( IPV4 )
 
79
 */
 
80
#define         DESC(n) (ntpqOptions.pOptDesc[INDEX_OPT_## n])
 
81
#define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
 
82
#define      OPT_ARG(n) (DESC(n).optArg.argString)
 
83
#define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
 
84
#define    COUNT_OPT(n) (DESC(n).optOccCt)
 
85
#define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
 
86
#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
 
87
#define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
 
88
#define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
 
89
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
 
90
#define    CLEAR_OPT(n) STMTS( \
 
91
                DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
 
92
                if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
 
93
                    DESC(n).fOptState |= OPTST_DISABLED; \
 
94
                DESC(n).optCookie = NULL )
 
95
 
 
96
/*
 
97
 *  Make sure there are no #define name conflicts with the option names
 
98
 */
 
99
#ifndef     NO_OPTION_NAME_WARNINGS
 
100
# ifdef    IPV4
 
101
#  warning undefining IPV4 due to option name conflict
 
102
#  undef   IPV4
 
103
# endif
 
104
# ifdef    IPV6
 
105
#  warning undefining IPV6 due to option name conflict
 
106
#  undef   IPV6
 
107
# endif
 
108
# ifdef    COMMAND
 
109
#  warning undefining COMMAND due to option name conflict
 
110
#  undef   COMMAND
 
111
# endif
 
112
# ifdef    DEBUG_LEVEL
 
113
#  warning undefining DEBUG_LEVEL due to option name conflict
 
114
#  undef   DEBUG_LEVEL
 
115
# endif
 
116
# ifdef    SET_DEBUG_LEVEL
 
117
#  warning undefining SET_DEBUG_LEVEL due to option name conflict
 
118
#  undef   SET_DEBUG_LEVEL
 
119
# endif
 
120
# ifdef    PEERS
 
121
#  warning undefining PEERS due to option name conflict
 
122
#  undef   PEERS
 
123
# endif
 
124
# ifdef    INTERACTIVE
 
125
#  warning undefining INTERACTIVE due to option name conflict
 
126
#  undef   INTERACTIVE
 
127
# endif
 
128
# ifdef    NUMERIC
 
129
#  warning undefining NUMERIC due to option name conflict
 
130
#  undef   NUMERIC
 
131
# endif
 
132
#else  /* NO_OPTION_NAME_WARNINGS */
 
133
# undef IPV4
 
134
# undef IPV6
 
135
# undef COMMAND
 
136
# undef DEBUG_LEVEL
 
137
# undef SET_DEBUG_LEVEL
 
138
# undef PEERS
 
139
# undef INTERACTIVE
 
140
# undef NUMERIC
 
141
#endif  /*  NO_OPTION_NAME_WARNINGS */
 
142
 
 
143
/*
 
144
 *  Interface defines for specific options.
 
145
 */
 
146
#define VALUE_OPT_IPV4           '4'
 
147
#define WHICH_OPT_IPV4           (DESC(IPV4).optActualValue)
 
148
#define WHICH_IDX_IPV4           (DESC(IPV4).optActualIndex)
 
149
#define VALUE_OPT_IPV6           '6'
 
150
#define VALUE_OPT_COMMAND        'c'
 
151
#ifdef DEBUG
 
152
#define VALUE_OPT_DEBUG_LEVEL    'd'
 
153
#endif /* DEBUG */
 
154
#ifdef DEBUG
 
155
#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
 
156
#endif /* DEBUG */
 
157
#define VALUE_OPT_PEERS          'p'
 
158
#define VALUE_OPT_INTERACTIVE    'i'
 
159
#define VALUE_OPT_NUMERIC        'n'
 
160
 
 
161
#define VALUE_OPT_VERSION       'v'
 
162
#define VALUE_OPT_HELP          '?'
 
163
#define VALUE_OPT_MORE_HELP     '!'
 
164
#define VALUE_OPT_SAVE_OPTS     '>'
 
165
#define VALUE_OPT_LOAD_OPTS     '<'
 
166
#define SET_OPT_SAVE_OPTS(a)   STMTS( \
 
167
        DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
 
168
        DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
 
169
        DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
 
170
/*
 
171
 *  Interface defines not associated with particular options
 
172
 */
 
173
#define ERRSKIP_OPTERR  STMTS( ntpqOptions.fOptSet &= ~OPTPROC_ERRSTOP )
 
174
#define ERRSTOP_OPTERR  STMTS( ntpqOptions.fOptSet |= OPTPROC_ERRSTOP )
 
175
#define RESTART_OPT(n)  STMTS( \
 
176
                ntpqOptions.curOptIdx = (n); \
 
177
                ntpqOptions.pzCurOpt  = NULL )
 
178
#define START_OPT       RESTART_OPT(1)
 
179
#define USAGE(c)        (*ntpqOptions.pUsageProc)( &ntpqOptions, c )
 
180
/* extracted from /usr/local/gnu/share/autogen/opthead.tpl near line 360 */
 
181
 
 
182
/* * * * * *
 
183
 *
 
184
 *  Declare the ntpq option descriptor.
 
185
 */
 
186
#ifdef  __cplusplus
 
187
extern "C" {
 
188
#endif
 
189
 
 
190
extern tOptions   ntpqOptions;
 
191
 
 
192
#ifndef _
 
193
#  if ENABLE_NLS
 
194
#    include <stdio.h>
 
195
     static inline char* aoGetsText( char const* pz ) {
 
196
         if (pz == NULL) return NULL;
 
197
         return (char*)gettext( pz );
 
198
     }
 
199
#    define _(s)  aoGetsText(s)
 
200
#  else  /* ENABLE_NLS */
 
201
#    define _(s)  s
 
202
#  endif /* ENABLE_NLS */
 
203
#endif
 
204
 
 
205
#ifdef  __cplusplus
 
206
}
 
207
#endif
 
208
#endif /* AUTOOPTS_NTPQ_OPTS_H_GUARD */
 
209
/* ntpq-opts.h ends here */