Skip to content

Commit

Permalink
Add ifndef guards to prevent double-inclusion of headers
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Dec 23, 2014
1 parent c95d656 commit 8b48716
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NmapOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@

/* $Id$ */

#ifndef NMAP_OPS_H
#define NMAP_OPS_H

#include "nmap.h"
#include "global_structures.h"
#include "output.h"
Expand Down Expand Up @@ -425,3 +428,4 @@ class NmapOps {
bool spoof_mac_set;
};

#endif
5 changes: 5 additions & 0 deletions ncat/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,9 @@

/* $Id$ */

#ifndef NCAT_BASE64_H
#define NCAT_BASE64_H

char *b64enc(const unsigned char *data, int len);

#endif
5 changes: 5 additions & 0 deletions ncat/ncat_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
* *
***************************************************************************/

#ifndef NCAT_CONFIG_H
#define NCAT_CONFIG_H

/* This is a wrapper that selects config.h or config_win.h depending on whether
we're using Autoconf or a static Windows configuration file. */

Expand All @@ -128,3 +131,5 @@
#else
#error "No config.h, and not WIN32"
#endif

#endif
4 changes: 4 additions & 0 deletions ncat/ncat_connect.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@
***************************************************************************/

/* $Id$ */
#ifndef NCAT_CONNECT_H
#define NCAT_CONNECT_H

#include "nsock.h"

/* handle nsock-powered connections */
extern int ncat_connect(void);

#endif
5 changes: 5 additions & 0 deletions ncat/ncat_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@

/* $Id$ */

#ifndef NCAT_CORE_H
#define NCAT_CORE_H

#include "nsock.h"
#include "nbase.h"
#include "util.h"
Expand Down Expand Up @@ -266,3 +269,5 @@ extern void set_lf_mode(void);
extern int getaddrfamily(const char *addr);
extern int setenv_portable(const char *name, const char *value);
extern void setup_environment(struct fdinfo *fdinfo);

#endif
4 changes: 4 additions & 0 deletions ncat/ncat_exec.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
***************************************************************************/

/* $Id$ */
#ifndef NCAT_EXEC_H
#define NCAT_EXEC_H

/* fork and exec a child process with netexec. Close the given file descriptor
in the parent process. Return the child's PID or -1 on error. */
Expand All @@ -133,3 +135,5 @@ extern void netexec(struct fdinfo *info, char *cmdexec);
child process dies. This is only used on Windows. */
extern void set_pseudo_sigchld_handler(void (*handler)(void));
#endif

#endif
4 changes: 4 additions & 0 deletions ncat/ncat_listen.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,9 @@
***************************************************************************/

/* $Id$ */
#ifndef NCAT_LISTEN_H
#define NCAT_LISTEN_H

extern int ncat_listen(void);

#endif
5 changes: 5 additions & 0 deletions ncat/ncat_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@

/* $Id$ */

#ifndef NCAT_PROXY_H
#define NCAT_PROXY_H

/* How long we will honor nonces we issue, in seconds. The client gets back a
407 with stale="true" if the nonce is valid but expired. Nonces are good only
once, so this is really a limit on how long we have to keep nonces on a
Expand All @@ -130,3 +133,5 @@
* Simple forking HTTP proxy.
*/
extern int ncat_http_server(void);

#endif
3 changes: 3 additions & 0 deletions ncat/ncat_ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
***************************************************************************/

/* $Id$ */
#ifndef NCAT_SSL_H
#define NCAT_SSL_H

#include "ncat_config.h"

Expand Down Expand Up @@ -159,3 +161,4 @@ extern int ssl_load_default_ca_certs(SSL_CTX *ctx);
extern int ssl_handshake(struct fdinfo *sinfo);

#endif
#endif
4 changes: 4 additions & 0 deletions nmap_dns.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@
* *
***************************************************************************/

#ifndef NMAP_DNS_H
#define NMAP_DNS_H

class Target;

#include "nbase.h"
Expand All @@ -131,3 +134,4 @@ const char *lookup_cached_host(u32 ip);

std::list<std::string> get_dns_servers();

#endif
4 changes: 4 additions & 0 deletions nmap_tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
* *
***************************************************************************/

#ifndef NMAP_TTY_H
#define NMAP_TTY_H

/*
* Initializes the terminal for unbuffered non-blocking input. Also
* registers tty_done() via atexit(). You need to call this before
Expand All @@ -133,3 +136,4 @@ void tty_init();
calling method should print a status message */
bool keyWasPressed();

#endif
4 changes: 4 additions & 0 deletions nse_ssl_cert.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@

/* $Id:$ */

#ifndef NMAP_SSL_CERT_H
#define NMAP_SSL_CERT_H

int l_get_ssl_certificate(lua_State *L);
int l_parse_ssl_certificate(lua_State *L);
void nse_nsock_init_ssl_cert(lua_State *L);

#endif
5 changes: 5 additions & 0 deletions scan_engine_connect.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,13 @@

/* $Id$ */

#ifndef SCAN_ENGINE_CONNECT_H
#define SCAN_ENGINE_CONNECT_H

#include "scan_engine.h"

UltraProbe *sendConnectScanProbe(UltraScanInfo *USI, HostScanStats *hss,
u16 destport, u8 tryno, u8 pingseq);
bool do_one_select_round(UltraScanInfo *USI, struct timeval *stime);

#endif
5 changes: 5 additions & 0 deletions scan_engine_raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@

/* $Id$ */

#ifndef SCAN_ENGINE_RAW_H
#define SCAN_ENGINE_RAW_H

#include "scan_engine.h"
#include "Target.h"
#include <vector>
Expand All @@ -139,3 +142,5 @@ UltraProbe *sendIPScanProbe(UltraScanInfo *USI, HostScanStats *hss,
bool get_arp_result(UltraScanInfo *USI, struct timeval *stime);
bool get_ns_result(UltraScanInfo *USI, struct timeval *stime);
bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime);

#endif
6 changes: 5 additions & 1 deletion traceroute.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@
* *
***************************************************************************/

/* $Id: nmap.h 6676 2008-01-12 22:39:34Z fyodor $ */
/* $Id$ */

#ifndef NMAP_TRACEROUTE_H
#define NMAP_TRACEROUTE_H

#include "Target.h"

Expand All @@ -130,3 +133,4 @@ int traceroute(std::vector<Target *> &Targets);

void traceroute_hop_cache_clear();

#endif

0 comments on commit 8b48716

Please sign in to comment.