Guard every header against multiple inclusion.
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/addproto.h | 5 ++++-
src/arphdr.h | 5 +++++
src/attrs.h | 5 +++++
src/bar.h | 5 +++++
src/cidr.h | 4 ++++
src/deskman.h | 5 +++++
src/dirs.h | 5 +++++
src/error.h | 5 +++++
src/externs.h | 4 ++++
src/fltdefs.h | 5 +++++
src/fltedit.h | 5 +++++
src/fltmgr.h | 5 +++++
src/fltselect.h | 4 ++++
src/getpath.h | 5 +++++
src/hostmon.h | 5 +++++
src/ifaces.h | 5 +++++
src/ifstats.h | 4 ++++
src/instances.h | 5 +++++
src/ipcsum.h | 5 +++++
src/ipfilter.h | 5 +++++
src/ipfrag.h | 5 +++++
src/iptraf-ng-compat.h | 2 +-
src/isdntab.h | 5 +++++
src/landesc.h | 8 ++++----
src/list.h | 8 ++++----
src/log.h | 5 +++++
src/logvars.h | 5 +++++
src/options.h | 4 ++++
src/ospf.h | 4 ++++
src/othptab.h | 5 +++++
src/packet.h | 8 ++++----
src/parse-options.h | 8 ++++----
src/parseproto.h | 5 +++++
src/pktsize.h | 5 +++++
src/promisc.h | 5 +++++
src/revname.h | 5 +++++
src/rvnamed.h | 5 +++++
src/serv.h | 5 +++++
src/servname.h | 5 +++++
src/strbuf.h | 7 ++++---
src/tcptable.h | 5 +++++
src/tcptimeout.h | 5 +++++
src/timer.h | 5 +++++
src/tr.h | 5 +++++
src/tui/input.h | 4 ++++
src/tui/labels.h | 5 +++++
src/tui/listbox.h | 5 +++++
src/tui/menurt.h | 5 +++++
src/tui/msgboxes.h | 4 ++++
src/tui/tui.h | 8 ++++----
src/tui/winops.h | 5 +++++
51 files changed, 236 insertions(+), 25 deletions(-)
diff --git a/src/addproto.h b/src/addproto.h
index a3406cb..9f2cb22 100644
--- a/src/addproto.h
+++ b/src/addproto.h
@@ -1,4 +1,5 @@
-#define __addproto_h__
+#ifndef IPTRAF_NG_ADDPROTO_H
+#define IPTRAF_NG_ADDPROTO_H
#ifndef IPPROTO_IGP
#define IPPROTO_IGP 9
@@ -23,3 +24,5 @@
#ifndef IPPROTO_IPSEC_ESP
#define IPPROTO_IPSEC_ESP 50
#endif
+
+#endif /* IPTRAF_NG_ADDPROTO_H */
diff --git a/src/arphdr.h b/src/arphdr.h
index bbe7d4f..762a5be 100644
--- a/src/arphdr.h
+++ b/src/arphdr.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_ARPHDR_H
+#define IPTRAF_NG_ARPHDR_H
+
/*
* arp header format, stolen from the Linux include files.
*/
@@ -17,3 +20,5 @@ struct arp_hdr {
unsigned char ar_tha[ETH_ALEN]; /* target hardware address */
unsigned char ar_tip[4]; /* target IP address */
};
+
+#endif /* IPTRAF_NG_ARPHDR_H */
diff --git a/src/attrs.h b/src/attrs.h
index d9ccaba..d963550 100644
--- a/src/attrs.h
+++ b/src/attrs.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_ATTRS_H
+#define IPTRAF_NG_ATTRS_H
+
/* Attribute variables */
extern int STDATTR;
@@ -31,3 +34,5 @@ extern int UNKNIPATTR;
extern int UNKNATTR;
extern int IPV6ATTR;
extern int ICMPV6ATTR;
+
+#endif /* IPTRAF_NG_ATTRS_H */
diff --git a/src/bar.h b/src/bar.h
index a04b02e..b1be8d8 100644
--- a/src/bar.h
+++ b/src/bar.h
@@ -1,2 +1,7 @@
+#ifndef IPTRAF_NG_BAR_H
+#define IPTRAF_NG_BAR_H
+
void set_barptr(void **barptr, void *entry, time_t * starttime, void *spanbr,
size_t size, WINDOW * win, int *cleared, int x);
+
+#endif /* IPTRAF_NG_BAR_H */
diff --git a/src/cidr.h b/src/cidr.h
index 995dde9..5e66b03 100644
--- a/src/cidr.h
+++ b/src/cidr.h
@@ -1,3 +1,5 @@
+#ifndef IPTRAF_NG_CIDR_H
+#define IPTRAF_NG_CIDR_H
/*
* cidr.h - prototypes for cidr.c
@@ -18,3 +20,5 @@ char *cidr_get_quad_mask(unsigned int maskbits);
unsigned int cidr_get_maskbits(unsigned long mask);
void cidr_split_address(char *cidr_addr, char *addresspart,
unsigned int *maskbits);
+
+#endif /* IPTRAF_NG_CIDR_H */
diff --git a/src/deskman.h b/src/deskman.h
index e6e7a81..f55deac 100644
--- a/src/deskman.h
+++ b/src/deskman.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_DESKMAN_H
+#define IPTRAF_NG_DESKMAN_H
+
/*
deskman.h - header file for deskman.c
Written by Gerard Paul Java
@@ -20,3 +23,5 @@ void printlargenum(unsigned long long i, WINDOW * win);
void infobox(char *text, char *prompt);
void standardcolors(int color);
void show_sort_statwin(WINDOW **, PANEL **);
+
+#endif /* IPTRAF_NG_DESKMAN_H */
diff --git a/src/dirs.h b/src/dirs.h
index c21f9b5..7d4214b 100644
--- a/src/dirs.h
+++ b/src/dirs.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_DIRS_H
+#define IPTRAF_NG_DIRS_H
+
/*
Copyright (C) 2011 Nikola Pajkovsky (npajkovs(a)redhat.com)
@@ -150,3 +153,5 @@
#ifndef PATH_MAX
#define PATH_MAX 4095
#endif
+
+#endif /* IPTRAF_NG_DIRS_H */
diff --git a/src/error.h b/src/error.h
index d6df16a..1e57c3d 100644
--- a/src/error.h
+++ b/src/error.h
@@ -1 +1,6 @@
+#ifndef IPTRAF_NG_ERROR_H
+#define IPTRAF_NG_ERROR_H
+
void write_error(char *msg, int daemonized);
+
+#endif /* IPTRAF_NG_ERROR_H */
diff --git a/src/externs.h b/src/externs.h
index bf94d22..8bab898 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -1,3 +1,5 @@
+#ifndef IPTRAF_NG_EXTERNS_H
+#define IPTRAF_NG_EXTERNS_H
/***
@@ -23,3 +25,5 @@ void hostmon(const struct OPTIONS *options, int facilitytime, char
*ifptr,
void setoptions(struct OPTIONS *options, struct porttab **ports);
void loadoptions(struct OPTIONS *options);
void saveoptions(struct OPTIONS *options);
+
+#endif /* IPTRAF_NG_EXTERNS_H */
diff --git a/src/fltdefs.h b/src/fltdefs.h
index d564661..3ef5abc 100644
--- a/src/fltdefs.h
+++ b/src/fltdefs.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_FLTDEFS_H
+#define IPTRAF_NG_FLTDEFS_H
+
/***
fltdefs.h - declarations for the TCP, UDP, and misc IP filters
@@ -65,3 +68,5 @@ struct filterlist {
struct filterent *tail;
unsigned int lastpos;
};
+
+#endif /* IPTRAF_NG_FLTDEFS_H */
diff --git a/src/fltedit.h b/src/fltedit.h
index 1e4c0ed..009fcaa 100644
--- a/src/fltedit.h
+++ b/src/fltedit.h
@@ -1,6 +1,11 @@
+#ifndef IPTRAF_NG_FLTEDIT_H
+#define IPTRAF_NG_FLTEDIT_H
+
void definefilter(int *aborted);
int loadfilter(char *filename, struct filterlist *fl, int resolve);
void savefilter(char *filename, struct filterlist *fl);
void destroyfilter(struct filterlist *fl);
void editfilter(int *aborted);
void delfilter(int *aborted);
+
+#endif /* IPTRAF_NG_FLTEDIT_H */
diff --git a/src/fltmgr.h b/src/fltmgr.h
index c28d5ae..1da1d5c 100644
--- a/src/fltmgr.h
+++ b/src/fltmgr.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_FLTMGR_H
+#define IPTRAF_NG_FLTMGR_H
+
/***
fltmgr.h - filter list management routine prototypes
@@ -33,3 +36,5 @@ void listfileerr(int code);
int mark_filter_change(void);
void clear_flt_tag(void);
#endif
+
+#endif /* IPTRAF_NG_FLTMGR_H */
diff --git a/src/fltselect.h b/src/fltselect.h
index 36e9ba0..6a0108b 100644
--- a/src/fltselect.h
+++ b/src/fltselect.h
@@ -1,3 +1,5 @@
+#ifndef IPTRAF_NG_FLTSELECT_H
+#define IPTRAF_NG_FLTSELECT_H
/***
@@ -23,3 +25,5 @@ void config_filters(struct filterstate *filter);
void loadfilters(struct filterstate *filter);
void savefilters(struct filterstate *filter);
int nonipfilter(struct filterstate *filter, unsigned int protocol);
+
+#endif /* IPTRAF_NG_FLTSELECT_H */
diff --git a/src/getpath.h b/src/getpath.h
index abbdb92..e9f7819 100644
--- a/src/getpath.h
+++ b/src/getpath.h
@@ -1,6 +1,11 @@
+#ifndef IPTRAF_NG_GETPATH_H
+#define IPTRAF_NG_GETPATH_H
+
#define T_WORKDIR 1
#define T_LOGDIR 2
#define T_EXECDIR 3
#define T_LOCKDIR 4
char *get_path(int dirtype, char *file);
+
+#endif /* IPTRAF_NG_GETPATH_H */
diff --git a/src/hostmon.h b/src/hostmon.h
index acfa77d..34251dc 100644
--- a/src/hostmon.h
+++ b/src/hostmon.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_HOSTMON_H
+#define IPTRAF_NG_HOSTMON_H
+
/*
* hostmon.h - definitions used by the Ethernet station monitor
*/
@@ -49,3 +52,5 @@ struct ethtab {
WINDOW *tabwin;
PANEL *tabpanel;
};
+
+#endif /* IPTRAF_NG_HOSTMON_H */
diff --git a/src/ifaces.h b/src/ifaces.h
index c7be945..5bf313d 100644
--- a/src/ifaces.h
+++ b/src/ifaces.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_IFACES_H
+#define IPTRAF_NG_IFACES_H
+
/***
ifaces.h - prototype declaration for interface support determination
@@ -11,3 +14,5 @@ int iface_up(char *iface);
void err_iface_down(void);
void isdn_iface_check(int *fd, char *ifname);
char *gen_iface_msg(char *ifptr);
+
+#endif /* IPTRAF_NG_IFACES_H */
diff --git a/src/ifstats.h b/src/ifstats.h
index ecf2a6b..3c3ff08 100644
--- a/src/ifstats.h
+++ b/src/ifstats.h
@@ -1,3 +1,5 @@
+#ifndef IPTRAF_NG_IFSTATS_H
+#define IPTRAF_NG_IFSTATS_H
/***
@@ -95,3 +97,5 @@ struct iftotals {
unsigned long badtotal;
unsigned int interval;
};
+
+#endif /* IPTRAF_NG_IFSTATS_H */
diff --git a/src/instances.h b/src/instances.h
index e0e0626..c2c87a4 100644
--- a/src/instances.h
+++ b/src/instances.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_INSTANCES_H
+#define IPTRAF_NG_INSTANCES_H
+
/***
instances.h - header file for instances.c
@@ -15,3 +18,5 @@ int adjust_instance_count(char *countfile, int inc);
int get_instance_count(char *countfile);
int is_last_instance(void);
int first_active_facility(void);
+
+#endif /* IPTRAF_NG_INSTANCES_H */
diff --git a/src/ipcsum.h b/src/ipcsum.h
index a85b5ff..032531c 100644
--- a/src/ipcsum.h
+++ b/src/ipcsum.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_IPCSUM_H
+#define IPTRAF_NG_IPCSUM_H
+
/***
ipcsum.h - prototype declaration for the standard IP checksum calculation
@@ -8,3 +11,5 @@ routine
#include <sys/types.h>
int in_cksum(u_short * addr, int len);
+
+#endif /* IPTRAF_NG_IPCSUM_H */
diff --git a/src/ipfilter.h b/src/ipfilter.h
index 94974b8..b1b8195 100644
--- a/src/ipfilter.h
+++ b/src/ipfilter.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_IPFILTER_H
+#define IPTRAF_NG_IPFILTER_H
+
void gethostparams(struct hostparams *data, char *init_saddr, char *init_smask,
char *init_sport1, char *init_sport2, char *init_daddr,
char *init_dmask, char *init_dport1, char *init_dport2,
@@ -8,3 +11,5 @@ void ipfilterselect(struct filterlist *fl, char *filename, int *fltcode,
int ipfilter(unsigned long saddr, unsigned long daddr, unsigned int sport,
unsigned int dport, unsigned int protocol, int match_opp_mode,
struct filterlist *fl);
+
+#endif /* IPTRAF_NG_IPFILTER_H */
diff --git a/src/ipfrag.h b/src/ipfrag.h
index c492306..910df13 100644
--- a/src/ipfrag.h
+++ b/src/ipfrag.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_IPFRAG_H
+#define IPTRAF_NG_IPFRAG_H
+
/***
ipfrag.h - IP fragmentation hander definitions
@@ -47,3 +50,5 @@ void destroyfraglist(void);
unsigned int processfragment(struct iphdr *packet, unsigned int *sport,
unsigned int *dport, int *firstin);
+
+#endif /* IPTRAF_NG_IPFRAG_H */
diff --git a/src/iptraf-ng-compat.h b/src/iptraf-ng-compat.h
index d06cb1e..f5a58fe 100644
--- a/src/iptraf-ng-compat.h
+++ b/src/iptraf-ng-compat.h
@@ -137,4 +137,4 @@ static inline int strtol_i(char const *s, int base, int *result)
}
#endif
-#endif
+#endif /* IPTRAF_NG_COMPAT_H */
diff --git a/src/isdntab.h b/src/isdntab.h
index be9a059..48cb8ad 100644
--- a/src/isdntab.h
+++ b/src/isdntab.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_ISDNTAB_H
+#define IPTRAF_NG_ISDNTAB_H
+
struct isdntabent {
char ifname[IFNAMSIZ];
unsigned int encap;
@@ -13,3 +16,5 @@ void add_isdn_entry(struct isdntab *list, char *ifname, int isdn_fd);
struct isdntabent *isdn_table_lookup(struct isdntab *list, char *ifname,
int isdn_fd);
void destroy_isdn_table(struct isdntab *list);
+
+#endif /* IPTRAF_NG_ISDNTAB_H */
diff --git a/src/landesc.h b/src/landesc.h
index 61c8a74..702e4a3 100644
--- a/src/landesc.h
+++ b/src/landesc.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_LANDESC_H
+#define IPTRAF_NG_LANDESC_H
+
/***
ethdesc.c - Ethernet host description management module
@@ -16,9 +19,6 @@ GNU General Public License for more details.
***/
-#ifndef LANDESC_H
-#define LANDESC_H
-
#include "list.h"
#define WITHETCETHERS 1
@@ -36,4 +36,4 @@ void free_eth_desc(struct eth_desc *hd);
void manage_eth_desc(unsigned int linktype);
-#endif
+#endif /* IPTRAF_NG_LANDESC_H */
diff --git a/src/list.h b/src/list.h
index a2feaa3..bb8d77a 100644
--- a/src/list.h
+++ b/src/list.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_LIST_H
+#define IPTRAF_NG_LIST_H
+
/*
Copyright (C) 2010 Nikola Pajkovsky (npajkovs(a)redhat.com)
@@ -16,9 +19,6 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef LIST_H
-#define LIST_H
-
struct list_head {
struct list_head *next, *prev;
};
@@ -98,4 +98,4 @@ static inline int list_empty(const struct list_head *head)
&pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
-#endif
+#endif /* IPTRAF_NG_LIST_H */
diff --git a/src/log.h b/src/log.h
index b0388a1..ff3c2b8 100644
--- a/src/log.h
+++ b/src/log.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_LOG_H
+#define IPTRAF_NG_LOG_H
+
/***
log.h - the iptraf logging facility header file
@@ -15,3 +18,5 @@ void rotate_logfile(FILE ** fd, char *name);
void check_rotate_flag(FILE ** fd, int logging);
void announce_rotate_prepare(FILE * fd);
void announce_rotate_complete(FILE * fd);
+
+#endif /* IPTRAF_NG_LOG_H */
diff --git a/src/logvars.h b/src/logvars.h
index f0ccd87..41b2e5c 100644
--- a/src/logvars.h
+++ b/src/logvars.h
@@ -1,4 +1,9 @@
+#ifndef IPTRAF_NG_LOGVARS_H
+#define IPTRAF_NG_LOGVARS_H
+
extern int rotate_flag;
extern char target_logname[160];
extern char current_logfile[160];
extern char graphing_logfile[160];
+
+#endif /* IPTRAF_NG_LOGVARS_H */
diff --git a/src/options.h b/src/options.h
index cf1097c..1994010 100644
--- a/src/options.h
+++ b/src/options.h
@@ -1,3 +1,5 @@
+#ifndef IPTRAF_NG_OPTIONS_H
+#define IPTRAF_NG_OPTIONS_H
struct OPTIONS {
unsigned int color:1, logging:1, revlook:1, servnames:1, promisc:1,
@@ -10,3 +12,5 @@ struct OPTIONS {
#define DEFAULT_UPDATE_DELAY 50000 /* usec screen delay if update rate 0 */
#define HOSTMON_UPDATE_DELAY 100000
+
+#endif /* IPTRAF_NG_OPTIONS_H */
diff --git a/src/ospf.h b/src/ospf.h
index aabd7b1..6194b62 100644
--- a/src/ospf.h
+++ b/src/ospf.h
@@ -1,3 +1,5 @@
+#ifndef IPTRAF_NG_OSPF_H
+#define IPTRAF_NG_OSPF_H
/***
@@ -16,3 +18,5 @@ struct ospfhdr {
u_short ospf_chksum;
u_short ospf_authtype;
}
+
+#endif /* IPTRAF_NG_OSPF_H */
diff --git a/src/othptab.h b/src/othptab.h
index fe8c740..14f39f9 100644
--- a/src/othptab.h
+++ b/src/othptab.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_OTHPTAB_H
+#define IPTRAF_NG_OTHPTAB_H
+
/***
othptab.h - header file for the non-TCP routines
@@ -140,3 +143,5 @@ void printothpentry(struct othptable *table, struct othptabent
*entry,
void refresh_othwindow(struct othptable *table);
void destroyothptable(struct othptable *table);
+
+#endif /* IPTRAF_NG_OTHPTAB_H */
diff --git a/src/packet.h b/src/packet.h
index c5da3d6..49cc0b6 100644
--- a/src/packet.h
+++ b/src/packet.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_PACKET_H
+#define IPTRAF_NG_PACKET_H
+
/***
packet.h - external declarations for packet.c
@@ -12,9 +15,6 @@ Written by Gerard Paul Java
* with reasonable numbers of options.
*/
-#ifndef PACKET_H
-#define PACKET_H
-
#define SNAPSHOT_LEN 96
#define MAX_PACKET_SIZE 17664
#define ALIGNED_BUF_LEN 120
@@ -46,4 +46,4 @@ int processpacket(char *tpacket, char **packet, unsigned int *br,
int match_opposite, char *ifname, char *ifptr);
void pkt_cleanup(void);
-#endif
+#endif /* IPTRAF_NG_PACKET_H */
diff --git a/src/parse-options.h b/src/parse-options.h
index d927378..41b6547 100644
--- a/src/parse-options.h
+++ b/src/parse-options.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_PARSE_OPTIONS_H
+#define IPTRAF_NG_PARSE_OPTIONS_H
+
/*
Copyright (C) 2010 Nikola Pajkovsky (npajkovs(a)redhat.com)
@@ -16,9 +19,6 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef PARSE_OPTIONS_H
-#define PARSE_OPTIONS_H
-
enum parse_opt_type {
OPTION_BOOL,
OPTION_GROUP,
@@ -57,4 +57,4 @@ void parse_opts(int argc, char **argv, const struct options *opt,
void parse_usage_and_die(const char *const *usage, const struct options *opt);
-#endif
+#endif /* IPTRAF_NG_PARSE_OPTIONS_H */
diff --git a/src/parseproto.h b/src/parseproto.h
index 4d407c6..4931402 100644
--- a/src/parseproto.h
+++ b/src/parseproto.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_PARSEPROTO_H
+#define IPTRAF_NG_PARSEPROTO_H
+
#define RANGE_OK 0
#define COMMA_EXPECTED 1
#define INVALID_RANGE 2
@@ -8,3 +11,5 @@ void get_next_protorange(char *src, char **cptr, unsigned int *proto1,
unsigned int *proto2, int *parse_result,
char **badtokenptr);
int validate_ranges(char *src, int *parse_result, char **bptr);
+
+#endif /* IPTRAF_NG_PARSEPROTO_H */
diff --git a/src/pktsize.h b/src/pktsize.h
index afdf9c5..4d8708b 100644
--- a/src/pktsize.h
+++ b/src/pktsize.h
@@ -1,5 +1,10 @@
+#ifndef IPTRAF_NG_PKTSIZE_H
+#define IPTRAF_NG_PKTSIZE_H
+
struct ifstat_brackets {
unsigned int floor;
unsigned int ceil;
unsigned long count;
};
+
+#endif /* IPTRAF_NG_PKTSIZE_H */
diff --git a/src/promisc.h b/src/promisc.h
index 7f4fe1f..f062ca1 100644
--- a/src/promisc.h
+++ b/src/promisc.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_PROMISC_H
+#define IPTRAF_NG_PROMISC_H
+
/*
* promisc.h - definitions for promiscuous state save/recovery
*
@@ -24,3 +27,5 @@ void save_promisc_list(struct promisc_states *list);
void load_promisc_list(struct promisc_states **list);
void srpromisc(int mode, struct promisc_states *promisc_list);
void destroy_promisc_list(struct promisc_states **list);
+
+#endif /* IPTRAF_NG_PROMISC_H */
diff --git a/src/revname.h b/src/revname.h
index b0740ce..0a2f2ea 100644
--- a/src/revname.h
+++ b/src/revname.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_REVNAME_H
+#define IPTRAF_NG_REVNAME_H
+
/***
revname.h - public declarations related to reverse name resolution
@@ -11,3 +14,5 @@ void close_rvn_socket(int fd);
int revname(int *lookup, struct in_addr *saddr, struct in6_addr *s6addr,
char *target, int rvnfd);
+
+#endif /* IPTRAF_NG_REVNAME_H */
diff --git a/src/rvnamed.h b/src/rvnamed.h
index 7092e07..91442d6 100644
--- a/src/rvnamed.h
+++ b/src/rvnamed.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_RVNAMED_H
+#define IPTRAF_NG_RVNAMED_H
+
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -25,3 +28,5 @@ struct rvn {
struct in6_addr s6addr;
char fqdn[45];
};
+
+#endif /* IPTRAF_NG_RVNAMED_H */
diff --git a/src/serv.h b/src/serv.h
index 318aca9..7d59b50 100644
--- a/src/serv.h
+++ b/src/serv.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_SERV_H
+#define IPTRAF_NG_SERV_H
+
/***
serv.h - TCP/UDP port statistics header file
@@ -67,3 +70,5 @@ void addmoreports(struct porttab **table);
void loadaddports(struct porttab **table);
void destroyporttab(struct porttab *table);
void removeaport(struct porttab **table);
+
+#endif /* IPTRAF_NG_SERV_H */
diff --git a/src/servname.h b/src/servname.h
index 9d59aeb..55de3ae 100644
--- a/src/servname.h
+++ b/src/servname.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_SERVNAME_H
+#define IPTRAF_NG_SERVNAME_H
+
/***
servname.h - function prototype for service lookup
@@ -6,3 +9,5 @@ servname.h - function prototype for service lookup
void servlook(int servnames, unsigned int port, unsigned int protocol,
char *target, int maxlen);
+
+#endif /* IPTRAF_NG_SERVNAME_H */
diff --git a/src/strbuf.h b/src/strbuf.h
index b9df8f8..706fd5d 100644
--- a/src/strbuf.h
+++ b/src/strbuf.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_STRBUF_H
+#define IPTRAF_NG_STRBUF_H
+
/*
strbuf.h - string buffer
@@ -17,8 +20,6 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef STRBUF_H
-#define STRBUF_H
struct strbuf {
/* Size of the allocated buffer. Always > 0. */
@@ -89,4 +90,4 @@ struct strbuf *strbuf_append_strf(struct strbuf *strbuf, const char
*format,
struct strbuf *strbuf_prepend_strf(struct strbuf *strbuf, const char *format,
...);
-#endif
+#endif /* IPTRAF_NG_STRBUF_H */
diff --git a/src/tcptable.h b/src/tcptable.h
index 4981ad0..37e473c 100644
--- a/src/tcptable.h
+++ b/src/tcptable.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_TCPTABLE_H
+#define IPTRAF_NG_TCPTABLE_H
+
/***
tcptable.h -- table manipulation for the statistics display.
@@ -131,3 +134,5 @@ void flushclosedentries(struct tcptable *table, unsigned long
*screen_idx,
void write_timeout_log(int logging, FILE * logfile, struct tcptableent *tcpnode,
struct OPTIONS *opts);
+
+#endif /* IPTRAF_NG_TCPTABLE_H */
diff --git a/src/tcptimeout.h b/src/tcptimeout.h
index 53babfb..825c697 100644
--- a/src/tcptimeout.h
+++ b/src/tcptimeout.h
@@ -1,2 +1,7 @@
+#ifndef IPTRAF_NG_TCPTIMEOUT_H
+#define IPTRAF_NG_TCPTIMEOUT_H
+
void write_timeout_log(int logging, FILE * logfile, struct tcptableent *tcpnode,
struct OPTIONS *opts);
+
+#endif /* IPTRAF_NG_TCPTIMEOUT_H */
diff --git a/src/timer.h b/src/timer.h
index 43f479c..24bbf9d 100644
--- a/src/timer.h
+++ b/src/timer.h
@@ -1 +1,6 @@
+#ifndef IPTRAF_NG_TIMER_H
+#define IPTRAF_NG_TIMER_H
+
void printelapsedtime(time_t start, time_t now, int y, int x, WINDOW * win);
+
+#endif /* IPTRAF_NG_TIMER_H */
diff --git a/src/tr.h b/src/tr.h
index a560519..31fe5a6 100644
--- a/src/tr.h
+++ b/src/tr.h
@@ -1,5 +1,10 @@
+#ifndef IPTRAF_NG_TR_H
+#define IPTRAF_NG_TR_H
+
/*
* tr.h - prototype for Token Ring header parser.
*/
unsigned int get_tr_ip_offset(unsigned char *pkt);
+
+#endif /* IPTRAF_NG_TR_H */
diff --git a/src/tui/input.h b/src/tui/input.h
index 33706da..ea93eb0 100644
--- a/src/tui/input.h
+++ b/src/tui/input.h
@@ -1,3 +1,5 @@
+#ifndef IPTRAF_NG_TUI_INPUT_H
+#define IPTRAF_NG_TUI_INPUT_H
/***
@@ -38,3 +40,5 @@ void tx_addfield(struct FIELDLIST *list, unsigned int len, unsigned int
y,
void tx_getinput(struct FIELDLIST *list, struct FIELD *field, int *exitkey);
void tx_fillfields(struct FIELDLIST *list, int *aborted);
void tx_destroyfields(struct FIELDLIST *list);
+
+#endif /* IPTRAF_NG_TUI_INPUT_H */
diff --git a/src/tui/labels.h b/src/tui/labels.h
index e6b8278..fb688e8 100644
--- a/src/tui/labels.h
+++ b/src/tui/labels.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_TUI_LABELS_H
+#define IPTRAF_NG_TUI_LABELS_H
+
#include <curses.h>
void tx_printkeyhelp(char *keytext, char *desc, WINDOW * win, int highattr,
@@ -5,3 +8,5 @@ void tx_printkeyhelp(char *keytext, char *desc, WINDOW * win, int
highattr,
void tx_menukeyhelp(int textattr, int highattr);
void tx_listkeyhelp(int textattr, int highattr);
char *tx_ltrim(char *str);
+
+#endif /* IPTRAF_NG_TUI_LABELS_H */
diff --git a/src/tui/listbox.h b/src/tui/listbox.h
index 999a37c..2ba8430 100644
--- a/src/tui/listbox.h
+++ b/src/tui/listbox.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_TUI_LISTBOX_H
+#define IPTRAF_NG_TUI_LISTBOX_H
+
#include <curses.h>
#define MAX_TEXT_LENGTH 240
@@ -42,3 +45,5 @@ void tx_close_listbox(struct scroll_list *list);
void tx_destroy_list(struct scroll_list *list);
#define tx_destroy_listbox tx_destroy_list
+
+#endif /* IPTRAF_NG_TUI_LISTBOX_H */
diff --git a/src/tui/menurt.h b/src/tui/menurt.h
index 7a540f9..73a88db 100644
--- a/src/tui/menurt.h
+++ b/src/tui/menurt.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_TUI_MENURT_H
+#define IPTRAF_NG_TUI_MENURT_H
+
/***
menu.h - declaration file for my menu library
Copyright (c) Gerard Paul R. Java 1997
@@ -52,3 +55,5 @@ extern void tx_showitem(struct MENU *menu, struct ITEM *itemptr, int
selected);
extern void tx_showmenu(struct MENU *menu);
extern void tx_operatemenu(struct MENU *menu, int *row, int *aborted);
extern void tx_destroymenu(struct MENU *menu);
+
+#endif /* IPTRAF_NG_TUI_MENURT_H */
diff --git a/src/tui/msgboxes.h b/src/tui/msgboxes.h
index 147fe67..57eb8d8 100644
--- a/src/tui/msgboxes.h
+++ b/src/tui/msgboxes.h
@@ -1,6 +1,10 @@
+#ifndef IPTRAF_NG_TUI_MSGBOXES_H
+#define IPTRAF_NG_TUI_MSGBOXES_H
#define ANYKEY_MSG "Press a key to continue"
void tx_init_error_attrs(int border, int text, int prompt);
void tx_init_info_attrs(int border, int text, int prompt);
void tx_infobox(char *text, char *prompt);
+
+#endif /* IPTRAF_NG_TUI_MSGBOXES_H */
diff --git a/src/tui/tui.h b/src/tui/tui.h
index 99a3ecc..07fc121 100644
--- a/src/tui/tui.h
+++ b/src/tui/tui.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_TUI_TUI_H
+#define IPTRAF_NG_TUI_TUI_H
+
/*
Copyright (C) 2010 Nikola Pajkovsky (npajkovs(a)redhat.com)
@@ -16,11 +19,8 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef TUI_H
-#define TUI_H
-
#define ANYKEY_MSG "Press a key to continue"
extern void tui_error(const char *prompt, const char *err, ...);
-#endif
+#endif /* IPTRAF_NG_TUI_TUI_H */
diff --git a/src/tui/winops.h b/src/tui/winops.h
index 4667740..53f7038 100644
--- a/src/tui/winops.h
+++ b/src/tui/winops.h
@@ -1,3 +1,6 @@
+#ifndef IPTRAF_NG_TUI_WINOPS_H
+#define IPTRAF_NG_TUI_WINOPS_H
+
/***
stdwinset.h - prototype declaration for setting the standard window settings
@@ -13,3 +16,5 @@ void tx_refresh_screen(void);
void tx_colorwin(WINDOW * win);
void tx_wcoloreol(WINDOW * win);
void tx_box(WINDOW * win, int vline, int hline);
+
+#endif /* IPTRAF_NG_TUI_WINOPS_H */
--
1.7.8.4