-
Notifications
You must be signed in to change notification settings - Fork 14
/
ipgen.h
103 lines (88 loc) · 2.35 KB
/
ipgen.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* ipgen is Copyright (C) 2012 Roy Hills, NTA Monitor Ltd.
*
* This file is part of ipgen.
*
* ipgen is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ipgen is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ipgen. If not, see <http://www.gnu.org/licenses/>.
*
* ipgen.h -- Header file for ipgen
*
* Author: Roy Hills
* Date: 25 May 2012
*
*/
/* Includes */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/* C89 standard headers */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include <errno.h>
#include <sys/types.h>
/* Integer types */
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else
/* Include getopt.h for the sake of getopt_long.
We don't need the declaration of getopt, and it could conflict
with something from a system header file, so effectively nullify that. */
#define getopt getopt_loser
#include "getopt.h"
#undef getopt
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_REGEX_H
#include <regex.h> /* Posix regular expression functions */
#endif
/* Defines */
#define MAXLINE 255 /* Max line length for input files */
/* Functions */
#ifndef HAVE_STRLCAT
size_t strlcat(char *dst, const char *src, size_t siz);
#endif
#ifndef HAVE_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t siz);
#endif
void err_sys(const char *, ...);
void warn_sys(const char *, ...);
void err_msg(const char *, ...);
void warn_msg(const char *, ...);
void err_print(int, const char *, va_list);
void usage(int);
void process_network(const char *);
void ipgen_version(void);
void process_options(int, char *[]);
/* Wrappers */
void *Malloc(size_t);
unsigned long int Strtoul(const char *, int);
char *dupstr(const char *);