mirror of https://github.com/Chizi123/dnscomp.git

Joel Grunbaum
2020-10-18 58ce252432d5a407c84a3bc3720298ce2291d6a7
trying to make include and source directories
1 files modified
1 files added
36 ■■■■ changed files
Makefile 24 ●●●● patch | view | raw | blame | history
include/dns.h 12 ●●●●● patch | view | raw | blame | history
Makefile
@@ -1,12 +1,22 @@
CC=gcc
OBJ=main.o dns.o
DEPS=dns.h
CFLAGS=-g
_OBJ=main.o dns.o
_DEPS=dns.h
IDIR=include
CFLAGS=-I$(IDIR) -Wall -g
ODIR=obj
SRCDIR=src
default: all
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
%.o: %.c $(DEPS)
default: a.out
%.o: %c $(DEPS)
    $(CC) $(CFLAGS) -c -o $@ $<
all: $(OBJ)
    $(CC) $(CFLAGS) $^
a.out: $(_OBJ)
    $(CC) $(CFLAGS) -o $@ $^
.PHONY: clean
clean:
    rm -rf *.o *~
include/dns.h
New file
@@ -0,0 +1,12 @@
// DNS resource records
#define T_A 1                   // IPv4 address
#define T_NS 2                  // Name Server
#define T_CNAME 5               // Cannonical name
#define T_SOA 6                 // State of Authority
#define T_PTR 12                // Domain name pointer
#define T_MX 15                 // Mail exchange
#define T_TXT 16                // Text record
#define T_AAAA 28               // IPv6 address
void resolve(unsigned char* buf, char* hostname, char* dns_ip, int query_type);
void print_packet(unsigned char* buf);