2 ******************************************************************************
6 * Author: Damien Stuart
8 * Purpose: Common header file for fwknop client and server programs.
10 * Copyright 2010 Damien Stuart (dstuart@dstuart.org)
12 * License (GNU Public License):
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
29 ******************************************************************************
34 /* Common includes for our other fwknop client and server source files.
43 #include <sys/types.h>
55 #endif /* STDC_HEADERS*/
62 #include <netinet/in.h>
74 #define strcasecmp _stricmp
75 #define strncasecmp _strnicmp
76 #define snprintf _snprintf
77 #define unlink _unlink
86 /* Get our program version from VERSION (defined in config.h).
88 #define MY_VERSION VERSION
98 /* Other common defines
100 #define FKO_DEFAULT_PROTO FKO_PROTO_UDP
101 #define FKO_DEFAULT_PORT 62201
102 #define DEFAULT_NAT_PORT 55000
103 #define MIN_HIGH_PORT 10000 /* sensible minimum for SPA dest port */
104 #define MAX_PORT 65535
105 #define MAX_SERVER_STR_LEN 50
107 #define MAX_LINE_LEN 1024
108 #define MAX_PATH_LEN 1024
109 #define MAX_GPG_KEY_ID 128
110 #define MAX_USERNAME_LEN 30
112 /* Some convenience macros */
114 /* Characters allowed between a config parameter and its value.
116 #define IS_CONFIG_PARAM_DELIMITER(x) (x == ' ' || x == '\t' || x == '=');
118 /* End of line characters.
120 #define IS_LINE_END(x) (x == '\n' || x == '\r' || x == ';');
122 /* Characters in the first position of a line that make it considered
123 * empty or otherwise non-interesting (like a comment).
125 #define IS_EMPTY_LINE(x) ( \
126 x == '#' || x == '\n' || x == '\r' || x == ';' || x == '\0' \
129 #endif /* _COMMON_H */