aboutsummaryrefslogtreecommitdiffstats
path: root/glougloud/user.c
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-07-21 21:39:15 +0200
committerLaurent Ghigonis <laurent@p1sec.com>2012-07-21 21:39:15 +0200
commit3aa3890908a2fa24b7482ea1d0d8d03d15aab128 (patch)
treedbafc1b9f80b028a640e406fe766b984aaca24a0 /glougloud/user.c
parentadd libglouglou, for now only containing libglouglou.h, containing the (diff)
downloadglouglou-3aa3890908a2fa24b7482ea1d0d8d03d15aab128.tar.xz
glouglou-3aa3890908a2fa24b7482ea1d0d8d03d15aab128.zip
struct packet is now in libglouglou, so remove it from here and #include
<libglouglou.h>
Diffstat (limited to 'glougloud/user.c')
-rw-r--r--glougloud/user.c50
1 files changed, 2 insertions, 48 deletions
diff --git a/glougloud/user.c b/glougloud/user.c
index 0f2ae9b..a23a5e1 100644
--- a/glougloud/user.c
+++ b/glougloud/user.c
@@ -22,6 +22,8 @@
#include <pcap.h>
#include <pcap-int.h>
+#include <libglouglou.h>
+
#include "glougloud.h"
#include "imsgev.h"
@@ -36,7 +38,6 @@
#define CONN_TIMEOUT_ICMP 10 // XXX conf ?
#define CONN_FREEIDS_COUNT 65536 /* 2^16 as long as freeids are u_int16_t */
#define CONNTIMER 5 // XXX conf ?
-#define PACKET_VERSION 1
struct node {
LIST_ENTRY(node) entry;
@@ -95,53 +96,6 @@ struct capture {
int ptruncated;
};
-struct packet {
- u_int8_t ver;
- u_int8_t type;
-/* XXX nicer way for _SIZE ... ? */
-#define PACKET_NEWCONN 0
-#define PACKET_NEWCONN_SIZE (2 + sizeof((struct packet *)0)->pdat.newconn)
-#define PACKET_DELCONN 1
-#define PACKET_DELCONN_SIZE (2 + sizeof((struct packet *)0)->pdat.delconn)
-#define PACKET_DATA 2
-#define PACKET_DATA_SIZE (2 + sizeof((struct packet *)0)->pdat.data)
-#define PACKET_NAME 3
-#define PACKET_NAME_SIZE ((2 + sizeof((struct packet *)0)->pdat.name) - DNSNAME_MAX)
-
- union {
- struct newconn {
- u_int16_t id;
- u_int32_t src;
- u_int32_t dst;
- u_int8_t proto;
- u_int8_t size;
- } newconn;
- struct delconn {
- u_int16_t id;
- } delconn;
- struct data {
- u_int16_t connid;
- u_int8_t size;
- } data;
- struct name {
- u_int32_t addr;
- u_int8_t len;
- u_char fqdn[DNSNAME_MAX];
- } name;
- } pdat;
-#define newconn_id pdat.newconn.id
-#define newconn_src pdat.newconn.src
-#define newconn_dst pdat.newconn.dst
-#define newconn_proto pdat.newconn.proto
-#define newconn_size pdat.newconn.size
-#define delconn_id pdat.delconn.id
-#define data_connid pdat.data.connid
-#define data_size pdat.data.size
-#define name_addr pdat.name.addr
-#define name_len pdat.name.len
-#define name_fqdn pdat.name.fqdn
-};
-
struct phandler {
pcap_handler f;
int type;