Permalink
Browse files

Cleaned up unused code

  • Loading branch information...
1 parent f899fd1 commit 2c55aacdd440c86490b1a96d200f9f3606429b49 gamelinux committed Mar 23, 2012
Showing with 1 addition and 47 deletions.
  1. +0 −35 src/dns.c
  2. +1 −7 src/passivedns.c
  3. +0 −5 src/passivedns.h
View
@@ -11,7 +11,6 @@
#include "dns.h"
static int archive(packetinfo *pi, ldns_pkt *decoded_dns);
-static int archive_query(packetinfo *pi, ldns_pkt *decoded_dns);
static int archive_lname_list(packetinfo *pi, ldns_rdf *lname,ldns_rr_list *list, ldns_buffer *buf, ldns_pkt *decoded_dns);
void associated_lookup_or_make_insert(pdns_record *lname_node, packetinfo *pi, unsigned char *rname_str, ldns_rr *rr);
pdns_record *pdnsr_lookup_or_make_new(uint64_t dnshash, packetinfo *pi, unsigned char *lname_str);
@@ -191,40 +190,6 @@ void dns_parser (packetinfo *pi) {
}
static int
-archive_query(packetinfo *pi, ldns_pkt *decoded_dns)
-{
- ldns_buffer *dns_buffer;
- int qa_rrcount;
- int i;
- uint8_t rcode;
- ldns_rr_list *questions;
-
- questions = ldns_pkt_question(decoded_dns);
- qa_rrcount = ldns_rr_list_rr_count(questions);
- dns_buffer = ldns_buffer_new(LDNS_MIN_BUFLEN);
- rcode = ldns_pkt_get_rcode(decoded_dns);
- dlog("[*] %d qa_rrcount\n", qa_rrcount);
-
- for (i = 0; i < qa_rrcount; i++) {
- ldns_rr *question_rr;
- ldns_rdf *rdf_data;
- int ret;
-
- question_rr = ldns_rr_list_rr(questions, i);
- rdf_data = ldns_rr_owner(question_rr);
-
- dlog("[D] rdf_data = %p\n", rdf_data);
- ret = archive_lname_list(pi, rdf_data, questions, dns_buffer, decoded_dns);
-
- if (ret < 0) {
- dlog("[D] archive_lname_list() returned error\n");
- }
- }
- ldns_buffer_free(dns_buffer);
- return(0);
-}
-
-static int
archive(packetinfo *pi, ldns_pkt *decoded_dns)
{
ldns_buffer *dns_buffer;
View
@@ -28,7 +28,7 @@
#include <netinet/in.h>
#include <signal.h>
#include <pcap.h>
-#include <resolv.h>
+//#include <resolv.h>
#include <getopt.h>
#include <time.h>
#include <sys/types.h>
@@ -452,8 +452,6 @@ connection *cxt_new(packetinfo *pi)
cxt->proto = pi->proto;
cxt->check = 0x00;
- cxt->c_asset = NULL;
- cxt->s_asset = NULL;
cxt->reversed = 0;
config.curcxt++;
@@ -470,8 +468,6 @@ int cxt_update_client(connection *cxt, packetinfo *pi)
pi->cxt = cxt;
pi->sc = SC_CLIENT;
- //if(!cxt->c_asset)
- // cxt->c_asset = pi->asset; // connection client asset
if (cxt->s_total_bytes > MAX_BYTE_CHECK
|| cxt->s_total_pkts > MAX_PKT_CHECK) {
return 0; // Dont Check!
@@ -489,8 +485,6 @@ int cxt_update_server(connection *cxt, packetinfo *pi)
pi->cxt = cxt;
pi->sc = SC_SERVER;
- //if(!cxt->s_asset)
- // cxt->s_asset = pi->asset; // server asset
if (cxt->d_total_bytes > MAX_BYTE_CHECK
|| cxt->d_total_pkts > MAX_PKT_CHECK) {
return 0; // Dont check!
View
@@ -246,8 +246,6 @@ typedef struct _connection {
uint8_t d_tcpFlags; /* tcpflags sent by destination */
uint8_t check; /* Flags spesifying checking */
uint16_t plid; /* Protocol layer ID (DNS TID) */
- struct _asset *c_asset; /* pointer to src asset */
- struct _asset *s_asset; /* pointer to server asset */
} connection;
#define CXT_DONT_CHECK_SERVER 0x01 /* Dont check server packets */
#define CXT_DONT_CHECK_CLIENT 0x02 /* Dont check client packets */
@@ -477,8 +475,6 @@ typedef struct _globalconfig {
uint8_t chroot_flag; /* Flag for going chroot */
uint8_t daemon_flag; /* Flag for going daemon */
uint64_t dnsf; /* Flags for DNS RR Type checks to do */
- uint8_t ctf; /* Flags for TCP checks, SYN,RST,FIN.... */
- uint8_t cof; /* Flags for other; icmp,udp,other,.... */
uint32_t payload; /* dump how much of the payload ? */
uint32_t curcxt;
uint32_t llcxt;
@@ -493,7 +489,6 @@ typedef struct _globalconfig {
char *net_ip_string; /**/
char *logfile; /* Filename of /var/log/passivedns.log */
char *logfile_nxd; /* Filename for NXDOMAIN logging /var/log/passivedns-nxd.log */
- char *fifo; /* Path to FIFO output */
char *pcap_file; /* Filename to pcap too read */
char *dev; /* Device name to use for sniffing */
char *dpath; /* ... ??? seriously ???... */

0 comments on commit 2c55aac

Please sign in to comment.