blob: 4dd49897c3e006a94bf924b4d3f8c836f66f35f3 [file] [log] [blame]
Harald Weltef6214982017-09-24 10:23:24 +08001/** @file cmdline.h
2 * @brief The header file for the command line option parser
3 * generated by GNU Gengetopt version 2.22.6
4 * http://www.gnu.org/software/gengetopt.
5 * DO NOT modify this file, since it can be overwritten
6 * @author GNU Gengetopt by Lorenzo Bettini */
jjako52c24142002-12-16 13:33:51 +00007
Harald Welte1b3e5772010-05-04 11:13:56 +02008#ifndef CMDLINE_H
9#define CMDLINE_H
10
11/* If we use autoconf. */
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
jjako52c24142002-12-16 13:33:51 +000015
Harald Weltef6214982017-09-24 10:23:24 +080016#include <stdio.h> /* for FILE */
17
jjako52c24142002-12-16 13:33:51 +000018#ifdef __cplusplus
19extern "C" {
Harald Weltebed35df2011-11-02 13:06:18 +010020#endif /* __cplusplus */
jjako52c24142002-12-16 13:33:51 +000021
Harald Welte1b3e5772010-05-04 11:13:56 +020022#ifndef CMDLINE_PARSER_PACKAGE
Harald Weltef6214982017-09-24 10:23:24 +080023/** @brief the program name (used for printing errors) */
Harald Welte7e1175f2017-09-24 10:53:53 +080024#define CMDLINE_PARSER_PACKAGE "sgsnemu"
jjako52c24142002-12-16 13:33:51 +000025#endif
26
Harald Weltef6214982017-09-24 10:23:24 +080027#ifndef CMDLINE_PARSER_PACKAGE_NAME
28/** @brief the complete program name (used for help and version) */
Harald Welte7e1175f2017-09-24 10:53:53 +080029#define CMDLINE_PARSER_PACKAGE_NAME "sgsnemu"
Harald Weltef6214982017-09-24 10:23:24 +080030#endif
31
Harald Welte1b3e5772010-05-04 11:13:56 +020032#ifndef CMDLINE_PARSER_VERSION
Harald Weltef6214982017-09-24 10:23:24 +080033/** @brief the program version */
Harald Welte1b3e5772010-05-04 11:13:56 +020034#define CMDLINE_PARSER_VERSION VERSION
jjako52c24142002-12-16 13:33:51 +000035#endif
36
Harald Weltef6214982017-09-24 10:23:24 +080037/** @brief Where the command line options are stored */
Harald Weltebed35df2011-11-02 13:06:18 +010038 struct gengetopt_args_info {
Harald Weltef6214982017-09-24 10:23:24 +080039 const char *help_help;
40 /**< @brief Print help and exit help description. */
41 const char *version_help;
42 /**< @brief Print version and exit help description. */
43 int debug_flag;
44 /**< @brief Run in debug mode (default=off). */
45 const char *debug_help;
46 /**< @brief Run in debug mode help description. */
47 char *conf_arg;
48 /**< @brief Read configuration file. */
49 char *conf_orig;
50 /**< @brief Read configuration file original value given at command line. */
51 const char *conf_help;
52 /**< @brief Read configuration file help description. */
53 char *pidfile_arg;
54 /**< @brief Filename of process id file (default='./sgsnemu.pid'). */
55 char *pidfile_orig;
56 /**< @brief Filename of process id file original value given at command line. */
57 const char *pidfile_help;
58 /**< @brief Filename of process id file help description. */
59 char *statedir_arg;
60 /**< @brief Directory of nonvolatile data (default='./'). */
61 char *statedir_orig;
62 /**< @brief Directory of nonvolatile data original value given at command line. */
63 const char *statedir_help;
64 /**< @brief Directory of nonvolatile data help description. */
65 char *dns_arg;
66 /**< @brief DNS Server to use. */
67 char *dns_orig;
68 /**< @brief DNS Server to use original value given at command line. */
69 const char *dns_help;
70 /**< @brief DNS Server to use help description. */
71 char *listen_arg;
Pau Espin Pedrol5fdda132018-02-12 18:03:09 +010072 /**< @brief Local host. */
Harald Weltef6214982017-09-24 10:23:24 +080073 char *listen_orig;
Pau Espin Pedrol5fdda132018-02-12 18:03:09 +010074 /**< @brief Local host original value given at command line. */
Harald Weltef6214982017-09-24 10:23:24 +080075 const char *listen_help;
Pau Espin Pedrol5fdda132018-02-12 18:03:09 +010076 /**< @brief Local host help description. */
Harald Weltef6214982017-09-24 10:23:24 +080077 char *remote_arg;
78 /**< @brief Remote host. */
79 char *remote_orig;
80 /**< @brief Remote host original value given at command line. */
81 const char *remote_help;
82 /**< @brief Remote host help description. */
83 int contexts_arg;
84 /**< @brief Number of contexts (default='1'). */
85 char *contexts_orig;
86 /**< @brief Number of contexts original value given at command line. */
87 const char *contexts_help;
88 /**< @brief Number of contexts help description. */
89 int timelimit_arg;
90 /**< @brief Exit after timelimit seconds (default='0'). */
91 char *timelimit_orig;
92 /**< @brief Exit after timelimit seconds original value given at command line. */
93 const char *timelimit_help;
94 /**< @brief Exit after timelimit seconds help description. */
95 int gtpversion_arg;
96 /**< @brief GTP version to use (default='1'). */
97 char *gtpversion_orig;
98 /**< @brief GTP version to use original value given at command line. */
99 const char *gtpversion_help;
100 /**< @brief GTP version to use help description. */
101 char *apn_arg;
102 /**< @brief Access point name (default='internet'). */
103 char *apn_orig;
104 /**< @brief Access point name original value given at command line. */
105 const char *apn_help;
106 /**< @brief Access point name help description. */
107 int selmode_arg;
108 /**< @brief Selection mode (default='0x01'). */
109 char *selmode_orig;
110 /**< @brief Selection mode original value given at command line. */
111 const char *selmode_help;
112 /**< @brief Selection mode help description. */
113 int rattype_arg;
114 /**< @brief Radio Access Technology Type (default='1'). */
Harald Weltebed35df2011-11-02 13:06:18 +0100115 char *rattype_orig;
Harald Weltef6214982017-09-24 10:23:24 +0800116 /**< @brief Radio Access Technology Type original value given at command line. */
117 const char *rattype_help;
118 /**< @brief Radio Access Technology Type help description. */
119 char *userloc_arg;
120 /**< @brief User Location Information (default='02509946241207'). */
Harald Weltebed35df2011-11-02 13:06:18 +0100121 char *userloc_orig;
Harald Weltef6214982017-09-24 10:23:24 +0800122 /**< @brief User Location Information original value given at command line. */
123 const char *userloc_help;
124 /**< @brief User Location Information help description. */
125 char *rai_arg;
126 /**< @brief Routing Area Information (default='02509946241207'). */
Harald Weltebed35df2011-11-02 13:06:18 +0100127 char *rai_orig;
Harald Weltef6214982017-09-24 10:23:24 +0800128 /**< @brief Routing Area Information original value given at command line. */
129 const char *rai_help;
130 /**< @brief Routing Area Information help description. */
131 char *mstz_arg;
132 /**< @brief MS Time Zone (default='0'). */
Harald Weltebed35df2011-11-02 13:06:18 +0100133 char *mstz_orig;
Harald Weltef6214982017-09-24 10:23:24 +0800134 /**< @brief MS Time Zone original value given at command line. */
135 const char *mstz_help;
136 /**< @brief MS Time Zone help description. */
137 char *imeisv_arg;
138 /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) (default='2143658709214365'). */
Harald Weltebed35df2011-11-02 13:06:18 +0100139 char *imeisv_orig;
Harald Weltef6214982017-09-24 10:23:24 +0800140 /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) original value given at command line. */
141 const char *imeisv_help;
142 /**< @brief IMEI(SV) International Mobile Equipment Identity (and Software Version) help description. */
143 int norecovery_flag;
144 /**< @brief Do not send recovery (default=off). */
145 const char *norecovery_help;
146 /**< @brief Do not send recovery help description. */
147 char *imsi_arg;
148 /**< @brief IMSI (default='240010123456789'). */
149 char *imsi_orig;
150 /**< @brief IMSI original value given at command line. */
151 const char *imsi_help;
152 /**< @brief IMSI help description. */
153 int nsapi_arg;
154 /**< @brief NSAPI (default='0'). */
155 char *nsapi_orig;
156 /**< @brief NSAPI original value given at command line. */
157 const char *nsapi_help;
158 /**< @brief NSAPI help description. */
159 char *msisdn_arg;
160 /**< @brief Mobile Station ISDN number (default='46702123456'). */
161 char *msisdn_orig;
162 /**< @brief Mobile Station ISDN number original value given at command line. */
163 const char *msisdn_help;
164 /**< @brief Mobile Station ISDN number help description. */
165 int qos_arg;
166 /**< @brief Requested quality of service (default='0x000b921f'). */
167 char *qos_orig;
168 /**< @brief Requested quality of service original value given at command line. */
169 const char *qos_help;
170 /**< @brief Requested quality of service help description. */
171 unsigned long long int qose1_arg;
172 /**< @brief Requested quality of service Extension 1 (default='0x9396404074f9ffff'). */
173 char *qose1_orig;
174 /**< @brief Requested quality of service Extension 1 original value given at command line. */
175 const char *qose1_help;
176 /**< @brief Requested quality of service Extension 1 help description. */
177 int qose2_arg;
178 /**< @brief Requested quality of service Extension 2 (default='0x11'). */
179 char *qose2_orig;
180 /**< @brief Requested quality of service Extension 2 original value given at command line. */
181 const char *qose2_help;
182 /**< @brief Requested quality of service Extension 2 help description. */
183 int qose3_arg;
184 /**< @brief Requested quality of service Extension 3 (default='0x0101'). */
185 char *qose3_orig;
186 /**< @brief Requested quality of service Extension 3 original value given at command line. */
187 const char *qose3_help;
188 /**< @brief Requested quality of service Extension 3 help description. */
189 int qose4_arg;
190 /**< @brief Requested quality of service Extension 4 (default='0x4040'). */
191 char *qose4_orig;
192 /**< @brief Requested quality of service Extension 4 original value given at command line. */
193 const char *qose4_help;
194 /**< @brief Requested quality of service Extension 4 help description. */
195 int charging_arg;
196 /**< @brief Charging characteristics (default='0x0800'). */
197 char *charging_orig;
198 /**< @brief Charging characteristics original value given at command line. */
199 const char *charging_help;
200 /**< @brief Charging characteristics help description. */
201 char *uid_arg;
202 /**< @brief Login user ID (default='mig'). */
203 char *uid_orig;
204 /**< @brief Login user ID original value given at command line. */
205 const char *uid_help;
206 /**< @brief Login user ID help description. */
207 char *pwd_arg;
208 /**< @brief Login password (default='hemmelig'). */
209 char *pwd_orig;
210 /**< @brief Login password original value given at command line. */
211 const char *pwd_help;
212 /**< @brief Login password help description. */
213 int createif_flag;
214 /**< @brief Create local network interface (default=off). */
215 const char *createif_help;
216 /**< @brief Create local network interface help description. */
217 char *net_arg;
218 /**< @brief Network address for local interface. */
219 char *net_orig;
220 /**< @brief Network address for local interface original value given at command line. */
221 const char *net_help;
222 /**< @brief Network address for local interface help description. */
223 int defaultroute_flag;
224 /**< @brief Create default route (default=off). */
225 const char *defaultroute_help;
226 /**< @brief Create default route help description. */
227 char *ipup_arg;
228 /**< @brief Script to run after link-up. */
229 char *ipup_orig;
230 /**< @brief Script to run after link-up original value given at command line. */
231 const char *ipup_help;
232 /**< @brief Script to run after link-up help description. */
233 char *ipdown_arg;
234 /**< @brief Script to run after link-down. */
235 char *ipdown_orig;
236 /**< @brief Script to run after link-down original value given at command line. */
237 const char *ipdown_help;
238 /**< @brief Script to run after link-down help description. */
Harald Welte73abc382017-10-10 08:50:11 +0800239 char *tun_device_arg;
240 /**< @brief Name of the local network interface. */
241 char *tun_device_orig;
242 /**< @brief Name of the local network interface original value given at command line. */
243 const char *tun_device_help;
244 /**< @brief Name of the local network interface help description. */
Andreas Schultzb6292402018-10-05 13:58:45 +0100245 char *netns_arg;
246 /**< @brief Network namespace to use. */
247 char *netns_orig;
248 /**< @brief Network namespace to use original value given at command line. */
249 const char *netns_help;
250 /**< @brief Network namespace to use help description. */
Harald Weltef6214982017-09-24 10:23:24 +0800251 char *pinghost_arg;
252 /**< @brief Ping remote host. */
253 char *pinghost_orig;
254 /**< @brief Ping remote host original value given at command line. */
255 const char *pinghost_help;
256 /**< @brief Ping remote host help description. */
257 int pingrate_arg;
258 /**< @brief Number of ping req per second (default='1'). */
259 char *pingrate_orig;
260 /**< @brief Number of ping req per second original value given at command line. */
261 const char *pingrate_help;
262 /**< @brief Number of ping req per second help description. */
263 int pingsize_arg;
264 /**< @brief Number of ping data bytes (default='56'). */
265 char *pingsize_orig;
266 /**< @brief Number of ping data bytes original value given at command line. */
267 const char *pingsize_help;
268 /**< @brief Number of ping data bytes help description. */
269 int pingcount_arg;
270 /**< @brief Number of ping req to send (default='0'). */
271 char *pingcount_orig;
272 /**< @brief Number of ping req to send original value given at command line. */
273 const char *pingcount_help;
274 /**< @brief Number of ping req to send help description. */
275 int pingquiet_flag;
276 /**< @brief Do not print ping packet info (default=off). */
277 const char *pingquiet_help;
278 /**< @brief Do not print ping packet info help description. */
Harald Weltefbb9c7f2017-09-24 11:50:20 +0800279 int no_tx_gpdu_seq_flag;
280 /**< @brief Don't transmit G-PDU sequence nums (default=off). */
281 const char *no_tx_gpdu_seq_help;
282 /**< @brief Don't transmit G-PDU sequence nums help description. */
Harald Welte840a8e92017-09-24 18:12:40 +0800283 char *pdp_type_arg;
284 /**< @brief PDP Type (default='v4'). */
285 char *pdp_type_orig;
286 /**< @brief PDP Type original value given at command line. */
287 const char *pdp_type_help;
288 /**< @brief PDP Type help description. */
jjako52c24142002-12-16 13:33:51 +0000289
Harald Weltef6214982017-09-24 10:23:24 +0800290 unsigned int help_given;
291 /**< @brief Whether help was given. */
292 unsigned int version_given;
293 /**< @brief Whether version was given. */
294 unsigned int debug_given;
295 /**< @brief Whether debug was given. */
296 unsigned int conf_given;
297 /**< @brief Whether conf was given. */
298 unsigned int pidfile_given;
299 /**< @brief Whether pidfile was given. */
300 unsigned int statedir_given;
301 /**< @brief Whether statedir was given. */
302 unsigned int dns_given;
303 /**< @brief Whether dns was given. */
304 unsigned int listen_given;
305 /**< @brief Whether listen was given. */
306 unsigned int remote_given;
307 /**< @brief Whether remote was given. */
308 unsigned int contexts_given;
309 /**< @brief Whether contexts was given. */
310 unsigned int timelimit_given;
311 /**< @brief Whether timelimit was given. */
312 unsigned int gtpversion_given;
313 /**< @brief Whether gtpversion was given. */
314 unsigned int apn_given;
315 /**< @brief Whether apn was given. */
316 unsigned int selmode_given;
317 /**< @brief Whether selmode was given. */
318 unsigned int rattype_given;
319 /**< @brief Whether rattype was given. */
320 unsigned int userloc_given;
321 /**< @brief Whether userloc was given. */
322 unsigned int rai_given;
323 /**< @brief Whether rai was given. */
324 unsigned int mstz_given;
325 /**< @brief Whether mstz was given. */
326 unsigned int imeisv_given;
327 /**< @brief Whether imeisv was given. */
328 unsigned int norecovery_given;
329 /**< @brief Whether norecovery was given. */
330 unsigned int imsi_given;
331 /**< @brief Whether imsi was given. */
332 unsigned int nsapi_given;
333 /**< @brief Whether nsapi was given. */
334 unsigned int msisdn_given;
335 /**< @brief Whether msisdn was given. */
336 unsigned int qos_given;
337 /**< @brief Whether qos was given. */
338 unsigned int qose1_given;
339 /**< @brief Whether qose1 was given. */
340 unsigned int qose2_given;
341 /**< @brief Whether qose2 was given. */
342 unsigned int qose3_given;
343 /**< @brief Whether qose3 was given. */
344 unsigned int qose4_given;
345 /**< @brief Whether qose4 was given. */
346 unsigned int charging_given;
347 /**< @brief Whether charging was given. */
348 unsigned int uid_given;
349 /**< @brief Whether uid was given. */
350 unsigned int pwd_given;
351 /**< @brief Whether pwd was given. */
352 unsigned int createif_given;
353 /**< @brief Whether createif was given. */
354 unsigned int net_given;
355 /**< @brief Whether net was given. */
356 unsigned int defaultroute_given;
357 /**< @brief Whether defaultroute was given. */
358 unsigned int ipup_given;
359 /**< @brief Whether ipup was given. */
360 unsigned int ipdown_given;
361 /**< @brief Whether ipdown was given. */
Harald Welte73abc382017-10-10 08:50:11 +0800362 unsigned int tun_device_given;
363 /**< @brief Whether tun-device was given. */
Andreas Schultzb6292402018-10-05 13:58:45 +0100364 unsigned int netns_given;
365 /**< @brief Whether netns was given. */
Harald Weltef6214982017-09-24 10:23:24 +0800366 unsigned int pinghost_given;
367 /**< @brief Whether pinghost was given. */
368 unsigned int pingrate_given;
369 /**< @brief Whether pingrate was given. */
370 unsigned int pingsize_given;
371 /**< @brief Whether pingsize was given. */
372 unsigned int pingcount_given;
373 /**< @brief Whether pingcount was given. */
374 unsigned int pingquiet_given;
375 /**< @brief Whether pingquiet was given. */
Harald Weltefbb9c7f2017-09-24 11:50:20 +0800376 unsigned int no_tx_gpdu_seq_given;
377 /**< @brief Whether no-tx-gpdu-seq was given. */
Harald Welte840a8e92017-09-24 18:12:40 +0800378 unsigned int pdp_type_given;
379 /**< @brief Whether pdp-type was given. */
jjako52c24142002-12-16 13:33:51 +0000380
Viktor Tsymbalyukab4db102018-01-30 14:40:12 +0200381 int createif_mode_counter;
382 /**< @brief Counter for mode createif */
383 int pinghost_mode_counter;
384 /**< @brief Counter for mode pinghost */
Harald Weltebed35df2011-11-02 13:06:18 +0100385 };
Harald Welte1b3e5772010-05-04 11:13:56 +0200386
Harald Weltef6214982017-09-24 10:23:24 +0800387/** @brief The additional parameters to pass to parser functions */
388 struct cmdline_parser_params {
389 int override;
390 /**< @brief whether to override possibly already present options (default 0) */
391 int initialize;
392 /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
393 int check_required;
394 /**< @brief whether to check that all required options were provided (default 1) */
395 int check_ambiguity;
396 /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
397 int print_errors;
398 /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
399 };
400
401/** @brief the purpose string of the program */
Harald Weltebed35df2011-11-02 13:06:18 +0100402 extern const char *gengetopt_args_info_purpose;
Harald Weltef6214982017-09-24 10:23:24 +0800403/** @brief the usage string of the program */
Harald Weltebed35df2011-11-02 13:06:18 +0100404 extern const char *gengetopt_args_info_usage;
Harald Weltef6214982017-09-24 10:23:24 +0800405/** @brief the description string of the program */
406 extern const char *gengetopt_args_info_description;
407/** @brief all the lines making the help output */
Harald Weltebed35df2011-11-02 13:06:18 +0100408 extern const char *gengetopt_args_info_help[];
jjako52c24142002-12-16 13:33:51 +0000409
Harald Weltef6214982017-09-24 10:23:24 +0800410/**
411 * The command line parser
412 * @param argc the number of command line options
413 * @param argv the command line options
414 * @param args_info the structure where option information will be stored
415 * @return 0 if everything went fine, NON 0 if an error took place
416 */
417 int cmdline_parser(int argc, char **argv,
Harald Weltebed35df2011-11-02 13:06:18 +0100418 struct gengetopt_args_info *args_info);
Harald Weltef6214982017-09-24 10:23:24 +0800419
420/**
421 * The command line parser (version with additional parameters - deprecated)
422 * @param argc the number of command line options
423 * @param argv the command line options
424 * @param args_info the structure where option information will be stored
425 * @param override whether to override possibly already present options
426 * @param initialize whether to initialize the option structure my_args_info
427 * @param check_required whether to check that all required options were provided
428 * @return 0 if everything went fine, NON 0 if an error took place
429 * @deprecated use cmdline_parser_ext() instead
430 */
431 int cmdline_parser2(int argc, char **argv,
Harald Weltebed35df2011-11-02 13:06:18 +0100432 struct gengetopt_args_info *args_info,
433 int override, int initialize, int check_required);
Harald Weltef6214982017-09-24 10:23:24 +0800434
435/**
436 * The command line parser (version with additional parameters)
437 * @param argc the number of command line options
438 * @param argv the command line options
439 * @param args_info the structure where option information will be stored
440 * @param params additional parameters for the parser
441 * @return 0 if everything went fine, NON 0 if an error took place
442 */
443 int cmdline_parser_ext(int argc, char **argv,
444 struct gengetopt_args_info *args_info,
445 struct cmdline_parser_params *params);
446
447/**
448 * Save the contents of the option struct into an already open FILE stream.
449 * @param outfile the stream where to dump options
450 * @param args_info the option struct to dump
451 * @return 0 if everything went fine, NON 0 if an error took place
452 */
453 int cmdline_parser_dump(FILE * outfile,
454 struct gengetopt_args_info *args_info);
455
456/**
457 * Save the contents of the option struct into a (text) file.
458 * This file can be read by the config file parser (if generated by gengetopt)
459 * @param filename the file where to save
460 * @param args_info the option struct to save
461 * @return 0 if everything went fine, NON 0 if an error took place
462 */
Harald Weltebed35df2011-11-02 13:06:18 +0100463 int cmdline_parser_file_save(const char *filename,
464 struct gengetopt_args_info *args_info);
jjako52c24142002-12-16 13:33:51 +0000465
Harald Weltef6214982017-09-24 10:23:24 +0800466/**
467 * Print the help
468 */
Harald Weltebed35df2011-11-02 13:06:18 +0100469 void cmdline_parser_print_help(void);
Harald Weltef6214982017-09-24 10:23:24 +0800470/**
471 * Print the version
472 */
Harald Weltebed35df2011-11-02 13:06:18 +0100473 void cmdline_parser_print_version(void);
Harald Welte1b3e5772010-05-04 11:13:56 +0200474
Harald Weltef6214982017-09-24 10:23:24 +0800475/**
476 * Initializes all the fields a cmdline_parser_params structure
477 * to their default values
478 * @param params the structure to initialize
479 */
480 void cmdline_parser_params_init(struct cmdline_parser_params *params);
481
482/**
Harald Weltef6214982017-09-24 10:23:24 +0800483 * Initializes the passed gengetopt_args_info structure's fields
484 * (also set default values for options that have a default)
485 * @param args_info the structure to initialize
486 */
Harald Weltebed35df2011-11-02 13:06:18 +0100487 void cmdline_parser_init(struct gengetopt_args_info *args_info);
Harald Weltef6214982017-09-24 10:23:24 +0800488/**
489 * Deallocates the string fields of the gengetopt_args_info structure
490 * (but does not deallocate the structure itself)
491 * @param args_info the structure to deallocate
492 */
Harald Weltebed35df2011-11-02 13:06:18 +0100493 void cmdline_parser_free(struct gengetopt_args_info *args_info);
Harald Welte1b3e5772010-05-04 11:13:56 +0200494
Harald Weltef6214982017-09-24 10:23:24 +0800495/**
496 * The config file parser (deprecated version)
497 * @param filename the name of the config file
498 * @param args_info the structure where option information will be stored
499 * @param override whether to override possibly already present options
500 * @param initialize whether to initialize the option structure my_args_info
501 * @param check_required whether to check that all required options were provided
502 * @return 0 if everything went fine, NON 0 if an error took place
503 * @deprecated use cmdline_parser_config_file() instead
504 */
505 int cmdline_parser_configfile(const char *filename,
Harald Weltebed35df2011-11-02 13:06:18 +0100506 struct gengetopt_args_info *args_info,
507 int override, int initialize,
508 int check_required);
Harald Welte1b3e5772010-05-04 11:13:56 +0200509
Harald Weltef6214982017-09-24 10:23:24 +0800510/**
511 * The config file parser
512 * @param filename the name of the config file
513 * @param args_info the structure where option information will be stored
514 * @param params additional parameters for the parser
515 * @return 0 if everything went fine, NON 0 if an error took place
516 */
517 int cmdline_parser_config_file(const char *filename,
518 struct gengetopt_args_info *args_info,
519 struct cmdline_parser_params *params);
520
521/**
522 * Checks that all the required options were specified
523 * @param args_info the structure to check
524 * @param prog_name the name of the program that will be used to print
525 * possible errors
526 * @return
527 */
Harald Weltebed35df2011-11-02 13:06:18 +0100528 int cmdline_parser_required(struct gengetopt_args_info *args_info,
529 const char *prog_name);
jjako52c24142002-12-16 13:33:51 +0000530
531#ifdef __cplusplus
532}
Harald Weltebed35df2011-11-02 13:06:18 +0100533#endif /* __cplusplus */
534#endif /* CMDLINE_H */