[go: up one dir, main page]

Skip to content

Commit

Permalink
Merge pull request robertdavidgraham#280 from robertdavidgraham/libpcap
Browse files Browse the repository at this point in the history
dynamically load pcap
  • Loading branch information
robertdavidgraham authored Jun 6, 2017
2 parents 6c9abcb + 7872876 commit 39061a5
Show file tree
Hide file tree
Showing 33 changed files with 690 additions and 3,256 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ endif
# environment where things likely will work -- as well as anything
# works on the bajillion of different Linux environments
ifneq (, $(findstring linux, $(SYS)))
LIBS = -lpcap -lm -lrt -ldl -lpthread
LIBS = -lm -lrt -ldl -lpthread
INCLUDES =
FLAGS2 =
endif
Expand All @@ -23,7 +23,7 @@ endif
# my regularly regression-test environment. That means at any point
# in time, something might be minorly broken in Mac OS X.
ifneq (, $(findstring darwin, $(SYS)))
LIBS = -lpcap -lm
LIBS = -lm
INCLUDES = -I.
FLAGS2 =
INSTALL_DATA = -pm755
Expand All @@ -37,7 +37,7 @@ endif
# intended environment, so it make break in the future.
ifneq (, $(findstring mingw, $(SYS)))
INCLUDES = -Ivs10/include
LIBS = -L vs10/lib -lwpcap -lIPHLPAPI -lWs2_32
LIBS = -L vs10/lib -lIPHLPAPI -lWs2_32
FLAGS2 = -march=i686
endif

Expand All @@ -47,20 +47,20 @@ endif
# head with a hammer and want to feel a different sort of pain.
ifneq (, $(findstring cygwin, $(SYS)))
INCLUDES = -I.
LIBS = -lwpcap
LIBS =
FLAGS2 =
endif

# OpenBSD
ifneq (, $(findstring openbsd, $(SYS)))
LIBS = -lpcap -lm -pthread
LIBS = -lm -pthread
INCLUDES = -I.
FLAGS2 =
endif

# FreeBSD
ifneq (, $(findstring freebsd, $(SYS)))
LIBS = -lpcap -lm -pthread
LIBS = -lm -pthread
INCLUDES = -I.
FLAGS2 =
endif
Expand Down
4 changes: 4 additions & 0 deletions src/in-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ cndb_add(unsigned ip, const unsigned char *name, size_t name_length)

/***************************************************************************
***************************************************************************/
#if 0
static void
cndb_add_cn(unsigned ip, const unsigned char *data, size_t length)
{
Expand Down Expand Up @@ -106,9 +107,11 @@ cndb_add_cn(unsigned ip, const unsigned char *data, size_t length)
/* now insert into database */
cndb_add(ip, data+name_offset, name_length);
}
#endif

/***************************************************************************
***************************************************************************/
#if 0
static unsigned
found(const char *str, size_t str_len, const unsigned char *p, size_t length)
{
Expand All @@ -123,6 +126,7 @@ found(const char *str, size_t str_len, const unsigned char *p, size_t length)
}
return 0;
}
#endif

enum {
XUnknown,
Expand Down
4 changes: 3 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1428,14 +1428,15 @@ main_scan(struct Masscan *masscan)



void pcap_init(void);

/***************************************************************************
***************************************************************************/
int main(int argc, char *argv[])
{
struct Masscan masscan[1];
unsigned i;

usec_start = pixie_gettime();
#if defined(WIN32)
{WSADATA x; WSAStartup(0x101, &x);}
Expand Down Expand Up @@ -1506,6 +1507,7 @@ int main(int argc, char *argv[])

/* We need to do a separate "raw socket" initialization step. This is
* for Windows and PF_RING. */
pcap_init();
rawsock_init();

/* Init some protocol parser data structures */
Expand Down
2 changes: 1 addition & 1 deletion src/masscan-version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef MASSCAN_VERSION

#define MASSCAN_VERSION "1.0.3"
#define MASSCAN_VERSION "1.0.4"

#endif

Loading

0 comments on commit 39061a5

Please sign in to comment.