Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,154 changes: 6,029 additions & 4,125 deletions configure

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions honeyd.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ static char *servicelog = NULL;
* provide, but I'm not familiar enough with honeyd to be comfortable with putting it in myself.
*/


static struct option honeyd_long_opts[] = {
{"include-dir", 0, &honeyd_show_include_dir, 1},
{"data-dir", 0, &honeyd_show_data_dir, 1},
Expand Down
2 changes: 1 addition & 1 deletion honeyd.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

#include "compat/sys/tree.h"

struct event_base *libevent_base;
extern struct event_base *libevent_base;

struct config {
char *config; /* Name of configuration file */
Expand Down
1 change: 1 addition & 0 deletions honeydstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
int pcap_datalink(void *some) { return (-1); }
char *honeyd_osfp_name(struct ip_hdr *hdr) { return (NULL); }
void hooks_add_packet_hook(int protocol, int dir, void *callback, void *arg) {}
struct event_base *stats_libevent_base;

/* Prototypes */
int
Expand Down
2 changes: 1 addition & 1 deletion honeydstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct user {

SPLAY_HEAD(usertree, user);

struct event_base *stats_libevent_base;
extern struct event_base *stats_libevent_base;

int signature_process(struct evbuffer *evbuf);
void checkpoint_replay(int fd);
Expand Down
3 changes: 3 additions & 0 deletions personality.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ int npersons;
struct personate person_drop = {};
static struct timeval tv_periodic;

struct perstree personalities;
struct xp_fprint_tree xp_fprints;

SPLAY_GENERATE(perstree, personality, node, perscompare);

/* ET - For the Xprobe fingerprint tree */
Expand Down
15 changes: 13 additions & 2 deletions personality.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,27 @@ int xprobe_personality_parse(FILE *fp);
void xprobe_personality_init(void);
void print_perstree(void);


struct perstree { \
struct personality *sph_root; /* root of the tree */ \
};

/* Splay stuff here so other modules can use it */
SPLAY_HEAD(perstree, personality) personalities;
extern struct perstree personalities;

static int
perscompare(struct personality *a, struct personality *b)
{
return (strcmp(a->name, b->name));
}
SPLAY_PROTOTYPE(perstree, personality, node, perscompare);

SPLAY_HEAD(xp_fprint_tree, xp_fingerprint) xp_fprints;
struct xp_fprint_tree { \
struct xp_fingerprint *sph_root; /* root of the tree */ \
};

extern struct xp_fprint_tree xp_fprints;

static int
xp_fprint_compare(struct xp_fingerprint *a, struct xp_fingerprint *b)
{
Expand Down
1 change: 1 addition & 0 deletions rrdtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@

extern rand_t *honeyd_rand;

struct event_base *rrdtool_libevent_base;

static void rrdtool_restart(int, short, void *);
static void rrdtool_write_command(struct rrdtool_drv *, char *);
Expand Down
2 changes: 1 addition & 1 deletion rrdtool.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct rrdtool_command {

#define MAX_RRD_DATASRCS 100

struct event_base *rrdtool_libevent_base;
extern struct event_base *rrdtool_libevent_base;

struct rrdtool_drv {
int fd;
Expand Down
4 changes: 4 additions & 0 deletions stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ static void stats_make_fd(struct addr *, u_short);
static void stats_activate(struct stats *stats);
static void stats_deactivate(struct stats *stats);

enum SIGTAGS signature_tags;
enum MEASURETAGS measurement_tags;
struct event_base *libevent_base;

/* Many static variables. We don't like them */

/* We might have other consumers of our created records */
Expand Down
13 changes: 9 additions & 4 deletions stats.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
/*
* Copyright (c) 2003, 2004 Niels Provos <[email protected]>
* All rights reserved.
Expand Down Expand Up @@ -91,9 +92,11 @@ struct stats {
reserved:4;
};

enum {
enum MEASURETAGS {
M_COUNTER, M_TV_START, M_TV_END, M_RECORD, M_MAX
} measurement_tags;
};

extern enum MEASURETAGS measurement_tags;

struct measurement {
uint32_t counter;
Expand All @@ -105,9 +108,11 @@ struct measurement {
#define SHA1_DIGESTSIZE 20
#endif

enum {
enum SIGTAGS {
SIG_NAME, SIG_DIGEST, SIG_DATA, SIG_COMPRESSED_DATA, SIG_MAX
} signature_tags;
};

extern enum SIGTAGS signature_tags;

struct signature {
char *name;
Expand Down
3 changes: 3 additions & 0 deletions tagging.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@

#include "tagging.h"

enum STATE address_tags;
enum RECORDTAGS record_tags;

void
tag_marshal_record(struct evbuffer *evbuf, uint8_t tag, struct record *record)
{
Expand Down
13 changes: 9 additions & 4 deletions tagging.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ struct hash {
u_char digest[SHINGLE_SIZE];
};

enum {
enum RECORDTAGS {
REC_TV_START, REC_TV_END, REC_SRC, REC_DST, REC_SRC_PORT, REC_DST_PORT,
REC_PROTO, REC_STATE, REC_OS_FP, REC_HASH, REC_BYTES, REC_FLAGS,
REC_MAX_TAGS
} record_tags;
};

extern enum RECORDTAGS record_tags;

#define RECORD_STATE_NEW 0x01

Expand All @@ -67,9 +69,12 @@ struct record {
TAILQ_HEAD(hashq, hash) hashes; /* optional */
};

enum {
enum STATE {
ADDR_TYPE, ADDR_BITS, ADDR_ADDR, ADDR_MAX_TAGS
} address_tags;
};

extern enum STATE address_tags;


void record_marshal(struct evbuffer *, struct record *);

Expand Down